Spack
We provide a central Spack 1.1.1 installation in parallel to the existing 0.23.0 stack.
This separation is necessary because a database migration would render the 0.23.0 installation unusable. The new 2026 module tree is not compatible with the legacy tree, and self-built packages from the old setup must be rebuilt.
By default, you will still see the legacy module tree. The new stack is opt-in via:
module load spack/2026If you already used the legacy setup, use this dedicated migration guide: Migration Guide for Existing Users.
Legacy documentation remains available here: Spack (Legacy 0.23.0).
Table of Contents
- Quick Setup (New Users)
- Architecture Overview
- Guide to Using Spack
- What Is New in Modern Spack
- Legacy Setup
Quick Setup
For a fresh setup:
rub-deploy-spack-configs-2026
module load spack/2026After that, you can install your own packages into your home Spack tree and generate personal modulefiles.
Add module load spack/2026 to your ~/.bashrc if you want this active in ever login shell.
Architecture Overview
We use a central Spack installation combined with per-user overlays:
Central Spack (read-only, maintained by HPC)
├─ pre-built packages
├─ MPI configurations
└─ cluster-wide defaults
↓ (upstream)
User Spack ($HOME)
├─ personal installs
└─ personal modules
↓
Lmod module systemThis means:
- You automatically use centrally installed packages when available.
- Cluster-wide configurations (e.g. MPI defaults, compiler settings) are inherited.
- Your own installations go into your personal
$HOMESpack tree. - Only missing packages are built locally.
Guide to Using Spack
This section covers the most common Spack workflows on Elysium.
Searching and Inspecting Packages
Search for packages:
spack list <keyword>
spack list openfoamShow details (versions, variants, dependencies):
spack info hdf5Preview what will actually be installed:
spack spec hdf5 +mpiAlways check spack spec before installing complex packages.
Installing Packages
Basic installation:
spack install hdf5Enable or disable variants:
spack install hdf5 +mpi +cxx ~fortranSpecify a compiler:
spack install hdf5 %gcc@13.4.0Force rebuilding dependencies with the same compiler:
spack install --fresh hdf5 %gcc@13.4.0Specify dependencies explicitly:
spack install hdf5 ^openmpi@5.0.9Everything combined:
spack install hdf5@1.14.6 +mpi %gcc@13.4.0 ^openmpi@5.0.9Virtual Providers (BLAS, MPI, FFT, etc.)
Some packages depend on virtual interfaces instead of concrete libraries. Examples include:
blaslapackmpifftw-api
To see which virtual packages exist:
spack providersTo list available providers for a specific interface:
spack providers blas
spack providers fftw-apiExample output:
Providers for blas:
amdblis
openblas
intel-oneapi-mklYou can select a specific provider during installation:
spack install gromacs ^blas=openblasThis is often preferred over manually selecting a specific concrete library, because it keeps the dependency graph clean and compatible.
Inspecting and Comparing Installations
List installed packages with variants and hashes:
spack find -vl hdf5Inspect a specific installation:
spack spec /<hash>Compare two installations:
spack diff /hash1 /hash2Removing Packages
Remove a specific installation by hash:
spack uninstall /<hash>Overriding Package Definitions
On Elysium, the central builtin repository is provided by the HPC team. If you want to override a package definition (e.g. to test changes), you can create a local repository on top of it.
Create a local repo
mkdir -p $HOME/spack/var/spack/repos/packages
cat > $HOME/spack/var/spack/repos/repo.yaml <<'EOF'
repo:
namespace: overrides
EOFRegister it in ~/.spack/repos.yaml (place it above builtin to override):
repos:
overrides: $HOME/spack/var/spack/repos
builtin:
destination: /cluster/spack/spack-packagesCheck:
spack repo listOverride a package (example: ffmpeg)
mkdir -p $HOME/spack/var/spack/repos/packages/ffmpeg
cp /cluster/spack/spack-packages/repos/spack_repo/builtin/packages/ffmpeg/package.py \
$HOME/spack/var/spack/repos/packages/ffmpeg/Edit the copied package.py and adjust versions, dependencies, variants, etc.
Install explicitly from your namespace:
spack install overrides.ffmpegVerify which repository is used
For a spec (not yet installed):
spack spec -N ffmpegFor installed packages:
spack find -N ffmpegThe -N option shows the namespace (overrides or builtin).
Custom Changes to Packages using spack develop
If you want to modify the source code of a package (e.g. openfoam) and rebuild it locally, you can use spack develop. This allows you to work directly on a source checkout without creating tarballs or calculating checksums.
Create and activate a development environment
mkdir -p ~/openfoam-dev
cd ~/openfoam-dev
spack env create -d .
spacktivate . #shortcut for `spack env activate .`Using a dedicated environment keeps your development work isolated from your normal Spack setup.
Add and install the package
spack add openfoam
spack installThis performs a normal installation and ensures all dependencies are available.
Switch to development mode
spack develop openfoamThis checks out the source code into the environment directory (e.g. ~/openfoam-dev/openfoam/) and registers it as the active development source.
You can verify this with:
spack find -cv openfoamLook for dev_path=.../openfoam in the output.
Modify the source and rebuild
cd ~/openfoam-dev/openfoam
# edit source files here (e.g. with vim)
cd ~/openfoam-dev
spack installSpack will now build openfoam from your modified local sources.
If compilation fails, Spack will print the relevant error messages and the path to the full build log.
Legacy Setup
If you need to reference the old 0.23.0 setup, use:
Spack (Legacy 0.23.0).