![]() ![]() ![]() ![]() |
Installation
Guide |
2. Installation procedures
In this section, a short tutorial on how to install the toolkit's kernel
libraries will be 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.
Before proceeding with the installation, you need to define some key environment variables in your user environment, in order to specify where all software components are placed and to set some compilation options.A complete reference to all environment variables in Geant4 is available in section 10.5 of the "User's Guide - For Application Developers".
G4SYSTEM
:
G4INSTALL
:
$HOME/geant4
)
CLHEP_BASE_DIR
:
G4WORKDIR
:
$G4INSTALL
)
G4LIB
:
$G4INSTALL/lib
)
G4TMP
:
$G4WORKDIR/tmp)
G4BIN
:
$G4WORKDIR/bin)
.
G4INCLUDE
:
gmake includes
(default in $G4INSTALL/include
)
G4DEBUG
:
G4LIB_BUILD_SHARED
:
G4LIB_BUILD_STATIC
:
G4LIB_BUILD_SHARED
to build shared and static libraries
simultaneously.
G4USE_G3TOG4
:
G4_NO_VERBOSE
:
$G4INSTALL/source/visualization/README
for installation
tips.
At this point, do the following to start building the compilation and
installation of the kernel libraries.
You can choose to build libraries in
one of two ways, according to the needs and system resources. From
$G4INSTALL/source
:
gmake
gmake global
GNUmakefile
in $G4INSTALL/source
parses the dependency
files of Geant4 and produces a file libname.map
in
$G4LIB
. libname.map
is produced by the tool
liblist
, whose source code is in
$G4INSTALL/config
.binmake.gmk
in $G4INSTALL/config
will parse the user's
dependency files and use libname.map
to determine through
liblist
the required libraries to add to the linking list. Only the
required libraries will be loaded in the link command.gmake libmap
issued from $G4INSTALL/source
, allows to
manually rebuild the dependency map. The command is issued by default in the
normal build process for granular libraries.Configure
shell scriptConfigure
shell script is placed in the installation directory $G4INSTALL
and
allows the user or system administrator to install the Geant4 toolkit in an
automatic way. It requires some knowledge of the system from the installer, such
as:
$G4INSTALL
)
$G4INSTALL
: > ./Configure -installand follow the instructions on-screen. The script provides with 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 $G4INSTALL/source > gmake cleanwhere
$G4SYSTEM
and $G4INSTALL
are manually set
in your environment.
In case new modules must be added to an existing installation (for example a
module for visualization), this can either be done manually, by setting the
proper environment variables, building the modules and then updating the
existing shell script env.csh
, or by rerunning
Configure
in the same installation area and providing the new
settings.
Configure
script provides a way to check the
existing installation and provide the correct configuration for the user's
environment. To run the configuration script for configuring the user's
environment, the user must type: > $G4INSTALL/Configureto determine and generate the correct shell script
env.csh
to
be sourced or integrated in the shell login script (.tcsh
for
example). The shell script will be generated by default in the user's current
directory ($PWD
). The user can customise it to specify for example
his/her proper working directory through the variable $G4WORKDIR
.
Once the generated script is sourced, the user will be ready to start building a
Geant4 application.G4INCLUDE
specifying the directory path. Therefore, it's rather
straightforward to integrate Geant4 in a generic external framework, by simply
knowing the path where header files are located in the system
(G4INCLUDE
) and where installed libraries are placed
(G4LIB
).
In section
10.5 of the Appendix, you can find together with the list of all environment
variables, also a section explaining how to integrate external libraries which
may use or not use Geant4 kernel libraries, in the GNUmake mechanism of
Geant4.