The following instructions apply to the installation since the version 2.0. For the installation of the previous versions (1.x) see Installing geant3 - Older Versions page.
Geant3 (with VMC)
Geant3 with VMC requires ROOT.
Since version 2.0, Geant3 with VMC is installed with CMake. To install geant3:
- First get the Geant3 source from the Download page. We will assume that the Geant3 package sits in a subdirectory
/mypath/geant3
- Create build directory alongside our source directory
$ cd /mypath $ mkdir geant3_build $ ls geant3 geant3_build
- To configure the build, change into the build directory and run CMake:
$ cd /mypath/geant3_build $ cmake -DCMAKE_INSTALL_PREFIX=/mypath/geant3_install /mypath/geant3
If ROOT environment was defined using thisroot.{c}sh script, there is no need to provide the path to its installation. Otherwise, they can be provided using -DROOT_DIR cmake option.
Since version 2.1, the Geant3 library is built by default in
RelWithDebInfo
build mode (Optimized build with debugging symbols). This default can be changed via the standard CMake option CMAKE_BUILD_TYPE. The other useful values areRelease
: Optimized build, no debugging symbolsDebug
: Debugging symbols, no optimization - After the configuration has run, CMake will have generated Unix Makefiles for building Geant3. To run the build, simply execute make in the build directory:
where N is the number of parallel jobs you require (e.g. if your machine has a dual core processor, you could set N to 2).
$ make -jN
If you need more output to help resolve issues or simply for information, run make as
$ make -jN VERBOSE=1
- Once the build has completed, you can install Geant3 to the directory you specified earlier in CMAKE_INSTALL_PREFIX by running
$ make install