From 9916aae0ac1d1834e247700be1484888a56db710 Mon Sep 17 00:00:00 2001
From: Jan Thorbecke <janth@xs4all.nl>
Date: Tue, 12 Mar 2019 07:26:59 +0100
Subject: [PATCH] MKL

---
 Make_include_template | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/Make_include_template b/Make_include_template
index 67ba438..3c17947 100644
--- a/Make_include_template
+++ b/Make_include_template
@@ -84,11 +84,13 @@ OPTC += -fopenmp
 #############################################################################
 # BLAS and LAPACK libraries 
 MKLROOT=/opt/intel/mkl/
+MKLLIB=${MKLROOT}/lib
 #for GNU compilers
 #you might need to add intel64 to : ${MKLROOT}/lib/intel64
 BLAS = -L${MKLROOT}/lib/ -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
-#on linux you want to use a group
-#BLAS = -Wl,--start-group -L${MKLROOT}/lib/intel64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread -lm -ldl
+#on linux you want to use groups and MKL is in lib/intel64
+#MKLLIB=${MKLROOT}/lib/intel64
+#BLAS = -Wl,-rpath ${MKLLIB} -Wl,--start-group -L${MKLLIB} -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread -lm -ldl
 #for intel compilers
 #BLAS = -mkl
 
@@ -100,14 +102,15 @@ BLAS = -L${MKLROOT}/lib/ -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm
 #BLAS = -L$(AMDROOT)/lib -lacml -lfortran -lffio -lrt -lm
 #Intel MKL
 MKLROOT=/opt/intel/mkl/
+MKLLIB=${MKLROOT}/lib
 OPTC += -DMKL -I$(MKLROOT)/include
 #for GNU compilers
-#you might need to add intel64 to : ${MKLROOT}/lib/intel64
-FFT = -L${MKLROOT}/lib/ -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
-#on linux you want to use groups
-#FFT = -Wl,--start-group -L${MKLROOT}/lib/intel64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread -lm -ldl
-#for intel compilers
-#FFT = ${MKLROOT}/lib/libmkl_intel_lp64.a ${MKLROOT}/lib/libmkl_sequential.a ${MKLROOT}/lib/libmkl_core.a -lpthread -lm -ldl
+FFT = -Wl,-rpath ${MKLLIB} -L${MKLLIB} -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
+#on linux you want to use groups and MKL is in lib/intel64
+#MKLLIB=${MKLROOT}/lib/intel64
+#FFT = -Wl,-rpath ${MKLLIB} -Wl,--start-group -L${MKLLIB} -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread -lm -ldl
+#for Intel compilers
+#FFT = -Wl,-rpath ${MKLLIB} -L${MKLLIB} -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
 
 #LIBARIES
 LIBS= -L$L -lgenfft $(FFT) $(BLAS)
-- 
GitLab