Error while loading shared libraries: libimsl.so: cannot open shared object file

此问题纠结近30个小时后终于得到解决,期间用过很多方法,一一列举如下:

 

1:搜索资源得到这个http://ait.web.psi.ch/services/linux/hpc/hpc_user_cookbook/libraries/imsl/

 

Problem:

./lin_sol_svd_ex2
./lin_sol_svd_ex2: error while loading shared libraries: libimsl.so: cannot open shared object file: 
                     No such file or directory
ldd lin_sol_svd_ex2
     libimsl.so => not found
     libimslsuperlu.so => not found
     libimslscalar.so => not found
     libimslblas.so => not found
     libm.so.6 => /lib/tls/libm.so.6 (0x007df000)
     libguide.so => /opt/intel/intel-10.0/fc-10.0/lib/libguide.so (0x00111000)
     libpthread.so.0 => /lib/tls/libpthread.so.0 (0x0090d000)
     libc.so.6 => /lib/tls/libc.so.6 (0x006b2000)
     libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0055a000)
     libdl.so.2 => /lib/libdl.so.2 (0x00804000)
     /lib/ld-linux.so.2 (0x00699000)

Solution: set LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$IMSL_LIB_DIR:$LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
/opt/imsl/imsl-6.0-intel/imsl/fnl600/lnxin100i32/lib:/opt/intel/intel-10.0/fc-10.0/lib:/opt/intel/intel-10.0/cc-10.0/lib
ldd lin_sol_svd_ex2
     libimsl.so => /opt/imsl/imsl-6.0-intel/imsl/fnl600/lnxin100i32/lib/libimsl.so (0x006b0000)
     libimslsuperlu.so => /opt/imsl/imsl-6.0-intel/imsl/fnl600/lnxin100i32/lib/libimslsuperlu.so (0x00111000)
     libimslscalar.so => /opt/imsl/imsl-6.0-intel/imsl/fnl600/lnxin100i32/lib/libimslscalar.so (0x0016b000)
     libimslblas.so => /opt/imsl/imsl-6.0-intel/imsl/fnl600/lnxin100i32/lib/libimslblas.so (0x002c2000)
     libm.so.6 => /lib/tls/libm.so.6 (0x00316000)
     libguide.so => /opt/intel/intel-10.0/fc-10.0/lib/libguide.so (0x00339000)
     libpthread.so.0 => /lib/tls/libpthread.so.0 (0x0038c000)
     libc.so.6 => /lib/tls/libc.so.6 (0x0039e000)
     libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0055a000)
     libdl.so.2 => /lib/libdl.so.2 (0x004c9000)
     libifport.so.5 => /opt/intel/intel-10.0/fc-10.0/lib/libifport.so.5 (0x004cd000)
     libifcore.so.5 => /opt/intel/intel-10.0/fc-10.0/lib/libifcore.so.5 (0x00564000)
     libimf.so => /opt/intel/intel-10.0/fc-10.0/lib/libimf.so (0x041b8000)
     libintlc.so.5 => /opt/intel/intel-10.0/fc-10.0/lib/libintlc.so.5 (0x004ed000)
     /lib/ld-linux.so.2 (0x00699000)
按照此方法没有有效的解决,不知道原因!
 
2:修改过 /etc/profile 以及home目录下的.bash_profile, 添加了imsl库的路径,问题依然没有解决!
 3:随后问百度,告诉我几个答案

 A:如此文所述http://blog.csdn.net/qiek/archive/2005/11/27/537636.aspx
 
按照这个方法问题得到有效解决:
 
步骤如下,
因为我系统中有其所需库文件,因此,我只用root用户 (似乎必须用root用户,因为在执行ldconfig时只能是root) 修改了/etc/ld.so.conf,添加了我的库路径/opt/imsl/imsl/install/imsl/fnl600/rdhin111e64/lib/, 添加过程中出现一个小小的错误,lib后面的“/”忘记写了,导致失效。 
 添加好以上路径后如下: 
include ld.so.conf.d/*.conf /opt/imsl/imsl/install/imsl/fnl600/rdhin111e64/lib/

 

然后用root用户执行 ldconfig,再 $ldd a.out


发现可以检索到相关库!


问题解决!

 
 

你可能感兴趣的:(Error while loading shared libraries: libimsl.so: cannot open shared object file)