无法打开共享对象文件:没有这样的文件或目录

我遇到了一个集群的头部节点上没有find的共享库与火炬。 我build立了图书馆,并指定了图书馆的正确path,同时编译我自己的程序“荒谬”由g ++。 所以我觉得很奇怪 任何想法? 感谢致敬!

[tim@user1 release]$ make ... ... g++ -pipe -W -Wall -fopenmp -ggdb3 -O2 -I/home/tim/program_files/ICMCluster/ann_1.1.1/include -I/home/tim/program_files/ICMCluster/libsvm-2.89 -I/home/tim/program_files/ICMCluster/svm_light -o absurdity xxxxxx.o -L/home/tim/program_files/ICMCluster/ann_1.1.1/release/lib -L/home/tim/program_files/ICMCluster/libsvm-2.89/release/lib -L/home/tim/program_files/ICMCluster/svm_light/release/lib -lm -ljpeg -lpng -lz -lANN -lpthread -lsvm -lsvmlight [tim@user1 release]$ ./absurdity ./absurdity: error while loading shared libraries: libsvmlight.so: cannot open shared object file: No such file or directory [tim@user1 release]$ ls /home/tim/program_files/ICMCluster/svm_light/release/lib/libsvmlight.so -l -rwxr-xr-x 1 tim Brown 121407 Jan 31 12:14 /home/tim/program_files/ICMCluster/svm_light/release/lib/libsvmlight.so [tim@user1 release]$ LD_LIBRARY_PATH= /home/tim/program_files/ICMCluster/svm_light/release/lib:$LD_LIBRARY_PAT [tim@user1 release]$ export LD_LIBRARY_PATH [tim@user1 release]$ ./absurdity ./absurdity: error while loading shared libraries: libsvmlight.so: cannot open shared object file: No such file or directory [tim@user1 release]$ ls /home/tim/program_files/ICMCluster/svm_light/release/lib libsvmlight.a libsvmlight.so 

您的LD_LIBRARY_PATH不包含libsvmlight.so的path。

 $ export LD_LIBRARY_PATH=/home/tim/program_files/ICMCluster/svm_light/release/lib:$LD_LIBRARY_PATH 

从我的答案复制在这里: https : //stackoverflow.com/a/9368199/485088

以root身份运行ldconfig来更新caching – 如果仍然没有帮助,则需要将path添加到文件ld.so.conf (只需在自己的行中input)或者更好,将条目添加到在ld.so.conf.d目录下的新文件(更容易删除)。

 sudo ldconfig 

ldconfig创build必要的链接并caching到在命令行上指定的目录中find的最新共享库,位于文件/etc/ld.so.conf和受信任的目录(/ lib和/ usr / lib)中。

一般来说,包pipe理器在安装新库时会照顾到这一点,但并不总是(特别是当你用cmake安装库时)。

如果这个输出是空的

 $ echo $LD_LIBRARY_PATH 

请设置默认path

 $ LD_LIBRARY_PATH=/usr/local/lib 

在超级计算机上工作时,我跑步时收到这个错误:

 module load python/3.4.0 screen python 

为了解决这个错误,我只需要在屏幕terminal上重新加载模块:

 module load python/3.4.0 python