gpt4 book ai didi

linux - ld.so.conf 不会被 ldconfig 加载

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:13:53 33 4
gpt4 key购买 nike

所以我编辑了我的 /etc/ld.so.conf 文件,现在它看起来像这样:

include /opt/intel/mkl/lib/intel64_lin
include /etc/ld.so.conf.d/*.conf
include /usr/local/lib

我试过运行 sudo ldconfig -v,但在输出中它似乎甚至没有尝试加载 MKL 库目录。当我尝试使用 MKL 运行​​程序时,它失败了。但是,如果我在 /usr/local/lib 中添加指向正确库的符号链接(symbolic link),它是从 /etc/ld.so.conf.d/libc.conf 添加的> 它有效。显然这是一个简单的解决方案,但我想了解为什么我的 ldconfig 失败了?

最佳答案

您必须添加库或目录本身:

/full/Path/to/library.so/or/directory/etc/ld.so.conf 文件

您必须删除配置文件中目录前的 include 词。

来自 man ldconfig:

The ldconfig utility is used to prepare a set of ``hints'' for use by the dynamic linker to facilitate quick lookup of shared libraries available in multiple directories.
<...>

Files named on the command line are expected to contain directories to scan for shared libraries. Each directory's pathname must start on a new line. Blank lines and lines starting with the comment character `#' are ignored. Filenames must conform to the lib*.so.[0-9] pattern in order to be added to the hints file.

关于linux - ld.so.conf 不会被 ldconfig 加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33347308/

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