Faiss: how to Compile Faiss using static MKL

Created on 26 Apr 2017  路  4Comments  路  Source: facebookresearch/faiss

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'
help wanted

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

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tony-Hou picture Tony-Hou  路  3Comments

linghuang picture linghuang  路  3Comments

maozezhong picture maozezhong  路  3Comments

lukedeo picture lukedeo  路  3Comments

jukaradayi picture jukaradayi  路  3Comments