1

我在 Linux ( ) 上使用 Intel C++ 和 Intel MKL 为 Python 3(64 位)构建 numpy 3.11-1-amd64。我从 git 得到了源代码。我还为 Linux 安装了 Intel C++ Composer XE 2013。

这是我所做的:

  1. 在源文件夹中创建了一个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 =
    
  2. self.cc_exe将in更改numpy/distutils/intelccompiler.py'icc -O3 -g -fPIC -fp-model strict -fomit-frame-pointer -openmp -xhost'

  3. 添加了库路径:export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:/opt/intel/lib/intel64:$LD_LIBRARY_PATH

  4. 执行sudo python3 setup.py config --compiler=intel build_clib --compiler=intel build_ext --compiler=intel install

一切都完成后,我启动了python3and 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,文件就在那里。我错过了什么吗?谢谢你。

4

1 回答 1

0

这让我在下午的大部分时间都发疯了。显然 scipy 和 sudo 之间有血缘关系;您需要在没有 sudo. 这意味着使用--prefix=/I/Have/write/permission/herescipy 源目录的权限或更改权限进行安装,错误将在 config-build 部分引发。

于 2014-04-15T23:12:40.410 回答