(Build packages required by art) (Build a distributable ups) (Building art externals)
(Building extra packages for the neutrino experiments) (Building extra packages for Mu2e)
(Building CET packages and art)

Building extra packages for Mu2e

These instructions should be considered obsolete. Please see the download page for the mu distribution.

In addition to the art externals products, Mu2e uses the following products:

Product Qualifier Extra Qualifier Notes
geant4 eN debug, opt, or prof
heppdt eN debug, opt, or prof
scons gccXX debug, opt, or prof
xerces_c eN debug, opt, or prof
root mu2e:eN debug, opt, or prof the Mu2e build of root enables RooFit

<product-dir> is the fully qualified path to your external packages directory.

  • The build order is very important. Several products rely on the existence of other products.
  • We start by building those products which have no depencencies except the existence of packages already in art_externals.
  • We recommend that you look at the various log files after they are created.

1. Make sure you have the art externals installed in your <product-dir>

Build a distributable ups
Building art externals

2. Setup the environment

For the purposes of this build, make sure that the PRODUCTS variable only points to <product-dir>.
This variable is used in the build scripts.

source <product-dir>/setup
bash: export PRODUCTS=<product-dir>
tcsh: setenv PRODUCTS <product-dir>

Get and unwind the mu2e_externals source code tarball:

curl -O<version>-source.tar.bz2
tar xf mu2e_externals-<version>-source.tar.bz2

3. Now build packages which have no extra dependencies:

There are 3 available build types: opt, debug, and prof.
If you are unsure which to use, start by building for debug. However, we note that the experiments generally use the prof build.
We have found very little difference in performance between opt and prof, and therefore recommend building prof (for profile) for increased performance.

You MUST specify either debug, opt, or prof for all build scripts except scons.
We will refer to this as <extra_qual> in the directions below.

Build xerces_c

cd $PRODUCTS/xerces_c/<version>
./ <extra qual> <eN> >& log.buildXerces.<extra qual> &

Build heppdt

cd $PRODUCTS/heppdt/<version>
./ <extra qual> <eN> >& log.buildHepPDT.<extra qual> &

Build scons

scons requires python (see art_externals)

cd $PRODUCTS/scons/<version>
./ >& log.buildScons &

4. Next, Build Geant4

Geant4 requires clhep (see art_externals) and xerces_c

cd $PRODUCTS/geant4/<version>
./ <eN> <extra_qual> >& log.buildGeant4.<extra_qual> &

The Geant4 optional data files are installed as separate products.
The simplest way to install these packages is via upd, using

cd $PRODUCTS/geant4/<version>

5. Getting root

ROOT is a complex product. Several packages are needed to build ROOT.
The Mu2e build of ROOT requires gcc, fftw, libxml2, and python.

Build root

cd $PRODUCTS/root/<version>
./ <mu2e:eN> <extra_qual> >& log.buildRoot.mu2e.<extra_qual> &

6. Distributing mu2e_extras

Verify that ups recognizes all the products

  • List all the products in <product-dir>
ups list -aK+

Build the distributable ups tar file.

  • Some definitions used to name the tarball:
  • version: usually written as, for instance, 0.5.0 instead of v0_5_0
  • os: sl6, sl5, etc.
  • architecture: noarch, i686, or x86_64
  • compiler: e2, gcc47, etc.
  • For general distribution, we allow people to define their own <product-dir>, so we build the tarball from inside <product-dir>
  • We tar the noarch and architecture specific packages separately.
  • Note that <product-dir> will also contain other products. These instructions are just for the extra Mu2e packages.
cd $PRODUCTS/art_externals/<version>
./ $PRODUCTS <eN> <extra_qual> [noarch]
  • This will create $PRODUCTS/mu2e_extras-<version>-noarc.tar.gz and $PRODUCTS/mu2e_extras-<version>-<os>-<architecture>-<compiler>.<extra_qual>.tar.gz

7. Getting a prebuilt tarball

  • You can copy and unwind your own tarball wherever you need it.
  • Tarballs for supported distributions of mu2e_extras are at
  • To conserve disk space, we strongly recommend deleting your local copy of the tarball after you unwind it.