从 python 调用 MKL 的线程函数:未找到 openmp 库?
我正在使用 ctypes
模块将英特尔 MKL 加载到 python 中,然后我想调用一个需要 openmp 并行化的例程(pardiso
,在我的例子中),
我发现此有用链接英特尔网站详细介绍了进程,我可以运行他们的示例代码,但是当我运行我自己的使用 openmp 线程函数的示例时,程序崩溃并显示消息
python: symbol lookup error: /opt/intel/Compiler/11.1/072/mkl/lib/em64t/libmkl_intel_thread.so: undefined symbol: omp_get_num_procs
我强烈怀疑加载 libmkl_rt.so
不正确触发 libiomp5.so
的加载
我尝试将英特尔 MKL 库路径(和“正常”英特尔库路径)添加到两个 LD_RUN_PATH
和LD_LIBRARY_PATH
,无济于事,尽管这些路径中包含 mkl 库和 openmp 库(intel 版本)。
这里有什么魔术呢?
请注意,虽然我也使用 numpy,但我没有针对 mkl 构建 numpy。但我怀疑这是否重要,因为我应该能够从 mkl 调用东西,而不需要首先对 numpy 做任何事情。
I am using the ctypes
module to load the Intel MKL into python and then I'd like to call a routine that requires openmp parallelization (pardiso
, in my case)
I found this useful link on the Intel sites that details the process, and I can run their example code, but when I run my own example that uses an openmp threaded function, the program crashes with the message
python: symbol lookup error: /opt/intel/Compiler/11.1/072/mkl/lib/em64t/libmkl_intel_thread.so: undefined symbol: omp_get_num_procs
I strongly suspect that loading the libmkl_rt.so
doesn't properly trigger a load of libiomp5.so
I have tried adding the Intel MKL library paths (and the "normal" Intel library paths) to both LD_RUN_PATH
and LD_LIBRARY_PATH
, to no avail, although in these paths both the mkl libraries and the openmp library (intel version) are contained.
What's the magic trick here?
Note that although I also use numpy
, I have not built numpy
against the mkl. But I doubt that this should matter, because I should be able to call stuff from the mkl without doing anything with numpy in the first place.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NVM,原来我安装了旧版本的 MKL。
按照我为 10.3 之前的版本提供的链接上的说明,我将其启动并运行。
NVM, turns out I had an older version of the MKL installed.
Following the instructions on the link I gave for versions older than 10.3 I got it up and running.