本文介绍了如何确保numpy BLAS库作为动态可加载库可用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

theano安装文档指出, theano 将默认使用numpy的BLAS库,如果"BLAS库可作为可动态加载的库".这似乎在我的计算机上不起作用,请参阅错误消息.

The theano installation documentation states, that theano will as a default use the BLAS libraries from numpy, if the "BLAS libraries are available as dynamically-loadable libraries". This seems not to be working on my machine, see error message.

  • 如何确定numpy BLAS库是否可以动态加载?
  • 如果无法动态加载numpy的BLAS库,我该如何重新编译?

请指明是否需要更多信息!

Please indicate, if you would need more information!

错误消息

We did not found a dynamic library into the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library./usr/bin/ld: cannot find -lblas

We did not found a dynamic library into the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library./usr/bin/ld: cannot find -lblas

附录

theano 库除了需要numpy和BLAS库外,还需要其他功能.我认为numpy是BLAS附带的,如果您在Ubuntu下使用 sudo apt-get install python-numpy python-scipy 进行安装的话.

The theano library needs among other things numpy and a BLAS library. I figured numpy comes with BLAS if you install it with sudo apt-get install python-numpy python-scipy under Ubuntu.

这是/usr/lib64/python2.6/dist-packages/scipy/lib/blas

cblas.so  info.py   __init__.py   scons_support.py   setup.py
fblas.so  info.pyc  __init__.pyc  scons_support.pyc  setup.pyc
setupscons.py  test
setupscons.pyc

这是distutils.__config__.show()的输出,如下所示

blas_info:
    libraries = ['blas']
    library_dirs = ['/usr/lib64']
    language = f77

lapack_info:
    libraries = ['lapack']
    library_dirs = ['/usr/lib64']
    language = f77

atlas_threads_info:
  NOT AVAILABLE

blas_opt_info:
    libraries = ['blas']
    library_dirs = ['/usr/lib64']
    language = f77
    define_macros = [('NO_ATLAS_INFO', 1)]

atlas_blas_threads_info:
  NOT AVAILABLE

lapack_opt_info:
    libraries = ['lapack', 'blas']
    library_dirs = ['/usr/lib64']
    language = f77
    define_macros = [('NO_ATLAS_INFO', 1)]

atlas_info:
  NOT AVAILABLE

lapack_mkl_info:
  NOT AVAILABLE

blas_mkl_info:
  NOT AVAILABLE

atlas_blas_info:
  NOT AVAILABLE

mkl_info:
  NOT AVAILABLE

推荐答案

下载蟒蛇库的Anaconda发行版后,我在64位Ubuntu 12.04 LTS上遇到了相同的问题.将Theano指向包含libblas.so的目录就可以了.

After downloading the Anaconda distro of python libraries, I just encountered the same issue on Ubuntu 12.04 LTS 64-bit. Pointing Theano to the directory containing libblas.so took care of it.

$ THEANO_FLAGS=blas.ldflags="-L/usr/lib/ -lblas" python rbm.py

这篇关于如何确保numpy BLAS库作为动态可加载库可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-13 08:11