Home - andreagp/Geant4-tutorial GitHub Wiki
Welcome to the Geant4-tutorial wiki using CMake, Git and Github!
Before starting:
- Install Geant4: http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ command: sudo cmake -DCMAKE_INSTALL_PREFIX=/usr/local/geant4/geant4.10.04-install -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_QT=ON -DGEANT4_USE_OPENGL_X11=ON /usr/local/geant4/geant4.10.04
- Create an account in github: https://github.com
- Install git: https://gist.github.com/derhuerst/1b15ff4652a867391f03
- Set up your username and ssh key with: https://help.github.com/articles/setting-your-username-in-git/ and https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ Do not forget to setup up Geant4 environment:
A quick check is to print the environment path in a terminal using:
echo $G4ENSDFSTATEDATA, you should be able to see the relative path of that folder and with ls $G4ENSDFSTATEDATA you should be able to see a list of what's inside that folder, such as a README file, etc... if the output is empty, the environment is not configured correctly.
I personally configure Geant4 in .bashrc file so I don't need to remember to configure it every time. Also, I can easily switch between version easily:
In your home directory, open .bashrc file and add (where PATH_TO_GEANT4_INSTALL is your absolute PATH for geant4-install of the version you want to use):
source PATH_TO_GEANT4_INSTALL/bin/geant4.sh
export G4DIR=PATH_TO_GEANT4_INSTALL/lib/Geant4-10.4.0/
In my case, PATH_TO_GEANT4_INSTALL is: /usr/local/geant4/geant4.10.04-install/ I use $G4DIR as a shortcut for the absolute path of Geant4. Both commands need to be consistent with the SAME version. After you save and close .bashrc, open a new terminal and do the quick check above.