Running program in terminal question. Please help
I am so confused by this problem because I know it shouldn't exist. I have installed a program called GEANT4 and spent the past 2 weeks trying to get it to run. Yesterday it did run and today it does not, and I couldn't understand how this is possible.
I am so confused by this problem because I know it shouldn't exist. I have installed a program called GEANT4 and spent the past 2 weeks trying to get it to run. Yesterday it did run and today it does not, and I couldn't understand how this is possible. When I would execute an example, I would receive this error:
[root@localhost N01]# /root/bin/Linux-g++/exampleN01
/root/bin/Linux-g++/exampleN01: error while loading shared libraries: libG4persistency.so: cannot open shared object file: No such file or directory
A friend helped guide me to solve this problem. He told me to enter /root and use emacs to edit .bashrc by adding lines:
LD_LIBRARY_PATH=/root/geant4/lib/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
This helped because it told the computer where to find the library. Now when I would execute an example the program ran perfectly. However, I closed the terminal and re-opened it to run into the same problem. The libG4persistency.so file cannot be found, and I thought the problem was fixed so now I don't know what to do and I cannot reach my friend for 2 weeks. Can anyone please provide assistance?
[root@localhost N01]# /root/bin/Linux-g++/exampleN01
/root/bin/Linux-g++/exampleN01: error while loading shared libraries: libG4persistency.so: cannot open shared object file: No such file or directory
A friend helped guide me to solve this problem. He told me to enter /root and use emacs to edit .bashrc by adding lines:
LD_LIBRARY_PATH=/root/geant4/lib/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
This helped because it told the computer where to find the library. Now when I would execute an example the program ran perfectly. However, I closed the terminal and re-opened it to run into the same problem. The libG4persistency.so file cannot be found, and I thought the problem was fixed so now I don't know what to do and I cannot reach my friend for 2 weeks. Can anyone please provide assistance?
Participate on our website and join the conversation
This topic is archived. New comments cannot be posted and votes cannot be cast.
Responses to this topic
Are you trying to run the program as root? The only environment you changed was root's. You also have a .bashrc in your user's home directory that you can use that trick with (if the user has permission to run the geant4 script, of course).
If this is not the problem. Have you tried running ldconfig, then running the script? Failing that, try adding
/root/geant4/lib
to the end of your /etc/ld.so.conf file and then run ldconfig then see if you can run the script.
If this is not the problem. Have you tried running ldconfig, then running the script? Failing that, try adding
/root/geant4/lib
to the end of your /etc/ld.so.conf file and then run ldconfig then see if you can run the script.
If that library is in /root, then you'll only be able to run the script as root. Are you running it as root?