我试图在Ubuntu 14.04上使用OpenBLAS安装Numpy和Scipy来更快地运行Theano。
我按照发现here:
的说明进行操作git clone https://github.com/xianyi/OpenBLAS
cd OpenBLAS
make FC=gfortran
sudo make PREFIX=/opt/openblas install
在/ usr / local / lib中安装numpy:
git clone https://github.com/numpy/numpy
cd numpy
这是我的site.cfg文件:
[default]
include_dirs = /opt/openblas/include
library_dirs = /opt/openblas/lib
[openblas]
openblas_libs = openblas
library_dirs = /opt/openblas/lib
[lapack]
lapack_libs = openblas
library_dirs = /opt/openblas/lib
大厦:
python setup.py build --fcompiler=gnu95
安装:
python setup.py install
我无法在build / lib.linux-x86_64-2.7 / numpy / core下找到core / _dotblas.so,但在测试点,乘法,SVD和Eigendecomposition操作时,我得到了很好的结果。
所以看起来numpy正确安装了。问题出现在我尝试安装Scipy时,因为pip安装应该有效,所以没有该部分的文档。
在/ usr / local / lib中克隆scipy:
git clone https://github.com/scipy/scipy
获取libatlas:
sudo apt-get install libatlas-base-dev
cd /usr/local/lib
sudo ln -sn /usr/lib/atlas-base/liblapack_atlas.a liblapack_atlas.a
sudo ln -sn /usr/lib/atlas-base/liblapack_atlas.so liblapack_atlas.so
scipy的site.cfg文件:
[default]
include_dirs = /opt/openblas/include
library_dirs = /opt/openblas/lib
[atlas]
atlas_libs = lapack_atlas,openblas,cblas
建筑scipy:
python setup.py build
给了我以下错误:
compiling C++ sources
C compiler: c++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC
compile options: '-Iscipy/interpolate/src -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c'
c++: scipy/interpolate/src/_interpolate.cpp
sh: 1: c++: not found
sh: 1: c++: not found
error: Command "c++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -Iscipy/interpolate/src -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c scipy/interpolate/src/_interpolate.cpp -o build/temp.linux-x86_64-2.7/scipy/interpolate/src/_interpolate.o" failed with exit status 127
我花了很多时间寻找建议,不知道下一步该怎么做。