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/2026

If 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

  1. Quick Setup (New Users)
  2. Architecture Overview
  3. Guide to Using Spack
  4. What Is New in Modern Spack
  5. Legacy Setup

Quick Setup

For a fresh setup:

rub-deploy-spack-configs-2026
module load spack/2026

After 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 system

This 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 $HOME Spack 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 openfoam

Show details (versions, variants, dependencies):

spack info hdf5

Preview what will actually be installed:

spack spec hdf5 +mpi

Always check spack spec before installing complex packages.


Installing Packages

Basic installation:

spack install hdf5

Enable or disable variants:

spack install hdf5 +mpi +cxx ~fortran

Specify a compiler:

spack install hdf5 %gcc@13.4.0

Force rebuilding dependencies with the same compiler:

spack install --fresh hdf5 %gcc@13.4.0

Specify dependencies explicitly:

spack install hdf5 ^openmpi@5.0.9

Everything combined:

spack install hdf5@1.14.6 +mpi %gcc@13.4.0 ^openmpi@5.0.9

Virtual Providers (BLAS, MPI, FFT, etc.)

Some packages depend on virtual interfaces instead of concrete libraries. Examples include:

  • blas
  • lapack
  • mpi
  • fftw-api

To see which virtual packages exist:

spack providers

To list available providers for a specific interface:

spack providers blas
spack providers fftw-api

Example output:

Providers for blas:
    amdblis
    openblas
    intel-oneapi-mkl

You can select a specific provider during installation:

spack install gromacs ^blas=openblas

This 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 hdf5

Inspect a specific installation:

spack spec /<hash>

Compare two installations:

spack diff /hash1 /hash2

Removing 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
EOF

Register it in ~/.spack/repos.yaml (place it above builtin to override):

repos:
  overrides: $HOME/spack/var/spack/repos
  builtin:
    destination: /cluster/spack/spack-packages

Check:

spack repo list

Override 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.ffmpeg

Verify which repository is used

For a spec (not yet installed):

spack spec -N ffmpeg

For installed packages:

spack find -N ffmpeg

The -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 install

This performs a normal installation and ensures all dependencies are available.

Switch to development mode

spack develop openfoam

This 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 openfoam

Look 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 install

Spack 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).

Subsections of Spack