我们有一个库,由 Cython (core.so) 作为模块链接。它使用 BLAS,但它使用 -undefined,dynamic-lookup 选项编译,希望 BLAS 将在运行时加载。
在 Enthought Python Distribution 中,以下解决方案完美运行:
import numpy #This apparently loads the shared BLAS library
import core
我们在 Ubuntu 10.04 中的“vanilla”python 发行版上尝试了它,并通过 apt-get 安装了 numpy(以及 liblapack-dev、libblas-dev 以相同的方式安装)。它没有找到 BLAS 库。我们如何才能让它以与环保署相同的方式运作?
更新:
这样做是为了获得与 numpy 中相同的 BLAS。例如,在 Mac Os X 机器上,EPD 再次编译 MKL,并且比可用的 BLAS(加速框架)快得多。
的输出numpy.show_config()
是:
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