Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn: error while loading shared libraries: libserf-1.so.1: cannot open shared object file: No such file or directory

I compiled svn 1.8.5 with serf enabled.

./configure --prefix=/home/user/Downloads/svn --with-editor=/home/user/Downloads/vim74-install/bin/vim --with-openssl --with-serf=$HOME/Downloads/serf_install && make && make install

Then svn complained:

svn: error while loading shared libraries: libserf-1.so.1: cannot open shared object file: No such file or directory

The libserf-1.so.1 (and the file it points to) is indeed there

$ll $HOME/Downloads/serf_install/lib/libserf-1.so.1 lrwxrwxrwx 1 user group 18 Feb 22 12:50 /home/user/Downloads/serf_install/lib/libserf-1.so.1 -> libserf-1.so.1.3.0 $ll /home/user/Downloads/serf_install/lib/libserf-1.so.1.3.0 -rwxr-xr-x 1 user group 128441 Feb 22 12:50 /home/user/Downloads/serf_install/lib/libserf-1.so.1.3.0

Any idea is appreciated.

like image 460
slowD Avatar asked Feb 22 '15 21:02

slowD


2 Answers

The problem is that by default, the absolute path to any dynamically linked libraries in non-standard locations is not included in the final build. Assuming you are using Linux and gcc, you can either

  • fix the problem at compile time by passing additional flags to the linker to store the full path: prefix the configure command above with LDFLAGS="-Wl,-rpath,$HOME/Downloads/serf_install/lib"./configure..., or
  • fix the problem at runtime by executing export LD_LIBRARY_PATH="$HOME/Downloads/serf_install/lib:$LD_LIBRARY_PATH" before each use of svn or by adding it to your .bashrc file

The former solution is of course preferred, since it solves the problem at its root instead of providing band-aid.

like image 187
Michael Schlottke-Lakemper Avatar answered Sep 18 '22 23:09

Michael Schlottke-Lakemper


Issue got resolved by adding, LD_LIBRARY_PATH=${SVN_HOME}/lib:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH

in .profile file of the user.

like image 42
cheenubear Avatar answered Sep 21 '22 23:09

cheenubear