setup.py 的库路径?

发布于 2024-11-07 06:12:55 字数 510 浏览 6 评论 0原文

当尝试在 Linux 平台上构建 numpy 时,我无法使配置脚本看起来在正确的位置。 我使用

python setup.py config --library-dirs=/software/intel/mkl/10.2.2.025/lib/em64t/

但后来我得到

mkl_info:
在 /software/intel/mkl/10.2.2.025 中找不到库 mkl、vml、指南
在 /software/intel/mkl/10.2.2.025/include 中找不到库 mkl、vml、指南
在 /software/intel/mkl/10.2.2.025/lib 中找不到库 mkl、vml、指南

所以看起来它从未真正查看过子目录 emt64/。我给出的路径也存在于我的 LD_LIBRARY_PATH 中。

我怎样才能给脚本正确的路径?

提前致谢!

When trying to build numpy on a linux platform, I can't make the configure script look in the right place.
I use

python setup.py config --library-dirs=/software/intel/mkl/10.2.2.025/lib/em64t/

but then I get

mkl_info:
libraries mkl,vml,guide not found in /software/intel/mkl/10.2.2.025
libraries mkl,vml,guide not found in /software/intel/mkl/10.2.2.025/include
libraries mkl,vml,guide not found in /software/intel/mkl/10.2.2.025/lib

So it looks like it never actually looks into the subdirectory emt64/. The path I'm giving is also present in my LD_LIBRARY_PATH.

How can I give the script the right path?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

静水深流 2024-11-14 06:12:55

rpy2 也有类似的问题。没有 root 权限,无法更改现有 R 安装或添加到其核心库目录。 R 不是作为共享对象库构建的,因此我无法将 rpy2 构建链接到 libR.so。

我必须在单独的机器(相同的 R 版本,相同的 Linux 系列)上交叉编译 libR.so 并将其复制到不同的目录。我希望 setup.py 可以看到该目录。

无法让 -L 在命令行上工作。看来这个论点已经失效了。

(失败) python setup.py -L${LD_LIBRARY_PATH} build install

我最终所做的是编辑 setup.py 并更改接受库目录条目的行。

(old) r_libs = []

(new) [os.path.join('/root','path','to_my','install','R','lib'),]

将其重新运行为: python setup .py 构建安装

成功!

Had a similar problem with rpy2. Did not have root permissions and could not alter the existing R installation or add to its core library directory. R was not built as a shared object library, so I could not link the rpy2 build to a libR.so.

I had to cross compile libR.so on a separate machine (same R version, same Linux family) and copy it to a different directory. I wanted that directory to be seen by setup.py.

Couldn't get -L to work on the command line. It appeared that this argument was deactivated.

(FAIL) python setup.py -L${LD_LIBRARY_PATH} build install

What I ended up doing was editing setup.py and changing a line that accepts library directory entries.

(old) r_libs = []

(new) [os.path.join('/root','path','to_my','install','R','lib'),]

Reran it as: python setup.py build install

Success!

剩一世无双 2024-11-14 06:12:55

也许

export PYTHONLIB="/software/intel/mkl/10.2.2.025/lib/em64t/"
python setup.py config

Perhaps

export PYTHONLIB="/software/intel/mkl/10.2.2.025/lib/em64t/"
python setup.py config
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文