Cannot find BLAS on a machine with MKL when installing scipy

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 01:24:09

问题


I installed Intel MKL and other libraries for a customized numpy. Here is my ~/.numpy-site.cfg:

[DEFAULT]
library_dirs = /usr/lib:/usr/local/lib
include_dirs = /usr/include:/usr/local/include

[mkl]
library_dirs = /opt/intel/mkl/lib/intel64/
include_dirs = /opt/intel/mkl/include/
mkl_libs = mkl_rt
lapack_libs =

[amd]
amd_libs = amd

[umfpack]
umfpack_libs = umfpack

[djbfft]
include_dirs = /usr/local/djbfft/include
library_dirs = /usr/local/djbfft/lib

This configuration file seems OK during the installation of numpy. But when I was installing scipy via pip3 install scipy, it reported that

numpy.distutils.system_info.BlasNotFoundError:

    Blas (http://www.netlib.org/blas/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [blas]) or by setting

    the BLAS environment variable.

In my mind MKL is an implementation of Blas so just mentioning MKL should be fine. I've tried

  1. export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH‌​
  2. export BLAS=/opt/intel/mkl/lib/intel64
  3. Copy the content in the [mkl] section and paste into the [blas] section in the file ~/.numpy-site.cfg

But none of these works. So what is going wrong? Does scipy respect ~/.numpy-site.cfg? Thank you.


回答1:


What is the extension on your libs in ..../intel64? I had a similar problem where because the extensions where .so.3.0 the the setup script was not finding the libraries. My solution was to create symlinks: https://stackoverflow.com/a/23325759/1430829 . Maybe this will work for you too?



来源:https://stackoverflow.com/questions/22067761/cannot-find-blas-on-a-machine-with-mkl-when-installing-scipy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!