4.3.  Using Geant4

Once Geant4 has been installed two options are available for using the toolkit. The installation provides the existing Geant4 GNU makefile structure under CMAKE_INSTALL_PREFIX/share/geant4-9.4.0/config, together with shell scripts

which can be sourced or integrated into the shell rc scripts (.bashrc or .tcshrc). The scripts will configure your environment in the same way as described in Section 2.2, and Geant4 applications can then be built using the Geant4 supplied GNU makefile system. You should not directly edit the shell scripts to adjust variables such as G4WORKDIR. It is better to first source the script and then re-set any needed variables. You will also need to manually set the environment variables pointing to any needed data libraries.

If you do not wish to, or cannot, use the Geant4 supplied GNU make system, a program CMAKE_INSTALL_PREFIX/bin/geant4-config is supplied. This can be executed to query the installation and extract needed compiler and linker flags to build an application using Geant4. Its usage is as follows

        Usage: geant4-config [OPTION...]
          --prefix                output installation prefix of Geant4
          --version               output version for Geant4
          --libs                  output all linker flags
          --cflags                output all preprocessor
                                  and compiler flags

          --libs-without-gui      output linker flags without 
                                  GUI components
          --cflags-without-gui    output preprocessor and compiler
                                  flags without GUI components
                          
          --has-feature FEATURE   output yes if FEATURE is supported,
                                  or no if not supported

        Known Features:
          gdml[no], qt[no]

        Help options
          -?, --help              show this help message
          --usage                 display brief usage message
      

Note that the elements in the Known Features section will display yes if a feature was enabled in the toolkit build. Note that this program will only be installed if global libraries are built.