From 388b1d13c4803dafd495162e8e213ac89dc52f31 Mon Sep 17 00:00:00 2001 From: slopqueue Date: Sat, 8 Aug 2026 23:45:21 +0000 Subject: [PATCH 1/2] Use avx2 compile target for STELLOPT on ITP machines --- scripts/setup/stellopt/make_scluster.inc | 2 +- scripts/setup/stellopt/make_vsc5.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setup/stellopt/make_scluster.inc b/scripts/setup/stellopt/make_scluster.inc index 959c2bb..c2dc42d 100644 --- a/scripts/setup/stellopt/make_scluster.inc +++ b/scripts/setup/stellopt/make_scluster.inc @@ -17,7 +17,7 @@ ####################################################################### # Define Compiler Flags ####################################################################### - FLAGS_R = -O2 -fexternal-blas -fbacktrace -march=native + FLAGS_R = -O2 -fexternal-blas -fbacktrace -march=avx2 FLAGS_D = -g -O0 -fexternal-blas -fcheck=all # Use OpenBLAS (includes LAPACK) OPENBLAS_DIR = $(CODE_ROOT)/external/OpenBLAS-0.3.28/install diff --git a/scripts/setup/stellopt/make_vsc5.inc b/scripts/setup/stellopt/make_vsc5.inc index 34ed47b..63fbc01 100644 --- a/scripts/setup/stellopt/make_vsc5.inc +++ b/scripts/setup/stellopt/make_vsc5.inc @@ -17,7 +17,7 @@ ####################################################################### # Define Compiler Flags ####################################################################### - FLAGS_R = -O2 -fexternal-blas -fbacktrace -march=native + FLAGS_R = -O2 -fexternal-blas -fbacktrace -march=avx2 FLAGS_D = -g -O0 -fexternal-blas -fcheck=all # Use MKL for BLAS/LAPACK LIBS = -L$(MKLROOT)/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl From 05477a250531c745ebeaae8b6ffe6692dc8bf799 Mon Sep 17 00:00:00 2001 From: slopqueue Date: Sun, 9 Aug 2026 00:04:40 +0000 Subject: [PATCH 2/2] Fix invalid gfortran -march target in STELLOPT release builds gfortran does not accept -march=avx2 as an x86 CPU target. Replace it with the valid core-avx2 target and add -mtune=generic for portability. --- scripts/setup/stellopt/make_scluster.inc | 2 +- scripts/setup/stellopt/make_vsc5.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setup/stellopt/make_scluster.inc b/scripts/setup/stellopt/make_scluster.inc index c2dc42d..ea32134 100644 --- a/scripts/setup/stellopt/make_scluster.inc +++ b/scripts/setup/stellopt/make_scluster.inc @@ -17,7 +17,7 @@ ####################################################################### # Define Compiler Flags ####################################################################### - FLAGS_R = -O2 -fexternal-blas -fbacktrace -march=avx2 + FLAGS_R = -O2 -fexternal-blas -fbacktrace -march=core-avx2 -mtune=generic FLAGS_D = -g -O0 -fexternal-blas -fcheck=all # Use OpenBLAS (includes LAPACK) OPENBLAS_DIR = $(CODE_ROOT)/external/OpenBLAS-0.3.28/install diff --git a/scripts/setup/stellopt/make_vsc5.inc b/scripts/setup/stellopt/make_vsc5.inc index 63fbc01..29a73c9 100644 --- a/scripts/setup/stellopt/make_vsc5.inc +++ b/scripts/setup/stellopt/make_vsc5.inc @@ -17,7 +17,7 @@ ####################################################################### # Define Compiler Flags ####################################################################### - FLAGS_R = -O2 -fexternal-blas -fbacktrace -march=avx2 + FLAGS_R = -O2 -fexternal-blas -fbacktrace -march=core-avx2 -mtune=generic FLAGS_D = -g -O0 -fexternal-blas -fcheck=all # Use MKL for BLAS/LAPACK LIBS = -L$(MKLROOT)/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl