Replace MKL with OpenBLAS

- TwoPunctures.C: <mkl_cblas.h> → <cblas.h>
- gaussj.C: <mkl_lapacke.h> → <lapacke.h>
- 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 <noreply@anthropic.com>
This commit is contained in:
2026-04-28 22:33:43 +08:00
parent 9687d9a3dd
commit 516cdea502
4 changed files with 9 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ using namespace std;
#endif
#include "TwoPunctures.h"
#include <mkl_cblas.h>
#include <cblas.h>
TwoPunctures::TwoPunctures(double mp, double mm, double b,
double P_plusx, double P_plusy, double P_plusz,

View File

@@ -18,7 +18,7 @@ using namespace std;
#endif
// Intel oneMKL LAPACK interface
#include <mkl_lapacke.h>
#include <lapacke.h>
/* 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

View File

@@ -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 $@

View File

@@ -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)