GEANT4

GEometry ANd Tracking

Installation in Ubuntu

1. Install pre-requisites using the following commands:

     sudo apt-get install cmake gcc g++  expat libexpat1-dev default-jre default-jdk qtbase5-dev

  sudo apt-get install cmake-qt-gui mesa-common-dev libglu1-mesa-dev libxmu-dev

2. Create directory "geant4source", "geant4build" and "geant4install"

3. Download the latest geant4 source code from geant4 website and extract & rename it to "geant4source"

3. Go to the directory "geant4build"

4. Type "cmake-gui" in terminal to open gui version of cmake

5. Browse the "geant4source" and "geant4build" directories

6. Click on configure button. It will show the various options available in the geant4.

     You can change the location of the geant4 installation in CMAKE_INSTALL_PREFIX (default is /usr/local/) to the geant4install directory

     You can install geant4 in multithreaded mode by turning on the option of GEANT4_BUILD_MULTITHREADED

     Turn on the automatic download of geant4 datasets using GEANT4_INSTALL_DATA

     Tick the GEANT4_USE_OPENGL_X11 option to use the OpenGL visualisation tool

     Tick the GEANT4_USE_QT to enable use of QT while using the OpenGL tool

     Tick the GEANT4_USE_SYSTEM_EXPAT to use expat

Again click on configure button. If everything is correct it will not show any errors and a "Configuring done" message will be displayed.

7. Click on Generate button and a "Generating done" message will be displayed after a few seconds.

8. Go back to the terminal and type "make -j4" ( 4 refers to the number of cores in the CPU that will be used while making. Choose this according to your system) 

9. If no error is shown, type "sudo make install" in the terminal

10. Congratulations...Geant4 is now installed.


Feel free to contact me if you find any mistakes.