Error loading shared library: libGarf3d.so

Hello root user,

I have a program . It is compiled without any problem. while running i get the following error.

error while loading shared libraries: libGraf3d.so: cannot open shared object file: No such file or directory

file libGraf3d.so is related to root. It is there in my system. I read on some other website that this problem can arise if you have installed a program many times and there are many versions of such files on system. Then operating system can not decide which file to link to during runtime.

i have many versions of this file.


./usr/local/lib/root/libGraf3d.so
./usr/lib/x86_64-linux-gnu/root5.34/libGraf3d.so
./usr/lib/x86_64-linux-gnu/root5.34/libGraf3d.so.5.34
./usr/lib/x86_64-linux-gnu/root5.34/libGraf3d.so.5
./usr/lib/x86_64-linux-gnu/libGraf3d.so.5.34

How can i remove these different versions without damaging my system ?
or

There is something else causing the problem ?

Any one Help Please .

Does your LD_LIBRARY_PATH environment variable point to the place where this library sits ?

Hi couet,

Thanks for the reply. :slight_smile:

LD_LIBRARY_PATH did not include the path of file. Now I have included this in my bashrc. It works.

:slight_smile: :smiley:

Can you please tell a method to remove other versions of this file ? Actually i have mistakenly installed two versions of root ( 5.34 and 6.04 ). I would like to remove one of it . do you know a clean method ?

Varun

Simply remove (rm) those you do not need.

Hey,
could you please provide info how you did that?
I’m facing the ssam eproblem now but although I set the path to the file, it doesn’t work. Maybe I did something wrong. Thank you so much

This is what I included in the .bashrc:
LD_LIBRARY_PATH=/home/me/packages/usr/lib/root/libGraf3d.so
export LD_LIBRARY_PATH

Note: I’m trying to use Garfield++ on a linux remote server.

Try:

LD_LIBRARY_PATH=/home/me/packages/usr/lib/root/
export LD_LIBRARY_PATH

Thanks for your reply! :slight_smile:
It still does not work…

I sourced the bashrc, recompiled… Something else I could have missed?
Thanks again

May be explain with more details what you are doing.

Okay, here we go. I really appreciate your help.

I’m on a ubuntu remote machine, no sudo privileges.
I downloaded, compiled and installed Garfield++ garfieldpp.web.cern.ch/garfieldpp/ according to the instructions.

I cloned a working code from my local machine and compiled it succesfully (pp.cc → pp).
When I do ./pp, I get the error:
./pp: error while loading shared libraries: libGraf3d.so: cannot open shared object file: No such file or directory

The same errors occurs for every Garfield++ simulation I want to run.

find . -iname libGraf3d* gives: (./ is /home/me)
./packages/usr/lib/root/libGraf3d.rootmap
./packages/usr/lib/root/libGraf3d.so
./packages/usr/lib/root/libGraf3d_rdict.pcm

in the root directory, the libGraf3d.so appears in red.
“ls -l” gives:
-rw-r–r-- 1 victor victor 14341 Jan 29 01:46 libGraf3d_rdict.pcm
-rw-r–r-- 1 victor victor 1128 Jan 29 01:46 libGraf3d.rootmap
lrwxrwxrwx 1 victor victor 17 May 12 08:11 libGraf3d.so → libGraf3d.so.6.26’

I removed other libGraf3d.so.X.XX following the previous comments here.

I don’t know… do you have an idea what I did wrong?

It looks like an issue with Garfield. Lets ask @hschindl for help.

1 Like

Hi,
did you source the thisroot.sh and setupGarfield.sh scripts before running CMake and make for your application?

Thank you for your reply!

yes, I sourced both of it.

Can you provide more details and/or instructions such that I can try to reproduce this issue?

Well, I now have libGraf3d.so at ./packages/root/lib/libGraf3d.so. So it is existent.

I’m now working with a fresh garfieldpp clone. For example, when trying to run the Gem example, I simply
source /home/me/packages/root/bin/thisroot.sh
source $GARFIELD_HOME/install/share/Garfield/setupGarfield.sh
LD_LIBRARY_PATH=/home/me/packages/root/
export LD_LIBRARY_PATH
cmake …
make
./gem

Output:
./gem: error while loading shared libraries: libGraf3d.so: cannot open shared object file: No such file or directory

Together with the additional information given above, I don’t know what else to tell you…

Can you try without these two lines?

LD_LIBRARY_PATH=/home/me/packages/root/
export LD_LIBRARY_PATH

Setting up the relevant environment variables should be taken care of by the thisroot.sh and setupGarfield.sh scripts