cannot open shared library during execution
I compiled my program as follows:
mpicc b_eff_io.c -o b_eff_io2 -I/scratch/irodero/papi/include -L/scratch/irodero/papi/src -lpapi -lm
41125309 4 drwxr-xr-x 3 irodero users 4096 May 3 23:14 .
39649287 4 drwxr-xr-x 12 irodero users 4096 May 3 00:27 ..
41126356 4 drwxr-xr-x 2 irodero users 4096 May 3 23:10 kk
41125409 2632 -rw-r--r-- 1 irodero users 2688796 May 3 00:27 libpapi.a
41126357 764 -rwxr-xr-x 1 irodero users 774486 May 3 23:14 libpapi.so
41126358 764 -rwxr-xr-x 1 irodero users 774486 May 3 23:14 libpapi.so.4
41126359 764 -rwxr-xr-x 1 irodero users 774486 May 3 23:14 libpapi.so.4.0.0
41125398 84 -rw-r--r-- 1 irodero users 79032 May 3 00开发者_JAVA技巧:27 libperfctr.a
41126360 76 -rwxr-xr-x 1 irodero users 72623 May 3 23:14 libperfctr.so
41126361 76 -rwxr-xr-x 1 irodero users 72623 May 3 23:14 libperfctr.so.6
41126362 76 -rwxr-xr-x 1 irodero users 72623 May 3 23:14 libperfctr.so.6.2.6.40
41125312 1216 -rw-r--r-- 1 irodero users 1238236 May 3 00:27 libpfm.a
41126363 1028 -rwxr-xr-x 1 irodero users 1046742 May 3 23:14 libpfm.so
41126364 1028 -rwxr-xr-x 1 irodero users 1046742 May 3 23:14 libpfm.so.3
41126365 1028 -rwxr-xr-x 1 irodero users 1046742 May 3 23:14 libpfm.so.3.9.0
However I got this error:
error while loading shared libraries: libpapi.so: cannot open shared object file: No such file or directory
What should I do?
Maybe...
- the library is in use
- the permissions are incorrect
- it does not exist
- it's not in the library search path
I had a similar problem.
$ ./a.out
./a.out: error while loading shared libraries: libpapi.so: cannot open shared object file: No such file or directory
$locate libpapi.so
/usr/local/lib64/libpapi.so
/usr/local/lib64/libpapi.so.4
/usr/local/lib64/libpapi.so.4.1.4.0
Creating a symbolic link to /usr/lib fixed the issue
ln -s /usr/local/lib64/libpapi.so /usr/lib/libpapi.so
精彩评论