Local isntallation

There are several ways how one can install packages locally:

  1. Spack package manager

  2. EJPM package manager

  3. Combined Conda+EJPM isntallation

  4. Manual build

What packet manager to use? The recommendation is: to use EJPM for personal laptops with Linux OS for personal use and development. Use Spack on farms or if you are familiar with Spack or use Spack for other projects.

EJPM was designed with user laptops/workstations and devlopment in mind. The intention of EJPM is to be a user friendly CLI alternative to “build scritps” that compiles chains of packages with right flags. Spack is a full featured multi-platform package manager designed for clusters and super computers. It is possible to install software on laptops with Spack but at this point it is more prone to compilation errors.

There is also a hybrid variant of using Conda+EJPM where Conda is used to download binaries of compilers, big packages like CERN ROOT and Geant4 and then EJPM is used to build EIC applications on top of it. This type of installation also guarantee a consistency with compillers, binary libraries, etc.

Here is the short comparison table between Spack and EJPM:

EJPM Spack
Design User friendly CLI build scritps replacement. Laptops and workstations in mind. Full featured package manager capable to build and install multiple software versions and configurations. Supercomputers and farms in mind but laptops possible.
Dependencies Use system packages (yum, apt) as much as possible Use few system packages and build ALL dependencies
Utilize user packages
(ROOT, Geant4)
Easy to add Possible via editing configs but cumbersom
Packages variety Only ESCalate and EIC related All kinds of packages
Versions Limited support of package versions Spack shines here
Updates No automatic package updates
Development Very easy to modify/develop code Possible with develop environments. Cumbersom compared to EJPM
Support EIC community EIC community for EIC packages. Large science (HEP, Astrophysics, etc.) community for the rest of the packages and Spack itself

Detailed comparison between EJPM and Spack.



Detailed EJPM documentation


ejpm is EIC software centric package/build manager. It is the designed to be the default tool to build G4E on users machine, as it helps with:

  • building dependent packages (with “right” compilation flags)

  • setup environment variables to run everything

  • what packages to install by system packet manager

  • rebuild/update/remove/clean existing packages

    Still, ejpm is not a requirement.

First, install ejpm itself:

pip install --user ejpm

(If you have certificate problems (JLab issue), don’t have pip, or have other problems, here is the detailed documentation )

Install g4e and possible other EIC packets (ejana, eic-smear, etc.)

# 1. System prerequesties
ejpm req centos g4e      # get list of required OS packets. Use `ubuntu` on debian
sudo yum install ...     # install watever 'ejpm req' tells you

# 2. Where to install
ejpm --top-dir=<where-to>   # Directory where packets will be installed

# 3. Install
ejpm install g4e            # install 'Geant 4 EIC' and dependencies (like vgm, hepmc)

# 4.  Source environment
source ~/.local/share/ejpm/env.sh  # Use *.csh file for tcsh

User packages

If you have ROOT and Geant4 and don’t want EJPM to build them, here is how to use your packages with ejpm:

# Before running 'ejpm install g4e'
ejpm set root `$ROOTSYS`    # Path to ROOT installation
ejpm set geant <path>       # Path to Geant4 installation

Hint (!). Run ejpm to overview all installed packets, environment and status by ‘ejpm’ command

Here is the sample output:

> ejpm

EJPM v0.01.19
top dir :
state db :
    ~/.local/share/ejpm/db.json  (users are encouraged to inspect/edit it)
env files :

    * /eic/vgm/vgm-v4-5 (owned)
    * /eic/root/root-v6-16-00 (owned)
      /eic/geant/geant-v10.5.0 (owned)
    * /eic/geant4-10.6-betta
    * /eic/hepmc/hepmc-HEPMC_02_06_09 (owned)
    * /eic/g4e/g4e-dev (owned)

Switch software versions

# ejpm config <package> branch <version>
ejpm config g4e branch v1.3.8
# or
ejpm config g4e branch master
# now install a new version
ejpm install -f g4e

To check packet configuration:

ejpm config g4e

To check or change global configuration (for all packages)

ejpm config global      # prints version
ejpm config global cxx_version=17


if you install a new version of package EJPM doesn’t rebuild/reinstall downstream packages.

This means that if you install additional version of g4e you don’t have to do anything, as there is no packages depending on g4e. G4E is on top. But if you install a different version of ROOT or ACTS you have to rebuild packages, that depend on it. That is EJPM weakness.



Install spack

Spack is a package management tool designed to support multiple versions and configurations of software on a wide variety of platforms and environments. Spack allows to automatically build target packages with all needed dependencies. Sapck documentation

The installation consist of 3 steps then: 1. Install spack itself 2. Install EIC repository (with EIC packages) 3. Run spack command to install g4e (or other packages)

To install spack and EIC repository:

git clone https://github.com/spack/spack.git

#Source environment

# For bash/zsh users
$ . spack/share/spack/setup-env.sh

# For tcsh/csh users
$ source spack/share/spack/setup-env.csh

You should be able now to use spack:

spack info root

(!) By default, all packages will be downloaded, built and installed
in this spack directory

`More documentation on spack
installation <https://spack.readthedocs.io/en/latest/getting_started.html#installation>`__

Clone and add eic-spack repository:

# Adding the EIC Spack Repository
git clone https://github.com/eic/eic-spack.git

# Add this repository to your Spack configuration
spack repo add eic-spack

Example install and use g4e with spack

To install g4e with spack (this will install the latest stable version)

spack install g4e

To install concrete version of spack:

spack info g4e            # to see the available versions
spack install g4e@1.3.7   #

To see what is going to be installed/built

spack speck -I g4e

To use G4E with spack:

spack load g4e

# or with exact version
spack load g4e@1.3.7

More documentation of spack usage