如何在 NumPy 和 SciPy 中检查 BLAS/LAPACK 链接? [英] How to check BLAS/LAPACK linkage in NumPy and SciPy?

查看:40
本文介绍了如何在 NumPy 和 SciPy 中检查 BLAS/LAPACK 链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在基于 blas 和 lapack 或多或少地基于 this 构建我的 numpy/scipy 环境 走过.

完成后,如何检查我的 numpy/scipy 函数是否确实使用了之前构建的 blas/lapack 功能?

解决方案

方法numpy.show_config()(或numpy.__config__.show())输出信息关于在构建时收集的链接.我的输出看起来像这样.我认为这意味着我正在使用 Mac OS 附带的 BLAS/LAPACK.

<预><代码>>>>将 numpy 导入为 np>>>np.show_config()lapack_opt_info:extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']extra_compile_args = ['-msse3']define_macros = [('NO_ATLAS_INFO', 3)]blas_opt_info:extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']define_macros = [('NO_ATLAS_INFO', 3)]

I am builing my numpy/scipy environment based on blas and lapack more or less based on this walk through.

When I am done, how can I check, that my numpy/scipy functions really do use the previously built blas/lapack functionalities?

解决方案

The method numpy.show_config() (or numpy.__config__.show()) outputs information about linkage gathered at build time. My output looks like this. I think it means I am using the BLAS/LAPACK that ships with Mac OS.

>>> import numpy as np
>>> np.show_config()

lapack_opt_info:
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    extra_compile_args = ['-msse3']
    define_macros = [('NO_ATLAS_INFO', 3)]
blas_opt_info:
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
    define_macros = [('NO_ATLAS_INFO', 3)]

这篇关于如何在 NumPy 和 SciPy 中检查 BLAS/LAPACK 链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆