本文介绍了安装scipy时,在带有MKL的计算机上找不到BLAS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为自定义的numpy安装了Intel MKL和其他库.这是我的~/.numpy-site.cfg:

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

在安装numpy期间,此配置文件似乎正常.但是当我通过pip3 install scipy安装scipy时,它报告了

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.

在我看来,MKL是Blas的一个实现,因此只需提及MKL即可.我已经尝试过

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. 复制[mkl]部分中的内容,并将其粘贴到文件~/.numpy-site.cfg
  4. 中的[blas]部分中
  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

但是这些都不起作用.那么怎么了? scipy尊重~/.numpy-site.cfg吗?谢谢.

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

推荐答案

您在..../intel64中的库的扩展名是什么?我有一个类似的问题,因为安装脚本.so.3.0的扩展找不到库.我的解决方案是创建符号链接: https://stackoverflow.com/a/23325759/1430829 .也许这对您也有用吗?

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?

这篇关于安装scipy时,在带有MKL的计算机上找不到BLAS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-05 20:07