Chapter 2.  Installation Procedures

Before installing Geant4, the required software listed in Section 1.2 (and Section 1.3 in the case of graphics drivers) of this Installation Guide must already be installed on your system.

In this section, a short tutorial on how to install the toolkit's kernel libraries is given. The installation of the Geant4 kernel libraries and the proper configuration of the environment can be achieved either manually (by setting the proper environment variables) or through the Configure shell script, which will allow the installation of just the necessary source code and libraries in a specified installation area.

Step-by-Step guides for the installation are also available. See Appendix - Step-by-Step Installation Guides of Geant4 User's Guide - For Application Developers.

2.1.  Using the Configure Script for installation

A shell script is provided for building the libraries and to allow easy installation in a specified area. The Configure shell script is placed in the top directory tree of the distribution (geant4/Configure) and allows the user or system administrator to install the Geant4 toolkit in a semi-automatic way. Some knowledge of the system is required for the installation, such as:

  • the compiler to be used

  • the path where the Geant4 toolkit is to be installed ($G4INSTALL)

  • definition of installation directory paths (optional)

  • kind of graphics/analysis system(s) installed in the system, and paths to the installation of each graphics/analysis package

  • the kind of library to be generated: static/shared, compound/granular.

To run the installer script for building the libraries of the Geant4 toolkit, one must type the following from the top directory geant4:

 > ./Configure -build

and follow the on-screen instructions. No system administrator privileges are required at this stage. The script will ask for the path in the system where the Geant4 libraries should be installed later on. The script provides default settings for most of the environment variables to be set. By pressing -RETURN-, the default values will be selected; otherwise the proper selection (or path, in case a path is requested) must be typed in.

In case the installation procedure fails for some reason, or you realise the selected options were not correct at the time the installation started, you can repeat the whole process by manually removing the current installation with:

 > cd geant4/source
 > make clean

where the $G4SYSTEM environment variable (specifying the kind of architecture and compiler used) is manually set in your environment (according to the flavors listed in Section 1.1).

In case new modules must be added to an existing build (for example a module for visualization), this can be done manually by re-running Configure and providing the new settings.

Once the process of building the libraries has been completed successfully, the Geant4 toolkit can be installed in the specified (already existing) installation area by typing:

 > ./Configure -install

Libraries and necessary source code will be installed in lib/geant4, include/geant4 (if selected to install all headers in a single directory), src/geant4, respectively. System administrator privileges may be required for the installation stage, depending upon where in the system the installation should happen.

$G4INSTALL will be set to [INSTALLATION_AREA]/src/geant4.