I met the share library not found on the head node of a cluster with torch. I have built the library as well as specify the correct path of the library while compiling my own program "absurdity" by g++. So it looks strange to me. Any idea? Thanks and regards!
[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
Fix ing 'cannot open shared object file: No such file or directory' error. One quick way to fix this “error while loading shared libraries” automatically is to use ldconfig. This one liner should solve the problem in most cases.
How to Open a SO File. SO files can technically be opened with GNU Compiler Collection but these types of files aren't intended to be viewed or used like you might another type of file. Instead, they're just placed in an appropriate folder and used automatically by other programs via Linux's dynamic link loader.
You need to run the ldconfig command to effect the changes. After creating your shared library, you need to install it. You can either move it into any of the standard directories mentioned above and run the ldconfig command.
The Linux ldconfig command creates, updates, and removes available symbolic links for currently shared libraries. The symbolic links are based on lib directories in /etc/ld. so. conf. Linux commands rely on shared libraries.
Copied from my answer here: https://stackoverflow.com/a/9368199/485088
Run
ldconfig
as root to update the cache - if that still doesn't help, you need to add the path to the fileld.so.conf
(just type it in on its own line) or better yet, add the entry to a new file (easier to delete) in directoryld.so.conf.d
.
Your LD_LIBRARY_PATH
doesn't include the path to libsvmlight.so
.
$ export LD_LIBRARY_PATH=/home/tim/program_files/ICMCluster/svm_light/release/lib:$LD_LIBRARY_PATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With