gmarcais / Jellyfish

A fast multi-threaded k-mer counter
Other
471 stars 136 forks source link

Error while loading shared libraries #49

Closed oXis closed 8 years ago

oXis commented 8 years ago

Hi,

I found why we have this error

jellyfish: error while loading shared libraries: libjellyfish-2.0.so.2: cannot open shared object file: No such file or directory

After compiling Jellyfish when you type "(sudo) make install", it's the dynamic linked binary that is installed.

oxis@soyah:[~/etc/src/Jellyfish]$ ldd ./bin/.libs/jellyfish
    linux-vdso.so.1 =>  (0x00007ffeb51c1000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1186a77000)
    libjellyfish-2.0.so.2 => not found
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1186773000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f118646d000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1186257000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1185e92000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f1186c95000)

oxis@soyah:[~/etc/src/Jellyfish]$ ldd ./bin/jellyfish
        not a dynamic executable
oxis@soyah:[~/etc/src/Jellyfish]$ md5sum ./bin/.libs/jellyfish
    8c89ef850aba61e4e0f7dd63c7098244  ./bin/.libs/jellyfish

oxis@soyah:[~/etc/src/Jellyfish]$ md5sum /usr/local/bin/jellyfish 
    8c89ef850aba61e4e0f7dd63c7098244  /usr/local/bin/jellyfish

Note the "libjellyfish-2.0.so.2 => not found". Sure we can put export LD_LIBRARY_PATH="/usr/local/lib in our .bashrc instead, or fix the "not found".

I tried to find where you say which binary you want to install with no success. I'm not used to automake (more a cmake guy :smile:)

Cheers!

Ben

gmarcais commented 8 years ago

Hi Ben,

after doing 'sudo make install', please run 'sudo ldconfig', and your problem should be solved.

On how automake works with shared libraries: if the installation is to a non-system location (system locations are the directories in /etc/ld.so.conf and /etc/ld.so.conf.d), then it sets the RPATH field in the ELF header to find the shared libraries. If the installation is to a system location, then no RPATH is set as the library will be found by default. With the caveat that on some systems, like Linux, the system libraries are cached, and after installation one needs to update the cache with 'ldconfig'.

Everything you show about about the build of Jellyfish is normal. That is the way Libtool works.

Maybe I should run 'ldconfig' as a post installation hook?

oXis commented 8 years ago

Thank you for the explanation. And yes, "ldconfig" solved the issue (maybe the cache is updated when the system starts). I might be a good idea to run "ldconfig" as a post-install hook, the install process will be more straightforward with no extra command to run after the "make install" call.

Thanks again.

Ben