如何在 NumPy 和 SciPy 中检查 BLAS/LAPACK 链接?
我正在基于 blas 和 lapack 构建我的 numpy/scipy 环境,或多或少基于 this 步行穿过。
完成后,如何检查我的 numpy/scipy 函数是否确实使用了之前构建的 blas/lapack 功能?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
方法
numpy.show_config()
(或numpy.__config__.show()
)输出有关在构建时收集的链接的信息。我的输出看起来像这样。我认为这意味着我正在使用 Mac OS 附带的 BLAS/LAPACK。The method
numpy.show_config()
(ornumpy.__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.您正在寻找的是这样的:
系统信息
我用atlas编译了numpy/scipy,并且我可以通过以下方式检查:
检查文档以获取更多命令。
What you are searching for is this:
system info
I compiled numpy/scipy with atlas and i can check this with:
Check the documentation for more commands.
您可以使用链接加载器依赖项工具查看构建的 C 级挂钩组件,并查看它们是否对您选择的 blas 和 lapack 具有外部依赖项。我现在不在 Linux 机器附近,但在 OS X 机器上,您可以在保存安装的 site-packages 目录中执行此操作:
用
ldd
代替otool
> 在 gnu/Linux 系统上,您应该得到您需要的答案。You can use the link loader dependency tool to look at the C level hook components of your build and see whether they have external dependencies on your blas and lapack of choice. I am not near a linux box right now, but on an OS X machine you can do this inside the site-packages directory which holds the installations:
substitute
ldd
in place ofotool
on a gnu/Linux system and you should get the answers you need.您可以使用 show_config() 显示 BLAS、LAPACK、MKL 链接:
对我来说,它给出输出:
You can display BLAS, LAPACK, MKL linkage using
show_config()
:Which for me gives output:
如果您安装了 anaconda-navigator(对于 Linux、Windows 或 macOS,请访问 www.anaconda.com/anaconda/install/) - blas、scipy 和 numpy 将全部安装,您可以通过单击导航器主页左侧的环境选项卡来查看它们页面(按字母顺序查找每个目录)。安装完整的 anaconda(而不是 miniconda 或单独的软件包)将负责安装数据科学所需的许多基本软件包。
If you installed anaconda-navigator (at www.anaconda.com/anaconda/install/ for linux, Windows or macOS) - blas, scipy and numpy will all be installed and you can see them by clicking environments tab on left side of navigator home page (look for each directory in alpha order). Installing full anaconda (as opposed to miniconda or individual packages) will take care of installing many of the essential packages needed for data science.