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

error using mkl as default blas implementation on linux

Bogdan_B_2
初学者
2,351 次查看

Hi,

I don't know if this makes much sense, but I tried to use update-alternatives on linux to make all the symlinks for libblas.so, libblas.so.3gf, liblapack.so and liblapack.so.3gf point to libmkl_rt.so. I was hoping that this way numpy will use the mkl implementation of blas operations without needing to recompile it. But, as it turns out, the loader is having some trouble with the multi-threading library, which I expected to be libmkl_gnu_thread.so instead of libmkl_intel_thread.so.

python -c "from numpy import zeros; a = zeros((17,17)); b = a.dot(a)"

python: symbol lookup error: /opt/intel/mkl/lib/intel64/libmkl_intel_thread.so: undefined symbol: omp_get_num_procs

I am using mkl 11.0 update 5, which I upgraded from mkl 11.0 update 2, which didn't work either. Everything is on 64bits. I also noticed that for matrices smaller than (17, 17) ther error doesn't occur.

Thanks,

Bogdan 

0 项奖励
6 回复数
SergeyKostrov
重要分销商 II
2,351 次查看
>>.../intel/mkl/lib/intel64/libmkl_intel_thread.so: undefined symbol: omp_get_num_procs It is defined in these libraries: libiomp5md libiomp5mt libiompprof5md libiompprof5mt libiompstubs5md libiompstubs5mt
0 项奖励
Bogdan_B_2
初学者
2,351 次查看

Shouldn't one of the appropriate libraries be loaded by libmkl_rt.so?

0 项奖励
Gennady_F_Intel
主持人
2,351 次查看

yes, it will load libiomp via dlopen == > you need to add <composer_xe_install_path>\compiler/lib/intel64\ to your systems paths.

0 项奖励
Bogdan_B_2
初学者
2,351 次查看

Thanks a lot. I got it fixed by adding the path to loader's search paths in /etc/ld.so.conf.d

0 项奖励
SergeyKostrov
重要分销商 II
2,351 次查看
>>...Shouldn't one of the appropriate libraries be loaded by libmkl_rt.so? I checked dependencies and the answer is Yes. However, if a search path is Not defined ( this is what you had and fixed already ) then the loader will fail to load that module. Thanks for the update.
0 项奖励
SergeyKostrov
重要分销商 II
2,351 次查看
>>>>...Shouldn't one of the appropriate libraries be loaded by libmkl_rt.so? >> >>I checked dependencies and the answer is Yes. I was talking about libiomp5m? modules.
0 项奖励
回复