Running Basic example B1

Don’t do it at all!! Environments are a nightmare - difficult/impossible to track - but, unfortunately necessary for Geant4. I keep a text file containing useful statements (in your case, source /home/afzaal/PET/Geant4/geant4.10.06.p01-install/bin/geant4.sh) so I can copy and paste it into my current terminal, which then sets up the environment for all jobs from that terminal, but does not leak into other terminals/shells.

John is absolutely right. Unless you’re doing nothing else but this specific Geant4 development, you should set up your environment “on demand”, when you log in and need it (even if that seems like “every time” right now).

John, your text file could easily be done as a real script which you “source” at your terminal prompt. The biggest hiccup is that things like the geant4.sh script can’t figure out its own directory if you’ve sourced it from within another source. You have to split it into three actions; in my case, I have

pushd /Applications/Geant4/geant4.10.06.p02/bin; source geant4.csh; popd

(yes, I like Tcsh!) amongst the other setup scripts I use.