Fra*_*ter 13 numpy gfortran scipy theano
我在我的机器上安装了Theano,但是nosetests打破了Numpy/Fortran相关的错误消息.对我来说,看起来像Numpy编译的是与Theano不同的Fortran版本.我已经重新安装了Theano(sudo pip uninstall theano+ sudo pip install --upgrade --no-deps theano)和Numpy/Scipy(apt-get install --reinstall python-numpy python-scipy),但这没有帮助.
你会推荐什么步骤?
ImportError: ('/home/Nick/.theano/compiledir_Linux-2.6.35-31-generic-x86_64-with-Ubuntu-10.10-maverick--2.6.6/tmpIhWJaI/0c99c52c82f7ddc775109a06ca04b360.so: undefined symbol: _gfortran_st_write_done'
Run Code Online (Sandbox Code Playgroud)
有关错误的安装SciPy/BuildingGeneral页面undefined symbol: _gfortran_st_write_done':
如果您看到错误消息
ImportError: /usr/lib/atlas/libblas.so.3gf: undefined symbol: _gfortran_st_write_done
在构建SciPy时,这意味着NumPy在构建期间选择了错误的Fortran编译器(例如ifort).
使用以下方法重新编译NumPy:
python setup.py build --fcompiler=gnu95
或以适当者为准(见python setup.py build --help-fcompiler).
但:
Nick@some-serv2:/usr/local/lib/python2.6/dist-packages/numpy$ python setup.py build --help-fcompiler
This is the wrong setup.py file to run
Run Code Online (Sandbox Code Playgroud)
undefined symbol: _gfortran_st_write_done')所以我从我的系统中移除了numpy和scipy apt-get remove并使用find -name XXX -delete剩下的东西.
比我从github源安装numpy和scipy sudo python setpy.py install.
后来我又进sudo pip uninstall theano和sudo pip install --upgrade --no-deps theano.
错误仍然存在:/
我也尝试了apt-get source... + apt-get build-dep ...方法,但是对于我的旧Ubuntu(10.10),它为theano安装了太旧版本的numpy和scipy:ValueError: numpy >= 1.4 is required (detected 1.3.0 from /usr/local/lib/python2.6/dist-packages/numpy/__init__.pyc)
Ale*_*des 11
我遇到了同样的问题,在查看了源代码后,user212658的答案看起来好像可行(我还没试过).然后我找了一种方法来部署user212658的hack而不修改源代码.
将这些行放在您的theanorc文件中:
[blas]
ldflags = -lblas -lgfortran
Run Code Online (Sandbox Code Playgroud)
这对我有用.
您是否尝试过从源代码重新编译 NumPy?
我对 Ubuntu 软件包系统不熟悉,所以我无法检查你的dist-packages/numpy. 有了干净的源档案NumPy,您应该拥有setup.py与目录相同级别的numpy、tools和benchmarks(除其他外)。我很确定这就是您想要用于python setup.py build.
[编辑]
既然您已经numpy使用正确的--fcompiler选项重新编译,也许您可以尝试对 执行相同的操作Theano,即直接从源代码进行编译,而不依赖于 aapt-get甚至pip. 您应该以这种方式更好地控制构建过程,这将使调试/尝试找到解决方案变得更容易。