如何确保numpy blas库作为动态加载库可用?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (24)

Theano安装文档theano默认情况下,如果“blas库作为动态加载库可用”,则使用numpy中的blas库。这似乎不适用于我的机器,请参阅错误信息。

  • 如果numpy blas库是可动态加载的,我该如何确定呢?
  • 如果numpy blas库不能动态加载,如何重新编译它们?

错误信息

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

这是/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
提问于
用户回答回答于

对于ubuntu,在包管理器中,libblas.so添加了libblas3gf包。如果它不创建libblas.so,而是创建libblas.so.x,则手动创建一个符号链接,如下所示:

cd /usr/lib64
sudo ln -s libblas.so.3gf libblas.so
用户回答回答于

下载了python库的Anaconda发行版之后,我在Ubuntu12.04LTS 64位上遇到了同样的问题。将Theano指向包含libblas.so的目录。

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

扫码关注云+社区