编译例子:
gcc -o foo foo.c -I/opt/intel/mkl/10.1.0.015/include
-L/opt/intel/mkl/10.1.0.015/lib/32 -lmkl_intel ... <other MKL libs>
错误提示:
./foo: error while loading shared libraries
libmkl_intel.so: cannot open shared object file
No such file or directory
解决办法:在Liunx 环境变量中加入Intel MKL 库文件路径
Intel 官网详解:
Before using the Intel® MKL shared libraries, update the system variable LD_LIBRARY_PATH to include the libraries location. For example, if the Intel MKL libraries are in the /opt/intel/mkl/10.1.0.015/lib/32 directory then the following command line can be used (assuming a bash shell):export LD_LIBRARY_PATH=/opt/intel/mkl/lib/ia32:$LD_LIBRARY_PATH
参考 Intel 官网问答
本文介绍了解决在Linux环境下使用GCC编译时遇到Intel MKL库加载失败的问题。通过向环境变量LD_LIBRARY_PATH中添加正确的库路径,可以有效避免加载错误。文章提供了具体的命令示例,并附带了Intel官方文档链接。
834





