From 516cdea5023c707e928a36e229f70ddae346cf9b Mon Sep 17 00:00:00 2001 From: CGH0S7 <776459475@qq.com> Date: Tue, 28 Apr 2026 22:33:43 +0800 Subject: [PATCH] Replace MKL with OpenBLAS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - TwoPunctures.C: - gaussj.C: - makefile.inc: use -lopenblaso, remove MKLROOT dependency - makefile: remove -I${MKLROOT}/include from all flag variables - Add OpenMPI include path to filein (needed since g++ is used for .C compilation, not the mpicxx wrapper) Co-Authored-By: Claude Opus 4.7 --- AMSS_NCKU_source/TwoPunctures.C | 2 +- AMSS_NCKU_source/gaussj.C | 2 +- AMSS_NCKU_source/makefile | 6 +++--- AMSS_NCKU_source/makefile.inc | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/AMSS_NCKU_source/TwoPunctures.C b/AMSS_NCKU_source/TwoPunctures.C index 1b6e590..9101183 100644 --- a/AMSS_NCKU_source/TwoPunctures.C +++ b/AMSS_NCKU_source/TwoPunctures.C @@ -27,7 +27,7 @@ using namespace std; #endif #include "TwoPunctures.h" -#include +#include TwoPunctures::TwoPunctures(double mp, double mm, double b, double P_plusx, double P_plusy, double P_plusz, diff --git a/AMSS_NCKU_source/gaussj.C b/AMSS_NCKU_source/gaussj.C index 86c7777..cfc78b4 100644 --- a/AMSS_NCKU_source/gaussj.C +++ b/AMSS_NCKU_source/gaussj.C @@ -18,7 +18,7 @@ using namespace std; #endif // Intel oneMKL LAPACK interface -#include +#include /* Linear equation solution using Intel oneMKL LAPACK. a[0..n-1][0..n-1] is the input matrix. b[0..n-1] is input containing the right-hand side vectors. On output a is diff --git a/AMSS_NCKU_source/makefile b/AMSS_NCKU_source/makefile index 8ccb2c1..373cab3 100644 --- a/AMSS_NCKU_source/makefile +++ b/AMSS_NCKU_source/makefile @@ -43,10 +43,10 @@ ESCALAR_KERNEL_FLAG = -DBSSN_USE_ESCALAR_C_KERNEL=$(EFFECTIVE_USE_CXX_ESCALAR_KE ## GCC build flags (optimized for x86-64-v4) ## PGO disabled (used negative optimization on Intel; not tested on GCC) CXXAPPFLAGS = -O3 -march=x86-64-v4 -ffast-math -mfma -flto \ - -Dfortran3 -Dnewc -I${MKLROOT}/include $(INTERP_LB_FLAGS) \ + -Dfortran3 -Dnewc $(INTERP_LB_FLAGS) \ $(TRANSFER_CACHE_FLAG) $(ESCALAR_KERNEL_FLAG) f90appflags = -O3 -march=x86-64-v4 -ffast-math -mfma -flto \ - -cpp -I${MKLROOT}/include $(POLINT6_FLAG) + -cpp $(POLINT6_FLAG) .SUFFIXES: .o .f90 .C .for .cu @@ -89,7 +89,7 @@ z4c_rhs_c.o: z4c_rhs_c.C ## TwoPunctureABE flags (no PGO; PGO was negative optimization) TP_OPTFLAGS = -O3 -march=x86-64-v4 -ffast-math -mfma -flto \ - -Dfortran3 -Dnewc -I${MKLROOT}/include + -Dfortran3 -Dnewc TwoPunctures.o: TwoPunctures.C ${CXX} $(TP_OPTFLAGS) -fopenmp -c $< -o $@ diff --git a/AMSS_NCKU_source/makefile.inc b/AMSS_NCKU_source/makefile.inc index 44d544c..1918e73 100755 --- a/AMSS_NCKU_source/makefile.inc +++ b/AMSS_NCKU_source/makefile.inc @@ -1,8 +1,8 @@ -## GCC version with OpenMPI and oneMKL -filein = -I/usr/include/ -I${MKLROOT}/include +## GCC version with OpenMPI and OpenBLAS +filein = -I/usr/include/ -I/usr/mpi/gcc/openmpi-4.1.9a1/include -## Using MKL with gfortran interface (-lmkl_gf_lp64 instead of -lmkl_intel_lp64) -LDLIBS = -L${MKLROOT}/lib -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lgfortran -lpthread -lm -ldl -lgomp +## OpenBLAS (OpenMP variant) + gfortran runtime +LDLIBS = -lopenblaso -lgfortran -lpthread -lm -ldl -lgomp ## Memory allocator switch ## 0 (default) : use system default allocator (ptmalloc)