我在 Linux ( ) 上使用 Intel C++ 和 Intel MKL 为 Python 3(64 位)构建 numpy 3.11-1-amd64
。我从 git 得到了源代码。我还为 Linux 安装了 Intel C++ Composer XE 2013。
这是我所做的:
在源文件夹中创建了一个
site.cfg
内容[mkl] library_dirs = /opt/intel/mkl/composer_xe_2013/lib/intel64 include_dirs = /opt/intel/mkl/include mkl_libs = mkl_rt lapack_libs =
self.cc_exe
将in更改numpy/distutils/intelccompiler.py
为'icc -O3 -g -fPIC -fp-model strict -fomit-frame-pointer -openmp -xhost'
添加了库路径:
export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:/opt/intel/lib/intel64:$LD_LIBRARY_PATH
执行
sudo python3 setup.py config --compiler=intel build_clib --compiler=intel build_ext --compiler=intel install
一切都完成后,我启动了python3
and import numpy
,这给出了
$ python3
Python 3.3.2+ (default, Sep 18 2013, 11:58:01)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.3/dist-packages/numpy/__init__.py", line 159, in <module>
from . import add_newdocs
File "/usr/local/lib/python3.3/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python3.3/dist-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/local/lib/python3.3/dist-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python3.3/dist-packages/numpy/core/__init__.py", line 6, in <module>
from . import multiarray
ImportError: libimf.so: cannot open shared object file: No such file or directory
但我检查过/opt/intel/lib/intel64
,文件就在那里。我错过了什么吗?谢谢你。