The following instructions apply to the installation of versions < 3.0. For the required configurations of Root and Geant4 for these older versions see Special installations page.
First get the Geant4 VMC source from the Download page.
The path to Root installation can be defined in two
complementary ways:
a) With the environment variable ROOTSYS:
For the older geant4_vmc versions (2.x - 2.8) see below.
Geant4 installation options:
Since the version 2.14, the user applications which build geometry via Root (or Geant4), can be built with Geant4 installed without G3toG4 package. The G3toG4 dependent code in geant4_vmc has to be then
inactivated by setting the following environment variable:
Geant4 VMC 2.15x version is not migrated to Geant4 multi-threading and it can be built against both Geant4 sequential and Geant4 multi-threading installations. The Geant4 MT installation requires -ftls-model=global-dynamic model. The VMC application will run in a sequential mode in both cases.
Geant4 VMC 3.00.x version is migrated to Geant4 multi-threading and can be built against both Geant4 sequential and Geant4 multi-threading installations. The -ftls-model=global-dynamic model is required for running VMC applications from Root session (in a "traditional" way with dynamic loading of libraries). Since 3.00.x version, CMake configuration files are provided to build VMC application main program linked with all libraries, Geant4 built with -ftls-model=initial-exec model (default) can be then used.
Only VMC applications which are migrated to multi-threading mode can be built and run against Geant4 multi-threading installation. Non migrated application have to be built against Geant4 sequential installation.
The path to the Geant4 installation is defined with the Geant4 configuration script:
Note that the G4INSTALL environment variable should NOT be set in this case as it would trigger building geant4_vmc against the Geant4 configuration via GNUmake build.
Since the version 2.0, you can choose to run Geant4 with the Geant4 native geometry navigation or the G4Root navigation.
To run with the Geant4 native geometry navigation in case your geometry is defined via the Root geometry package, you will have to install the Virtual Geometry Model (VGM) package. See the VGM Web site how to do it.
VGM is used in Geant4 VMC for a geometry in memory conversion from Root TGeo objects to the Geant4 native geometry. More details about this can be found at the page on geometry definition and navigation.
The following environment variables that defines the paths to used systems have to be set:
For the versions (2.9 - 2.15x), to install geant4_vmc:
For the older versions (2.x - 2.8) of geant4_vmc:
The examples are provided within geant4_vmc package; to build all available examples: