Paths to Geant4 files continually forgotten

Hi I have an issue with running my code whereby I have to run a bash script to avoid an error stating that e.g. G4ENSDFSTATEDATA cannot be found or isn’t there (along those lines).

The script I run:
eval “$(./Export_params.sh)”

does:
#!/bin/bash
echo “export G4LEDATA=/usr/local/share/Geant4-10.7.2/data/G4EMLOW7.13”
echo “export G4LEVELGAMMADATA=/usr/local/share/Geant4-10.7.2/data/PhotonEvaporation5.7”
echo “export G4PARTICLEXSDATA=/usr/local/share/Geant4-10.7.2/data/G4PARTICLEXS3.1.1”
echo “export G4ENSDFSTATEDATA=/usr/local/share/Geant4-10.7.2/data/G4ENSDFSTATE2.3”
echo “PATH=$PATH:/Applications/CMake.App/Contents/bin”

I only have to do this whenever I enter back into my top level Geant4 folder where I can see all my folders (src, include, build). I would greatly appreciate any advice on how to fix this, as my solution at the moment is not all that great.

Thanks

Why aren’t you directly sourcing your installed Geant4-10.7.2/bin/geant4.sh script? Even if you do the above by hand, why is your “Export_params.sh” written so complexly? Just put the export statements in there directly, and use

 . ./Export_params.sh

The solution here is to be aware of which shell you are using, I was using zsh so it all needed to be in ~/.zshrc

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