Running Geant4 with CLION

Hello, I’ve encountered the following error when trying to run geant4 with clion:
"…Geant4_work_dir/cmake-build-debug/sim: error while loading shared libraries: cannot open shared object file: No such file or directory

Process finished with exit code 127"

I think I’ve found the solution to it. Marked as solution to this topic.

As suggested in this following stack question:

You’ll need to go to:

Run -> Edit Configurations -> (select your application) -> Environment variables

Then, manually set your LD_LIBRARY_PATH:

LD_LIBRARY_PATH=*other paths you might need*:/Geant4 install location/lib

Try to run your application again. Your configuration should look like this:

Note that the path to the Geant4_install_dir/lib is concealed by CLION, but it’s there.

You might run to further problem:

G4ENSDFSTATEDATA environment variable must be set

Using the following answer:

Add the following to your env variables line:


Be sure to use the following resource for future errors:

For reference, my env variable line is as follows:


Try to run again, should work.

I hope this helps,

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.