Create a new geant4 distribution


  • A new release of geant4 is needed.
    • geant4 builds use clhep, xerces_c, and specified compilers.
  • What experiment is this for?
    • Which release of critic/art is used by the experiment.
    • Use the release of clhep used by that critic/art release.
    • Build for the compilers in use by that experiment.
  • Is there a newer release of xerces_c? If so, you might want it.
  • build framework has two parts
    • a ssi shim part for building an explicit product
    • build-framework for making a geant4 distribution
  • Start by making a product source code tarball, then make the distribution config files, and build the distribution on Jenkins

Before starting

  • make or update a local product directory
  • Use pullProducts with an appropriate geant4 distrbution



  • get release version and matching external data product versions from
  • get the ssi shim package
    git clone ssh://
  • edit,, ups/geant4.table,, and scripts/
  • patch file
    • Determine if the existing patch file is still needed
    • We promise to distribute the source code as obtained from the official distribution. If some change is needed for, say a new compiler, then we provide an appropriately named patch file.
    • All patch files MUST reside in a "patch" subdirectory. This ensures that they will be in the source code tarball.
  • and
    • The base package version must always map to the offical release.
    • Note, add a, b, c, etc. as needed to pkgver if we have to make a new release with, say a different release of clhep.
  • ups/geant4.table
    • check the releases of clhep, xerces_c, and qt (mu2e only)
  • Update external data product versions in and scripts/

Make a test build

  • local product directory contains the compilers and other products you have not built yourself
  • working product directory is where you will make the source code tarball and test the build
    • These can be the same directory.
    • If they are not the same directory, the working product directory must contain at least the .upsfiles directory.
  • Make a source code tarball and make tarballs for the data products
    source <working product directory>/setup
    ./ <working product directory>
    ./ <working product directory>
  • Make a test build using Edit and repeat as necessary until you have a good build of geant4 for gcc and clang.
  • If anything has changed, you MUST make a new source code tarball by rerunning
  • Once you are satisfied, upload the source code tarball and the dataset tarballs.
    cd <working product directory>
    copyToSciSoft g4*bz2
    copyToSciSoft geant4-4.10.6-source.tar.bz2

The geant4 distribution

  • geant4 distribution scripts are created from a branch in build-framework
  • Depending on the release, a new branch may be needed. For example, when we first built geant4.10.6 (i.e. v4_10_6), we did the following:
    git clone ssh:// 
    git checkout for_geant4_10_5 (latest branch)
    git checkout -b for_geant4_10_6
    git push -u origin for_geant4_10_6
  • Check and update the relevant products in the top CMakeListst.txt file.
  • Make a temporary build directory somewhere and run cmake on your clone of build-framework
    mkdir <my cmake build dir>
    cd <my cmake build dir>
    source <working product directory>/setup
    cmake <path to>/build-famework
  • cmake will create art_externals/geant4-cfg-<product dot version> and art_suite/ geant4-<product version>.html
  • check these files and then upload to Scisoft
     copyToSciSoft art_externals/geant4-cfg-4.10.6  art_suite/geant4-v4_10_6.html

Make the distribution

  • Distributions require a Jenkins build
    • use project geant4-release-build
  • For questions about Jenkins, use . It is helpful to subscribe to this list.
  • After the build has finished, use copyFromJenkins to download the tarballs and distribution manifests.
    mkdir <empty directory>
    cd <empty directory>
    copyFromJenkins -N -q e19 -q c7 geant4-release-build
  • Use copyToSciSoft to upload these files to SciSoft
    • copyToSciSoft will NOT replace any files already on SciSoft
    • If you have downloaded the files into an empty directory, it is safe to use wildcards.
      copyToSciSoft *
      copyToSciSoft *.bz2
      copyToSciSoft *.txt