How to migrate to Geant4 9.6.p01
Ths build of Geant4 9.6.p01 is significantly different from previous releases.
Here there are some notes on how to set-up the environment of Geant4 9.6.p01 on the Centaur cluster.
1) Once you log in on your account, type: source /home/shared/geant4.9.6.p01-build/bin/geant4.sh
Lets' suppose your G4 application directory is called my_main and it is in your home directory:/home/my_name/my_main (~/my_main)
As example, my_main directory contains:
- my_main.cc
- macro files vis.mac, macro1.mac, etc
- src and include directories
2) Copy file /home/shared/CMakeLists_example.txt in the directory ~/my_main
4) Type: cd ~/my_main
3) Type: mv CMakeLists_example.txt CMakeLists.txt
4) Edit CMakeLists.txt and change "my_main" with the name of of your main wherever you find this variable in the file.
In line 43 substitute macro1.mac macro2.mac etc with the list of your macro files.
5) Once you have done that, create a directory "build" in my_main directory: mkdir ~/my_main/build
5) Type: cd ~/my_main/build
6) Type: cmake -DGeant4_DIR=/home/shared/geant4.9.6.p01-build ~/my_main
7) Type: make
The executable my_main is created.
If you have errors of compilation, you have to check your code.
8) To run your application, type: ./my_main
If you still wat to use gcc, copy in your home directory /home/shared/geant4.9.6.p01/geant4.9.6-install/geant4make.sh
then type source ~/geant4make.sh .