Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7953 Discussions

invalid mex-file: libirng.so - undefined symbol: __intel_cpu_feature_indicator.

QFang1
Novice
1,653 Views

I was trying to compile the below c/mex code using icc/mkl on a Linux box running Ubuntu 14.04.

http://www.umiacs.umd.edu/~yluo1/Projects/NNLS.html
http://www.umiacs.umd.edu/~yluo1/Downloads/NNLS_CPU.zip

I installed the latest parallel studio (parallel_studio_xe_2016.3.067), which includes a copy of icc 16.0.3 and compilers_and_libraries_2016.3.210 (includign mkl). Compilation was successful, however, when I run the compiled mex file in matlab, I got the following error:

??? Invalid MEX-file '.../Library/NNLS_CPU/matlab/NNLS.mexa64':
.../Library/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64/libirng.so: undefined symbol: __intel_cpu_feature_indicator.

I also tried an older parallel studio (compilers_and_libraries_2016.2.181), same error.

I found a couple of complains regarding this error in the past, but there is not obvious workaround.

can anyone tell me what should I do to solve this problem?

thanks

0 Kudos
8 Replies
TimP
Honored Contributor III
1,653 Views

The error seems to imply that you don't have all the required .so from icc installed and appearing ahead of older versions on LD_LIBRARY_PATH.

0 Kudos
QFang1
Novice
1,653 Views

hi Tim, thanks for your reply. To ensure that I am using the latest icc/mkl, I used the below commands under the same terminal

source /home/users/fangq/space/Library/intel/bin/iccvars.sh intel64
cd NNLS_CPU
make clean
make
matlab -nojvm
>> cd matlab
>> randomNNLS

However, I am still getting the same error. I checked the environment var, they seem to be ok:

fangq@wazu:~/space/Library/NNLS_CPU/matlab$ echo $LD_LIBRARY_PATH
/local_mount/space/wazu/1/users/fangq/Library/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:/local_mount/space/wazu/1/users/fangq/Library/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64_lin:/local_mount/space/wazu/1/users/fangq/Library/intel/compilers_and_libraries_2016.3.210/linux/mpi/intel64/lib:/local_mount/space/wazu/1/users/fangq/Library/intel/compilers_and_libraries_2016.3.210/linux/mpi/mic/lib:/local_mount/space/wazu/1/users/fangq/Library/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:/local_mount/space/wazu/1/users/fangq/Library/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64:/local_mount/space/wazu/1/users/fangq/Library/intel/compilers_and_libraries_2016.3.210/linux/tbb/lib/intel64/gcc4.4:/local_mount/space/wazu/1/users/fangq/Library/intel/debugger_2016/libipt/intel64/lib:/usr/local/cuda/lib64:/usr/lib

fangq@wazu:~/space/Library/NNLS_CPU/matlab$ env | grep MKL
MKLROOT=/local_mount/space/wazu/1/users/fangq/Library/intel/compilers_and_libraries_2016.3.210/linux/mkl

 

 

I also checked the dependencies of the generated mex file, all .so files appear to exist, and pointing to the latest MKL/MATLAB.

fangq@wazu:~/space/Library/NNLS_CPU/matlab$ ldd NNLS.mexa64 
    linux-vdso.so.1 =>  (0x00007ffd1fb1d000)
    libmx.so => /usr/local/MATLAB/R2010b/bin/glnxa64/libmx.so (0x00007f795f61f000)
    libmex.so => /usr/local/MATLAB/R2010b/bin/glnxa64/libmex.so (0x00007f795f411000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f795f1f3000)
    libmkl_intel_lp64.so => /home/users/fangq/space/Library/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64/libmkl_intel_lp64.so (0x00007f795e6e3000)
    libmkl_intel_thread.so => /home/users/fangq/space/Library/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64/libmkl_intel_thread.so (0x00007f795cdb7000)
    libmkl_core.so => /home/users/fangq/space/Library/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64/libmkl_core.so (0x00007f795b3a6000)
    libmkl_mc3.so => /home/users/fangq/space/Library/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64/libmkl_mc3.so (0x00007f7959128000)
    libmkl_def.so => /home/users/fangq/space/Library/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64/libmkl_def.so (0x00007f79573cc000)
    libimf.so => /usr/local/MATLAB/R2010b/sys/os/glnxa64/libimf.so (0x00007f795703a000)
    libsvml.so => /usr/local/MATLAB/R2010b/sys/os/glnxa64/libsvml.so (0x00007f7956e23000)
    libirng.so => /local_mount/space/wazu/1/users/fangq/Library/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64/libirng.so (0x00007f7956ab1000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f79567ab000)
    libiomp5.so => /usr/local/MATLAB/R2010b/sys/os/glnxa64/libiomp5.so (0x00007f795fada000)
    libgcc_s.so.1 => /usr/local/MATLAB/R2010b/sys/os/glnxa64/libgcc_s.so.1 (0x00007f7956595000)
    libintlc.so.5 => /usr/local/MATLAB/R2010b/sys/os/glnxa64/libintlc.so.5 (0x00007f7956458000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7956093000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7955e8f000)
    libut.so => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/libut.so (0x00007f7955ba9000)
    libmwfl.so => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/libmwfl.so (0x00007f7955903000)
    libicudata.so.42 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/libicudata.so.42 (0x00007f79547be000)
    libicuuc.so.42 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/libicuuc.so.42 (0x00007f795445f000)
    libicui18n.so.42 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/libicui18n.so.42 (0x00007f79540bc000)
    libicuio.so.42 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/libicuio.so.42 (0x00007f7953eb0000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f7953c97000)
    libstdc++.so.6 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6 (0x00007f7953991000)
    libmwservices.so => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/libmwservices.so (0x00007f79535dc000)
    libmwmpath.so => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/libmwmpath.so (0x00007f795339f000)
    libmwm_dispatcher.so => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/libmwm_dispatcher.so (0x00007f7953120000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f795fa89000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7952f18000)
    libmwi18n.so => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libmwi18n.so (0x00007f7952cd3000)
    libboost_date_time.so.1.40.0 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libboost_date_time.so.1.40.0 (0x00007f7952ac0000)
    libboost_system.so.1.40.0 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libboost_system.so.1.40.0 (0x00007f79528bd000)
    libboost_thread.so.1.40.0 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libboost_thread.so.1.40.0 (0x00007f79526a8000)
    libexpat.so.1 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libexpat.so.1 (0x00007f7952480000)
    libtbb.so.2 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libtbb.so.2 (0x00007f7952349000)
    libtbbmalloc.so.2 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libtbbmalloc.so.2 (0x00007f7952224000)
    libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f7951feb000)
    libboost_filesystem.so.1.40.0 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libboost_filesystem.so.1.40.0 (0x00007f7951dd7000)
    libboost_signals.so.1.40.0 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libboost_signals.so.1.40.0 (0x00007f7951bc1000)
    libmwmathutil.so => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libmwmathutil.so (0x00007f7951944000)
    libmwmlutil.so => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libmwmlutil.so (0x00007f79515f9000)
    libboost_serialization.so.1.40.0 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libboost_serialization.so.1.40.0 (0x00007f7951388000)
    libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007f7951165000)
    libmwxmlcore.so => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libmwxmlcore.so (0x00007f7950eeb000)
    libboost_regex.so.1.40.0 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libboost_regex.so.1.40.0 (0x00007f7950c18000)
    libxerces-c.so.27 => /usr/local/MATLAB/R2010b/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libxerces-c.so.27 (0x00007f7950619000)
    libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f79503f0000)

 

any more suggestions?

 

 

0 Kudos
QFang1
Novice
1,653 Views

ldd dump is attached. all .so files appear to exit, with a desired version number.

0 Kudos
QFang1
Novice
1,653 Views

update:

I managed to find a workaround - I added "-static-intel" and "-liomp5" in the compilation command, now if I do ldd, libirng becomes statically linked with the mex file (all MKL libarary files remains dynamically linked). however, the libirng complain disappeared.

the full compilation command is now

icc -I /usr/local/MATLAB/R2010b/extern/include -L /usr/local/MATLAB/R2010b/bin/glnxa64 -static-intel  -lmx -lmex -qopenmp -lpthread -qopenmp-report2 -liomp5 -I /home/users/fangq/space/Library/intel/compilers_and_libraries_2016.3.210/linux/mkl/include -L/home/users/fangq/space/Library/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64 -Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_lapack95_lp64 -lmkl_core -lmkl_mc3 -lmkl_def  -Wl,--end-group -L/home/users/fangq/space/Library/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64_lin/ -Wl,-rpath,/home/users/fangq/space/Library/intel/compilers_and_libraries_2016.3.210/linux/mkllib/intel64/:/home/users/fangq/space/Library/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64:/usr/local/MATLAB/R2010b/bin/glnxa64:/usr/local/MATLAB/R2010b/extern/lib/glnxa64:/usr/local/MATLAB/R2010b/sys/os/glnxa64 -O3 -fpic  main.c -shared -o matlab/NNLS.mexa64

 

0 Kudos
QFang1
Novice
1,653 Views

OMG, I did not know all my attempts ended up in the thread.

when I tried to submit my posts #3 through #8 last night, the webpage simply returned to the editing interface, and nothing was posted, even after a refresh. I thought those were due to character limitations.

wondering if I can delete these redundant posts? I'd like to remove reply #4-#9. thanks

0 Kudos
Yuan_C_Intel
Employee
1,653 Views

Hi, Fang

I have deleted those redundants posts.

To link dynamically, could you try link with "-mkl" instead of specify them manually, those:
 "-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_lapack95_lp64 -lmkl_core -lmkl_mc3 -lmkl_def"?

Will it work?

I guess if the default search path sequence may not work properly with some specified mkl library.

Thanks.

0 Kudos
TimP
Honored Contributor III
1,653 Views

Yuan C. (Intel) wrote:

 

To link dynamically, could you try link with "-mkl" instead of specify them manually, those:
 "-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_lapack95_lp64 -lmkl_core -lmkl_mc3 -lmkl_def"?

Will it work?

I guess if the default search path sequence may not work properly with some specified mkl library.


 

-mkl option probably doesn't include lapack95, but your ldd quotation seems to indicate you aren't using that.

Combining multiple threading models (OpenMP, TBB, Boost) gets tricky.  If your only usage of OpenMP is in MKL, and you have reasons for using TBB, perhaps the -mkl -tbb option might suit you.

0 Kudos
QFang1
Novice
1,653 Views

hi Yuan and Tim, thanks for your feedback. I tried placing all -lmkl* libraries by "-mkl" and "-mkl -tbb", neither of them ended up with the same "__intel_cpu_feature_indicator" error from libirng. Not sure if this is specific to this code, or may happen in other scenarios. 

Reply