i try to use static MKL, like this:
BLASLDFLAGS= \
$(MKLROOT)/lib/libmkl_intel_lp64.a \
$(MKLROOT)/lib/libmkl_intel_thread.a \
$(MKLROOT)/lib/libmkl_core.a \
-lpthread -lrt -ldl
but something wrong, like below, awk for help!
/home/users/wangsijiang01/.jumbo/opt/gcc48/bin/g++ -o tests/demo_ivfpq_indexing -fPIC -m64 -Wall -g -O3 -msse4 -mpopcnt -fopenmp -Wno-sign-compare -Dnullptr=NULL -Doverride= -fopenmp -I/home/users/wangsijiang01/bc_out/baidu/third-party/mkl/output/include tests/demo_ivfpq_indexing.cpp libfaiss.a -g -fPIC -fopenmp /home/users/wangsijiang01/bc_out/baidu/third-party/mkl/output/lib/libmkl_intel_lp64.a /home/users/wangsijiang01/bc_out/baidu/third-party/mkl/output/lib/libmkl_intel_thread.a /home/users/wangsijiang01/bc_out/baidu/third-party/mkl/output/lib/libmkl_core.a -lpthread -lrt -ldl
/home/users/wangsijiang01/bc_out/baidu/third-party/mkl/output/lib/libmkl_intel_thread.a(sorgqr_par.o): In function `mkl_lapack_sorgqr':
sorgqr_omp_gen.f:(.text+0x3f7): undefined reference to `__kmpc_global_thread_num'
sorgqr_omp_gen.f:(.text+0x460): undefined reference to `__kmpc_ok_to_fork'
Hi
Setting MKL flags is a frustrating process of trial and errors. Please post here if you manage to fix this compile error, we will incorporate it in the documentation.
For what it's worth, this tool helped me get me get static linking working on OSX
https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor
successful compile MKL in stitac link, using conf blow:
CFLAGS=-fPIC -m64 -Wall -g -O3 -msse4 -mpopcnt -fopenmp -Wno-sign-compare -Dnullptr=NULL -Doverride= -fopenmp \
-DMKL_ILP64 -m64 -I${MKLROOT}/include
BLASLDFLAGS= -Wl,--start-group ${MKLROOT}/lib/libmkl_intel_ilp64.a ${MKLROOT}/lib/libmkl_gnu_thread.a \
${MKLROOT}/lib/libmkl_core.a -Wl,--end-group -lgomp -lpthread -lm -ldl
BLASCFLAGS=-DFINTEGER=long
Thanks @wangsouc!
Closing issue.
Most helpful comment
For what it's worth, this tool helped me get me get static linking working on OSX
https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor