Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

mex and OSX, symbol not found for libmkl_intel_thread.dylib library

Silvia_Z_
Beginner
326 Views

Hi,

I have the following problem. My OS

I compile a mex file with the following command:

/Applications/MATLAB_R2013b.app//bin/mex myfile.cpp mylib.a \

        CXXFLAGS="\$CXXFLAGS -pthread -fPIC -DNDEBUG -O2 -I/usr/local/include -I/usr/include/python2.7 -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/Users/silvia/Tools/leveldb-1.15.0/include -I/opt/intel/mkl/include/intel64/lp64 -I./src -I./include -I/usr/local/cuda/include -I/opt/intel/mkl/include -Wall" \
        CXXLIBS="\$CXXLIBS -L/usr/lib -L/usr/local/lib -L/ -L/Users/silvia/Tools/leveldb-1.15.0/ -L/usr/local/cuda/lib/ -L/usr/local/cuda/lib -L/opt/intel/mkl/lib -L/opt/intel/lib -lcudart -lcublas -lcurand -lprotobuf -lopencv_core -lopencv_highgui -lglog -lmkl_rt -lmkl_intel_thread -liomp5 -lmkl_intel_lp64 -lleveldb -lsnappy -lpthread -lboost_system -lopencv_imgproc" \
        -o mymexfile

when I run the mex file in Matlab I got this error:

Invalid MEX-file '/Users/silvia/mymexfile.mexmaci64':
dlopen(/Users/silvia/mymexfile.mexmaci64, 6): Symbol not found: _mkl_lapack_cdfirstval
  Referenced from: /opt/intel/mkl/lib/libmkl_intel_thread.dylib
  Expected in: dynamic lookup

I have set up the following variables, and I run Matlab from a shell

export LD_LIBRARY_PATH="/usr/local/cuda/lib:/opt/intel/lib:/opt/intel/mkl/lib:$LD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="/usr/local/cuda/lib:/opt/intel/lib:/opt/intel/mkl/lib:$DYLD_LIBRARY_PATH"

 

Thanks

Silvia

 

 

0 Kudos
1 Reply
Gennady_F_Intel
Moderator
326 Views

you are linking with 64bits mkl's libraries. The symptoms indicates these libraries were not found into systems paths.  Please check it first of all.

0 Kudos
Reply