Message: error while loading shared libraries: *.so files Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None error while loading shared libraries: *.so files 

Keywords: error while loading shared libraries
Forum: Installation and Configuration
Date: 07 Apr, 2008
From: Wonho <wonhol@korea.ac.kr>

PLEASE, help me to finish install.

If I run exampleN01

The error message is shown below

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

If I run exampleN02

The error message is like below

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

The .bash_profile is like below

PATH=$PATH:$HOME/bin

export PATH

export G4WORKDIR=/home/wonhol/geant

export LD_LIBRARY_PATH=/home/wonhol/CLHEP/lib:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/home/wonhol/geant4.9.0.p02/lib:$LD_LIBRARY_PATH

source /home/wonhol/geant4.9.0.p02/env.sh

export ROOTSYS=/home/wonhol/root

export PATH=$ROOTSYS/bin:$PATH

export G4WORKDIR=/home/wonhol/geant

export G4INSTALL=/home/wonhol/geant4.9.0.p02

export G4VERSION=9.0

export G4LEDDATA=/home/wonhol/geant4.9.0.p02/data/G4EMLOW4.3

export LMF_HOME=/home/wonhol/lmf_v3.0

unset USERNAME

How can I solve this problem?

Inline Depth:
 0 0
 1 1
Add message: (add)

None Re: error while loading shared libraries: *.so files  Keywords: error while loading shared libraries
by Ben Morgan <Ben Morgan>,   07 Apr, 2008
Re: None error while loading shared libraries: *.so files (Wonho)

Hi Wonho,

I -suspect- the problem is with the LD_LIBRARY_PATH as it looks like you managed to build the executables o.k. Could you post the value of LD_LIBRARY_PATH in your session please? The sourcing of env.sh should set this correctly, although you also set it here:

export LD_LIBRARY_PATH=/home/wonhol/geant4.9.0.p02/lib:$LD_LIBRARY_PATH

Could you also check that the Geant4 libraries (libG4Run.so etc) are in one of the paths in LD_LIBRARY_PATH?

Cheers,

Ben.

None Re: error while loading shared libraries: *.so files  Keywords: error while loading shared libraries
by Wonho <wonhol@korea.ac.kr>,   07 Apr, 2008
Re: None Re: error while loading shared libraries: *.so files (Ben Morgan)

First of all, thank you for your reply.

I changed

export LD_LIBRARY_PATH=/home/wonhol/geant4.9.0.p02/lib:$LD_LIBRARY_PATH

to

export LD_LIBRARY_PATH=/home/wonhol/geant4.9.0.p02/lib/Linux-g++:$LD_LIBRARY_PATH

When I use the command "echo $LD_LIBRARY_PATH"

The output is

/home/wonhol/geant4.9.0.p02/lib/Linux-g++:/home/wonhol/CLHEP/lib:

The directory of libG4run is

/home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4run.so

Therefore, the shared library file should be loaded.

But "error while loading shared libraries" comes out.

What is the problem?

None Re: error while loading shared libraries: *.so files  Keywords: error while loading shared libraries
by Ben Morgan <Ben Morgan>,   08 Apr, 2008
Re: None Re: error while loading shared libraries: *.so files (Wonho)

If the LD_LIBRARY_PATH is set correctly then there shouldn't be a problem locating the library. Could you check, from the -same- terminal, the value of LD_LIBRARY_PATH and then for the binary built for example N01 do

ldd $G4WORKDIR/bin/Linux-g++/exampleN01

and post the output here. Could you also let us know what OS/Version you're running on please?

Cheers,

Ben.

None Re: error while loading shared libraries: *.so files  Keywords: error while loading shared libraries
by Wonho <wonhol@korea.ac.kr>,   08 Apr, 2008
Re: None Re: error while loading shared libraries: *.so files (Ben Morgan)

I do not know how to print out "echo $LD_LIBRARY_PATH". It gives me just a blank line.

When I run like "./.bash_profile", "/home/wonhol/geant4.9.0.p02/lib/Linux-g++:/home/wonhol/CLHEP/lib:" comes out

How can I check LD_LIBRARY_PATH in the geant work directory?

OS: Linux Fedona 5, geant 9.0 patch2

The ldd command make the message like below
        linux-gate.so.1 =>  (0x0020c000)
        libG4run.so => not found
        libG4event.so => not found
        libG4geombias.so => not found
        libG4tracking.so => not found
        libG4mesons.so => not found
        libG4transportation.so => not found
        libG4emutils.so => not found
        libG4ions.so => not found
        libG4baryons.so => not found
        libG4leptons.so => not found
        libG4bosons.so => not found
        libG4detector.so => not found
        libG4digits.so => not found
        libG4procman.so => not found
        libG4navigation.so => not found
        libG4cuts.so => not found
        libG4hits.so => not found
        libG4track.so => not found
        libG4csg.so => not found
        libG4magneticfield.so => not found
        libG4hepnumerics.so => not found
        libG4volumes.so => not found
        libG4geometrymng.so => not found
        libG4materials.so => not found
        libG4partman.so => not found
        libG4graphics_reps.so => not found
        libG4intercoms.so => not found
        libG4globman.so => not found
        libGLU.so.1 => /usr/lib/libGLU.so.1 (0x00996000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0x00d02000)
        libXmu.so.6 => /usr/lib/libXmu.so.6 (0x00111000)
        libXt.so.6 => /usr/lib/libXt.so.6 (0x0062b000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0x00a39000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x0020d000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0x00def000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0x0060f000)
        libCLHEP-1.9.3.2.so => not found
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x04e1f000)
        libm.so.6 => /lib/libm.so.6 (0x00816000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00128000)
        libc.so.6 => /lib/libc.so.6 (0x006e1000)
        libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x0466e000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00ae4000)
        libdl.so.2 => /lib/libdl.so.2 (0x0083d000)
        libdrm.so.2 => /usr/lib/libdrm.so.2 (0x048e9000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x008f4000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x008ec000)
        /lib/ld-linux.so.2 (0x006c4000)

None Re: error while loading shared libraries: *.so files  Keywords: error while loading shared libraries
by Ben Morgan <Ben Morgan>,   08 Apr, 2008
Re: None Re: error while loading shared libraries: *.so files (Wonho)

Thanks for the information! If 'echo $LD_LIBRARY_PATH' is giving a blank line then LD_LIBRARY_PATH isn't set - hence the errors with not finding the Geant4 libs, and also the output from ldd (the libraries linked to are not found).

Since it looks like your Geant4 install generated the env.sh file, I'd recommend only having the lines

source /home/wonhol/geant4.9.0.p02/env.sh

export G4WORKDIR=/home/wonhol/geant

in your .bash_profile for setting up Geant4 as the env.sh will set all the important environment variables for you (including LD_LIBRARY_PATH).

To check that this works, do

source ~/.bash_profile

and then try running exampleN01 again.

Cheers,

Ben.

None Re: error while loading shared libraries: *.so files  Keywords: error while loading shared libraries
by Wonho <wonhol@korea.ac.kr>,   08 Apr, 2008
Re: None Re: error while loading shared libraries: *.so files (Ben Morgan)

Thank you for giving me answers.

I put # mark for all Geant lines except

source /home/wonhol/geant4.9.0.p02/env.sh

and

export G4WORKDIR=/home/wonhol/geant

I result is

"./exampleN01: error while loading shared libraries: libG4run.so: cannot open shared object file: No such file or directory"

"echo $LD_LIBRARY_PATH" in root directory gives "/home/wonhol/CLHEP/lib:/home/wonhol/geant4.9.0.p02/lib/Linux-g++ "

However,

"echo $LD_LIBRARY_PATH" in the directory "/home/wonhol/geant/bin/Linux-g++" gives a blank line

What is wrong here?

After I put  "export LD_LIBRARY_PATH=/home/wonhol/CLHEP/lib:/home/wonhol/geant4.9.0.p02/lib/Linux-g++
 " in the directory "/home/wonhol/geant/bin/Linux-g++",

"echo $LD_LIBRARY_PATH" gives "/home/wonhol/CLHEP/lib:/home/wonhol/geant4.9.0.p02/lib/Linux-g++"

After that, .

Running the program [root@localhost Linux-g++]# ./exampleN01 ./exampleN01: error while loading shared libraries: /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4globman.so: cannot restore segment prot after reloc: Permission denied

Running the ldd
[root@localhost Linux-g++]# ldd ./exampleN01
        linux-gate.so.1 =>  (0x00a4f000)
        libG4run.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4run.so (0x00351000)
        libG4event.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4event.so (0x0050b000)
        libG4geombias.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4geombias.so (0x004df000)
        libG4tracking.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4tracking.so (0x00209000)
        libG4mesons.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4mesons.so (0x00809000)
        libG4transportation.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4transportation.so (0x00111000)
        libG4emutils.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4emutils.so (0x00f0b000)
        libG4ions.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4ions.so (0x00cd3000)
        libG4baryons.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4baryons.so (0x00bd5000)
        libG4leptons.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4leptons.so (0x001b5000)
        libG4bosons.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4bosons.so (0x00124000)
        libG4detector.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4detector.so (0x00b33000)
        libG4digits.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4digits.so (0x00129000)
        libG4procman.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4procman.so (0x00d8f000)
        libG4navigation.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4navigation.so (0x0012e000)
        libG4cuts.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4cuts.so (0x00d19000)
        libG4hits.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4hits.so (0x00186000)
        libG4track.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4track.so (0x00767000)
        libG4csg.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4csg.so (0x001c0000)
        libG4magneticfield.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4magneticfield.so (0x0018b000)
        libG4hepnumerics.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4hepnumerics.so (0x0043d000)
        libG4volumes.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4volumes.so (0x00fa1000)
        libG4geometrymng.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4geometrymng.so (0x00243000)
        libG4materials.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4materials.so (0x00394000)
        libG4partman.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4partman.so (0x00274000)
        libG4graphics_reps.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4graphics_reps.so (0x002f2000)
        libG4intercoms.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4intercoms.so (0x0044c000)
        libG4globman.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4globman.so (0x005eb000)
        libGLU.so.1 => /usr/lib/libGLU.so.1 (0x00614000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0x00899000)
        libXmu.so.6 => /usr/lib/libXmu.so.6 (0x00414000)
        libXt.so.6 => /usr/lib/libXt.so.6 (0x00577000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0x00a39000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x008f9000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0x00def000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0x00498000)
        libCLHEP-1.9.3.2.so => /home/wonhol/CLHEP/lib/libCLHEP-1.9.3.2.so (0x00fc2000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x04e1f000)
        libm.so.6 => /lib/libm.so.6 (0x004b2000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00d59000)
        libc.so.6 => /lib/libc.so.6 (0x02057000)
        libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x0466e000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00ae4000)
        libdl.so.2 => /lib/libdl.so.2 (0x0083d000)
        libdrm.so.2 => /usr/lib/libdrm.so.2 (0x048e9000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x008f4000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x001a9000)
        /lib/ld-linux.so.2 (0x006c4000)

None Re: error while loading shared libraries: *.so files  Keywords: error while loading shared libraries
by Ben Morgan <Ben Morgan>,   08 Apr, 2008
Re: None Re: error while loading shared libraries: *.so files (Wonho)

O.k., I'm getting a little confused here, so just want to check a few things

First, which .bash_profile are you editing, the one for root or the one for user wonhol (I noted in your reply you are running as root, which is -not- recommended)? If you're not doing so already, you should only be editing /home/wonhol/.bash_profile

Second, are you running in one terminal only or several? .bash_profile is only read when an interactive login shell is started, so changes to the environment won't be propagated to other terminals you open in a graphical session.

Try the following:

Open ONE terminal (not as root, and carry out the following in the SAME terminal).

Make sure /home/wonhol/.bash_profile contains the two lines to source the env.sh file and export G4WORKDIR we discussed before

Do 'source ~/.bash_profile' in the terminal.

Do 'echo $LD_LIBRARY_PATH' - it should not output a blank line.

Now try running exampleN01 again and check the output from ldd.

Cheers,

Ben.

None Re: error while loading shared libraries: *.so files  Keywords: error while loading shared libraries
by Wonho <wonhol@korea.ac.kr>,   10 Apr, 2008
Re: None Re: error while loading shared libraries: *.so files (Ben Morgan)

I logged in as 'wonhol' ID and added two lines as you recommend,

Then, execute exampleN01

The error message comes out like below

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

After adding

export LD_LIBRARY_PATH=/home/wonhol/CLHEP/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/home/wonhol/geant4.9.0.p02/lib/Linux-g++:$LD_LIBRARY_PATH

And execute like 'source .bash_profile' and execute exampleN01

The error message comes out like below

./exampleN01: error while loading shared libraries: /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4globman.so: cannot restore segment prot after reloc: Permission denied

'ldd exampleN01' gives

        linux-gate.so.1 =>  (0x008bc000)
        libG4run.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4run.so (0x00c86000)
        libG4event.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4event.so (0x00ae0000)
        libG4geombias.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4geombias.so (0x0024d000)
        libG4tracking.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4tracking.so (0x00b62000)
        libG4mesons.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4mesons.so (0x00522000)
        libG4transportation.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4transportation.so (0x00400000)
        libG4emutils.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4emutils.so (0x00111000)
        libG4ions.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4ions.so (0x00176000)
        libG4baryons.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4baryons.so (0x00888000)
        libG4leptons.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4leptons.so (0x00e5c000)
        libG4bosons.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4bosons.so (0x0017b000)
        libG4detector.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4detector.so (0x007f7000)
        libG4digits.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4digits.so (0x00180000)
        libG4procman.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4procman.so (0x00185000)
        libG4navigation.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4navigation.so (0x00de7000)
        libG4cuts.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4cuts.so (0x009aa000)
        libG4hits.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4hits.so (0x001ba000)
        libG4track.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4track.so (0x00491000)
        libG4csg.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4csg.so (0x004b7000)
        libG4magneticfield.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4magneticfield.so (0x00a3b000)
        libG4hepnumerics.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4hepnumerics.so (0x001bf000)
        libG4volumes.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4volumes.so (0x00bee000)
        libG4geometrymng.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4geometrymng.so (0x00640000)
        libG4materials.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4materials.so (0x0025d000)
        libG4partman.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4partman.so (0x001ce000)
        libG4graphics_reps.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4graphics_reps.so (0x00c2e000)
        libG4intercoms.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4intercoms.so (0x00703000)
        libG4globman.so => /home/wonhol/geant4.9.0.p02/lib/Linux-g++/libG4globman.so (0x002dd000)
        libGLU.so.1 => /usr/lib/libGLU.so.1 (0x00306000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0x00fa0000)
        libXmu.so.6 => /usr/lib/libXmu.so.6 (0x00d23000)
        libXt.so.6 => /usr/lib/libXt.so.6 (0x0037c000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0x003d5000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x00537000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0x003e5000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0x00413000)
        libCLHEP-1.9.3.2.so => /home/wonhol/CLHEP/lib/libCLHEP-1.9.3.2.so (0x00ffb000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x04e1f000)
        libm.so.6 => /lib/libm.so.6 (0x00816000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00d59000)
        libc.so.6 => /lib/libc.so.6 (0x00e67000)
        libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x0466e000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x0042d000)
        libdl.so.2 => /lib/libdl.so.2 (0x0083d000)
        libdrm.so.2 => /usr/lib/libdrm.so.2 (0x048e9000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x008f4000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x008ec000)
        /lib/ld-linux.so.2 (0x006c4000)

As shown above, linking is fine now but still error message comes out.

Would you please keep helping me?

None Re: error while loading shared libraries: *.so files  Keywords: error while loading shared libraries
by Ben Morgan <Ben Morgan>,   10 Apr, 2008
Re: None Re: error while loading shared libraries: *.so files (Wonho)

If you have the two lines in the .bash_profile for user wonhol, then this won't make any changes to the environment until you do

source ~/.bash_profile

or open an interactive login shell (graphical login counts here as well). If you didn't source the file then that's probably the cause of it not working.

If you did source it, then there's probably an error in your Geant4 installation (because the env.sh file created in the G4INSTALL directory -should- set the variables correctly). I'd recommend doing a fresh install, using this guide:

http://geant4.slac.stanford.edu/tutorial/installation/Geant4.9.0/Linux/Geant4_9_0_Linux_Installation.htm

The other error you're seeing:

'cannot restore segment prot after reloc'

is I -think- related to SELinux, rather than Geant4, although I'm not aware of this problem being reported for Geant4 before, and I'm sure it's been used on Fedora 5 before (any Fedora users want to comment?). All I can recommend here is to look at the documentation here:

http://fedoraproject.org/wiki/SELinux

Cheers,

Ben

 Add Message Add Message
to: "error while loading shared libraries: *.so files"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]