ld.so.conf 未由 ldconfig 加载

ld.so.conf does not get loaded by ldconfig

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

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

我试过 运行ning sudo ldconfig -v,但在输出中它似乎甚至没有尝试加载 MKL 库目录。当我尝试 运行 使用 MKL 的程序时,它失败了。但是,如果我将符号 link 添加到从 /etc/ld.so.conf.d/libc.conf 添加的 /usr/local/lib 中的正确库中,它就可以工作。显然这是一个简单的解决方案,但我想了解为什么我的 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.