Cython:低级BLAS和LAPACK功能

时间:2016-06-16 10:19:35

标签: python cython lapack blas

我试图通过Cython中的内置包装器使用低级BLAS和LAPACK函数来实现某些算法。我遵循[1]中给出的指导原则,更具体地说,作为起点,我试图使用作者在他的github [2]中提供的示例生成所需的pyd文件。但是,在运行setup.py文件时,我收到许多编译错误,因为它无法识别任何标识符,例如:

  

cylinalg \ scipy_blas.pyx:91:22:'ztrmv_t'不是类型标识符

所以似乎编译器找不到BLAS / LAPACK库,但是当检查scipy的配置时,一切看起来都很好:

sp.__config__.show()
blas_opt_info:
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
mkl_info:
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
lapack_opt_info:
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd', 'mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
blas_mkl_info:
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
lapack_mkl_info:
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd', 'mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
openblas_info:
  NOT AVAILABLE

您对如何解决此问题有任何想法吗?

提前致谢。

一些系统细节:

  • Python 3.4.3(Anaconda 2.3.0,64位)
  • 操作系统:Windows 7(64位)
  • 编译器:Microsoft Visual Studio 10

参考文献:

[1] http://conference.scipy.org/proceedings/scipy2015/pdfs/ian_henriksen.pdf

[2] https://github.com/insertinterestingnamehere/cylinalg

更新

好的,似乎快速解决这个问题的方法是手工声明编译器无法识别的结构(确实与相应函数的参数相对应)。

0 个答案:

没有答案