For any question write to : phy.vijayraj@gmail.com
Computer OS :- UBUNTU 16.04 LTS
RAM: 8GB
Before installing Geant4, it is always recommended to check some important libraries. In order to install the important libraries, type from your terminal,
sudo apt-get install build-essential libexpat1-dev libxmu-dev cmake cmake-curses-gui qt5-default -y
The next important step is to install CLHEP. The package I installed in my machine can be downloaded from here. In your home directory or as per your path choice, create a directory name as CLHEP and move untar CLHEP package (2.4.1.1). In the same CLHEP folder create a directory name as build. Now follow basic steps to install CLHEP.
1. cd build
2. ccmake ../2.4.0.4/CLHEP/
3. Press c to configure, and again press c to confirm.
4. press g to generate makefile.
5. make -j4
6. sudo make install
Note: I did not deleted the build folder, because it helps to uninstall the CLHEP and to install updated or latest version.
Now we are ready to install GEANT4 MC Toolkit
Version11 :: here
1. Download Geant4 source package from here and untar it as per your choice path (directory).
2. Create build directory inside the path directory.
3. cd build
4. cmake -DCMAKE_INSTALL_PREFIX=~/Geant/geant4-install -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_QT=ON ../geant4.10.05.p01 [Geant is my main directory where I have build, source directories of Geant4]
Extra 4. cmake -DCMAKE_INSTALL_PREFIX=/home/vj/myphysics/geant4_install/geant4-install-seq -DGEANT4_USE_QT=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_INSTALL_DATA=ON -DGEANT4_BUILD_MULTITHREADED=OFF -DGEANT4_INSTALL_EXAMPLES=ON ../geant4-v11.0.1
[If multithreaded is not required] [ -DGEANT4_USE_GDML=ON ] ---> for G4GDML [GARFIELD] [ pre-requisite -> sudo apt-get install libxerces-c-dev ]
For the g4TENDL data add -DGEANT4_INSTALL_DATASETS_TENDL=ON in the cmake.
5. make -j4
6. make install ---- without sudo
7. From the new terminal open .bashrc file (gedit .bashrc)
8. Set path :- source ~/Geant/geant4-install/bin/geant4.sh
9. Set environment (type in new terminal and enter):- printenv | grep G4
Note: I did not deleted the build folder, because it helps to uninstall the Geant4 and to install updated or latest version.
Testing an example. Create work directory anywhere as per your choice. Cope and paste basic B1 example from Geant4 or build directory examples.
1. cd basic/B1
2. create build directory
3. cd build
4. cmake ../
5. make
6. ./exampleB1
P.S.: I used ccmake and cmake command to install CLHEP and Geant4, respectively. Geant4 can be installed using single ccmake command. Further withe same command one can build projects. No worries.
UNINSTALLING GEANT4 version..
If you haven't deleted the build folder, then follow steps;
go to build folder and run make uninstall
:)