gpt4 book ai didi

numpy - 确定哪个编译器构建了我的 LAPACK

转载 作者:行者123 更新时间:2023-12-01 09:34:45 24 4
gpt4 key购买 nike

我想安装最新版本的numpy(Python的数值库),版本(v1.6.1)还没有在Ubuntu Oneiric repositories .当我继续手动安装它时,我阅读了 INSTALL numpy 需要使用与构建 LAPACK 相同的编译器(numpy 使用的 fortran 库)构建的文件。不幸的是,我不知道那是哪个编译器。我自己没有安装 LAPACK - apt-get 是在我使用 安装较旧的 numpy (v1.5.1) 时安装的适合。如果让我猜的话,我会说 gfortran,但我宁愿不要把它搞砸。

如何确定是哪个编译器构建了我当前安装的 LAPACK?有什么简单的方法——也许运行一些使用它的 fortran 代码并检查输出?

谢谢!

最佳答案

从您引用的同一 INSTALL 文件...

How to check the ABI of blas/lapack/atlas
-----------------------------------------

One relatively simple and reliable way to check for the compiler used to build
a library is to use ldd on the library. If libg2c.so is a dependency, this
means that g77 has been used. If libgfortran.so is a a dependency, gfortran has
been used. If both are dependencies, this means both have been used, which is
almost always a very bad idea.

如果我不得不猜测,我可能也会猜测 gfortran,因为我所知道的仅有的两个免费 fortran 编译器是 g77 和 gfortran,据我所知,g77 的开发几乎已经死了......另一件要检查的事情是g77(默认)在符号上附加两个下划线,而 gfortran(默认)只附加一个。这可能是 numpy 知道的最重要的事情......尽管可能存在其他细微差别(例如,如果 numpy 正在做一些肮脏的黑客行为以获取存储在公共(public) block 中的信息)。

关于numpy - 确定哪个编译器构建了我的 LAPACK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10308639/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com