Problem while running B1 example

Hello all,

After installing Geant4 with qt5, I tried to run example B1 and this report occurred:

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : PART70000
issued by : G4NuclideTable
G4ENSDFSTATEDATA environment variable must be set
*** Fatal Exception *** core dump ***
**** Track information is not available at this moment
**** Step information is not available at this moment

-------- EEEE -------- G4Exception-END --------- EEEE -------

*** G4Exception: Aborting execution ***

I use M1 MAC, Geant4 11.0.3 with qt5, and this is the first time running geant4.
Seems I missed G4ENSDFSTATEDATA environment variable, may I ask how can I add it to solve this error?

Thank you,
Siyao

Thank you.

https://geant4-userdoc.web.cern.ch/UsersGuides/InstallationGuide/html/postinstall.html#required-environment-settings-on-unix

basically, for every terminal you open you need to run

source geant4.sh

once, within the correct folder.

Thank you for your reply.

I checked that the CMAKE_INSTALL_PREFIX directory is /usr/local, then I sourced geant4.sh in the terminal /usr/local/bin. However the same error occurred when I run the example again. Sorry for being stupid, please let me know what I am doing wrong.

Siyao

when you close the terminal or open a second one, you need to source the file again in that terminal.

edit: sorry, thought you made it run once, but not again. in this case, the next post is a solution, or you could use the install option to automatically download the datasets:
https://geant4-userdoc.web.cern.ch/UsersGuides/InstallationGuide/html/installguide.html#standard-options

GEANT4_INSTALL_DATA : (DEFAULT : OFF)

think you need to re-run the cmake command only with the updated option and building should be quite fast afterwards

cmake -GEANT4_INSTALL_DATA=ON .
cmake --build . --target install
2 Likes

download the G4ENSDFSTATEDATA data from the geant4 website https://geant4.web.cern.ch/support/download and paste it in your install directory as ~/genat4****-install/share/Genat4-v11-***/data/
if data folder is not there first create and paste the extracted folder there.

1 Like

Thank you very much. It works!

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