Problems running on server

Hi,
I installed Geant4-10.5.1 on server running Scientific Linux release 7.6 (Nitrogen).
It compile and build target, but when I try to run I get this error massage:

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : PART70000
issued by : G4NuclideTable
G4ENSDFSTATEDATA environment variable must be set
*** Fatal Exception *** core dump ***
Segmentation fault
[arpad@n03 build]$ ./exampleB1
Available UI session types: [ GAG, tcsh, csh ]

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : PART70000
issued by : G4NuclideTable
G4ENSDFSTATEDATA environment variable must be set
*** Fatal Exception *** core dump ***
Segmentation fault

I tried to fix with next commands:
export G4ENSDFSTATEDATA=/usr/local/share/Geant4-10.5.1/data
export G4ENSDFSTATEDATA=/usr/local/share/Geant4-10.5.1/data/G4ENSDFSTATE2.2
export G4PARTICLEXSDATA=/usr/local/share/Geant4-10.5.1/data/G4PARTICLEXS1.1
export G4LEDATA=/usr/local/share/Geant4-10.5.1/data/G4EMLOW7.7
export G4LEVELGAMMADATA=/usr/local/share/Geant4-10.5.1/data/PhotonEvaporation5.3

After this lines i got another error massage:

In /root/geant/geant4.10.05.p01/source/processes/hadronic/models/particle_hp/src/G4ParticleHPInelastic.cc, line 86:
===> Please set the environement variable G4NEUTRONHPDATA to point to the neutron cross-section files.
terminate called after throwing an instance of ‘G4HadronicException’
what(): std::exception
Aborted

What could be a problem? How can I fix it?

Sorry for a very long massage, I’m quite a new user so I don’t have much experience.

Thank you for answers!

Kind regards!

As you did for the other variables, you’ll need to set the G4NEUTRONHPDATA environment variable to point to the G4NDL4.5 directory. With the install tree layout, the following should work:

export G4NEUTRONHPDATA=/usr/local/share/Geant4-10.5.1/data/G4NDL4.5

See also the postinstall setup guide, as there’s a script that should help automate this:

http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/postinstall.html

1 Like

Thank you very much!
Now works!

Hello, dear all!
I have the same/twin problem at compilled my project:

NeutronHP: /Inelastic file for Z = 8, A = 18 is not found and NeutronHP will use /opt/geant4/geant4.10.05.p01/share/Geant4-10.5.1/data/G4NDL4.5/Inelastic/CrossSection/8_17_Oxygen
In /opt/geant4/geant4.10.05.p01/source/processes/hadronic/models/particle_hp/src/G4ParticleHPInelasticData.cc, line 79:
===> Please setenv G4PROTONHPDATA to point to the proton cross-section files.
terminate called after throwing an instance of ‘G4HadronicException’
what(): std::exception
Аварийный останов (стек памяти сброшен на диск)

And i corrected my bashrc-file writing this line there:
export G4NEUTRONHPDATA=/opt/geant4/geant4.10.05.p01/share/Geant4-10.5.1/data/G4NDL4.5

Downloaded this library(G4TENDL1.3.2) from of.site geant4 and i have put it into:
/geant4/geant4.10.05.p01/share/Geant4-10.5.1/data/

After that i had written these lines in my bashrc-file too:

export G4PARTICLEHPDATE=/opt/geant4/geant4.10.05.p01/share/Geant4-10.5.1/data/G4TENDL1.3.2
export G4PROTONHPDATA=/opt/geant4/geant4.10.05.p01/share/Geant4-10.5.1/data/G4TENDL1.3.2/Proton
export G4DEUTERONHPDATA=/opt/geant4/geant4.10.05.p01/share/Geant4-10.5.1/data/G4TENDL1.3.2/Deuteron
export G4TRITONHPDATA=/opt/geant4/geant4.10.05.p01/share/Geant4-10.5.1/data/G4TENDL1.3.2/Triton
export G4HE3HPDATA=/opt/geant4/geant4.10.05.p01/share/Geant4-10.5.1/data/G4TENDL1.3.2/He3
export G4ALPHAHPDATA=/opt/geant4/geant4.10.05.p01/share/Geant4-10.5.1/data/G4TENDL1.3.2/Alpha

And this problem has solved.

[quote=“bmorgan, post:2, topic:357, full:true”]
As you did for the other variables, you’ll need to set the G4NEUTRONHPDATA environment variable to point to the G4NDL4.5 directory. With the install tree layout, the following should work:

1 Like

Hello, I have been using Geant4 virtual machine on my Mac but recently decided to install the latest version on my Mac. After successful installation I tried to run the B1 example and I came across this problem:

So I tried exporting all the installed data files as found on my install path:

Like this:

But I still get the error. One thing I noticed is that G4ENSDFSTATEDATA is not among the data files installed. How do I solve this please?

Sorry for the large message.

You shouldn’t need to set the Geant4 envvars by hand yourself. Your installation should include the script source <g4install>/bin/geant4.sh, which will set all of them according to the installation you did.

Does this mean I will have to run all my simulation within the path?

The command: source /usr/local/bin/geant4.sh only works within the bin/ directory. If I do that outside this directory I get the following error message:

Screenshot 2022-06-27 at 17.28.13

Not really. You can do it like this:

pushd /usr/local/bin
source geant4.sh
popd

or you can combine those on one command line with semicolons:

pushd /usr/local/bin; source geant4.sh; popd

In general, we strongly discourage installing Geant4 under /usr/local. It’s usually better to specify a Geant4 installation area, like /usr/local/Geant4/<g4version> or something.

1 Like

Thank you very much for your help, its works now from any directory.

I realised I have to do this each time I open a terminal. Is there a way to load this automatically whenever a new terminal is opened?

Aliyu

You could put it into your .profile (or .bash_profile) if you’re sure you always want G4 set up. Or, you could define an alias for that action, e.g.,

alias geant4="pushd /usr/local/bin; source geant4.sh; popd"

in your .bashrc file. Then you just have to type geant4 when you want it.

1 Like