You can use our service desk portal for getting RIS support. RIS also offers 15 min. virtual office hours session Mon-Thru..
C2 Spack v1.1+
This page exists to detail how a user would be able to use the RIS provided Spack installation under /opt/thpc to build their own custom software. The software can be stored in a user’s home2, a shared storage2, or a shared scratch2 location.
Initial Setup
Load modules
Connect to a RIS C2 Login node
ssh c2-login-001.ris.wustl.eduLoad the RIS domain module followed by the Spack module
module load ris module load spack/v1.1
Configuring Spack
Spack can be configured by end-users beyond what RIS has provided by default. This can be done by layering or entirely overwriting RIS configurations by writing out specific yaml files placed in $HOME/.spack/
For example to override modules configuration one would create a new modules.yaml file at $HOME/.spack/modules.yaml into which they can write their custom configuration(s).
To see the current full working configuration of Spack, including how any custom configuration has been layered, run the following:
spack config blameThe configuration output can be restricted to specific sections for modules or packages like so:
spack config blame modules
# or
spack config blame packagesSee all config sections available to print like so:
spack config blame --helpFor more information on Spack configuration scopes and how to use them please see the official documentation: https://spack.readthedocs.io/en/latest/configuration.html
Installing Software
Home Directory
home2 is limited in size to around 50GiB per user.
Without any additional configuration Spack will default to installing software and modules to a directory in a user’s home directory. This is the intended workflow for small incidental tools that do not necessitate the creation of an entire Spack Environment for reproduction and/or sharing purposes. Applications such as: tree, vim, gcc, miniconda, etc
Launch an interactive slurm job.
srun -A compute2-account -c 8 -p general-interactive --pty /bin/bashInstall a software of choice.
treeshown belowspack install treeAdd the modules to Lmod. Currently only
luabased modules are built by default.# lua modules module use $HOME/.spack/modules/lmod/CoreConfirm that you now see your modules displayed with
module avail.module avail treeused below. All dependencies hidden unless usingmodule --show_hidden avail
Shared Location - Informal
If intending to produce a set of packages via Spack that are to be shared and/or further modified by other members of a lab or some working group it is advised to utilize Spack Environments.
Such an environment can contain a grouping of packages distinct from those installed to a user’s home directory. With different, or even conflicting, requirements. Generally these environments are installed to RIS Storage or Scratch clusters.
storage2 or storage3 are recommended to hold user Spack environments due to storage retention policy
scratch2 can be used for increased performance but this requires routine rebuilds of software and/or modules due to the default retention policies on that location
storage1 can be used but is not recommended by RIS at this time.
Launch an interactive slurm job.
srun -A compute2-account -c 8 -p general-interactive --pty /bin/bashCreate a new directory on
storage2orstorage3to act as the root of the new Spack environment. This location should be owned and administered by you or your PI.mkdir -p /storageN/fs1/allocation_name/Active/spack/myenv1In the newly created directory for the Spack environment create the following child directories as well:
environment,software,modules,license,viewsmkdir -p /storageN/fs1/allocation_name/Active/spack/myenv1/{environment,software,modules,license,views}In the newly created
environmentdirectory now create thespack.yamlfile for the environment.vi /storageN/fs1/allocation_name/Active/spack/myenv1/environment/spack.yamlspack: specs: # List of all Spack software(s) and tweaks to be installed - gcc@15+binutils # latest GCC-15.x with GNU Assembler - tree # latest satisfiable version of tree - vim # latest satisfiable version of vim view: false config: install_tree: root: /storageN/fs1/allocation_name/Active/spack/myenv1/software/spack license_dir: /storageN/fs1/allocation_name/Active/spack/myenv1/licenses modules: default: roots: lmod: /storageN/fs1/allocation_name/Active/spack/myenv1/modules/spack lmod: # optionally add additional custom non-RIS compilers # RIS default is 'gcc' and will be appended core_compilers: []
Update the spack.yaml file to build your environment as needed:
spack.specs:update with a list of all the packages you wish to installspack.config.install_tree.root:update with the path to thesoftware/spackdirectory created for your environment in Step3spack.config.license_dir:update with the path to thelicensesdirectory created for your environment in Step3spack.modules.default.roots.lmod:update with the path to themodules/spackdirectory created for your environment in Step3Additional tweaks and changes not required but can be made as user needs demand
Add the new environment to your list of “tracked” Spack environments. Be sure to provide a
--name <name>value otherwise the directory abovespack.yamlwill set the name.spack env track --name myenv1 /storageN/fs1/allocation_name/Active/spack/myenv1/environmentInstall the newly configured Spack environment
Concretize the changes to
spack.yamlto build aspack.lockfile in the same directoryspack --env myenv1 concretize --fresh --forceInstall the software based on the generated
spack.lockfilespack --env myenv1 installRegenerate any modules if any currently exist as Spack will NOT overwrite them by default.
spack --env myenv1 module lmod refresh --delete-tree --yes-to-all
Add the newly built software to your Lmod modulepath and confirm it shows up now
module use /storageN/fs1/allocation_name/Active/spack/myenv1/modules/spack/CoreIf using a compiler other than that supplied by RIS you may see the
Coredirectory match the name and version of the compiler used to build the software. For examplegcc-15.1.0. To fix this you must add the compiler to the list ofcore_compilersin your environment config.
Domain Space - Formal
Formalized shared “domain spaces” can be setup for PIs, labs, or other working groups upon request. The purpose of which is to give groups a means to formally define and share software amongst themselves or other groups. These domain spaces are currently held under /opt/thpc and would include all modules, softwares, license files, and Spack configurations required to operate and/or reproduce the software contained within.
Once a domain is created PIs are encouraged to create as many Spack environments as needed following the pattern below.
/opt/thpc/linux/x86_64
├── ${DOMAIN_NAME}
│ └── ${ENV_NAME}
│ └── {environment,license,modules,software,views}
└── artsci # Domain name
└── x86_64 # Spack environment name
├── environment # contains `spack.yaml` and `spack.lock`
├── license # contains licenses in nested app dirs
├── modules
│ ├── spack # contains all modules produced by Spack
│ └── other # contains any modules NOT from Spack
├── software
│ ├── spack # Spack software install_root
│ └── other # software NOT from Spack but considered within this env
└── views # holds Spack views if enabledTo request a new domain be constructed or to update domain contact information please reach out to RIS Support.
Setup
Once a domain is created to hold your Spack environments we need a directory for each respective environment.
The following examples will assume that the domain is artsci, already exists, and that I am making an environment named myenv2. Please update the commands with your own relative paths as needed
Create the following locations for your domain specific Spack environment if they do not already exist.
config:environments_rootmkdir -p /opt/thpc/linux/x86_64/artsci/myenv2/environmentconfig:license_dirmkdir -p /opt/thpc/linux/x86_64/artsci/myenv2/licenseconfig:install_tree:rootmkdir -p /opt/thpc/linux/x86_64/artsci/myenv2/software/spackmodules:default:roots:lmodmkdir -p /opt/thpc/linux/x86_64/artsci/myenv2/modules/spack
Create a new
spack.yamlfile in the newly created environment directory. If you are updating an existing environment, you should modify the existingspack.yaml.vi /opt/thpc/linux/x86_64/artsci/myenv2/environment/spack.yamlspack: specs: # List of all Spack software(s) to be installed - gcc@15+binutils # latest GCC-15.x with GNU Assembler variant enabled - tree # latest satisfiable version of tree - vim # latest satisfiable version of vim view: false # disabled view generation by default for faster installation config: install_tree: root: /opt/thpc/linux/x86_64/artsci/myenv2/software license_dir: /opt/thpc/linux/x86_64/artsci/myenv2/licenses modules: default: roots: lmod: /opt/thpc/linux/x86_64/artsci/myenv2/modules/spack lmod: # optionally add additional custom non-RIS compilers # RIS default is 'gcc-13.4.0' and will be appended as 'gcc@=13.4.0' core_compilers: []
Update the spack.yaml file to build your environment as needed:
spack.specs:update with a list of all the packages you wish to installspack.config.install_tree.root:update with the path to thesoftware/spackdirectory created for your environment in Step3spack.config.license_dir:update with the path to thelicensesdirectory created for your environment in Step3spack.modules.default.roots.lmod:update with the path to themodules/spackdirectory created for your environment in Step3Additional tweaks and changes not required but can be made as user needs demand
To see the environment when you run
spack env listyou must add it to the tracked environments. Do not activate the environment after tracking it.# environment name defaults to dir name unless `--name <NAME>` provided spack env track --name myenv2 /opt/thpc/linux/x86_64/artsci/myenv2/environment
Interactive
Launch an interactive slurm job.
srun -A compute2-account -c 8 -p general-interactive --pty /bin/bashLoad the
risdomain andspackmodulesmodule load ris module load spack/v1.1Install the environment
Concretize the environment build a
spack.lockbased on any changes to thespack.yamlspack --env myenv2 concretize --fresh --forceInstall the environment as it has been concretized in
spack.lockspack --env myenv2 installRebuild any modules that already existed before reinstall.
spack --env myenv2 module lmod refresh --delete-tree --yes-to-all
Non-Interactive
Create
sbatchfile to run installation across nodes namedbatch-install.sh#!/bin/bash #SBATCH -A compute2-account #SBATCH --partition=general-cpu #SBATCH --nodes=8 #SBATCH --cpus-per-task=8 #SBATCH --time=12:00:00 module purge module load ris module load slurm/23.02.5 spack/v1.1 spack --env myenv2 concretize --fresh --force srun spack --env myenv2 install spack --env myenv2 module lmod refresh --delete-tree --yes-to-allExecute the
sbatchfilesbatch ./batch-install.sh
Repos
Spack has the concept of both local and remote repositories. In versions prior to 1.0 local was the only properly supported option. Following the release of Spack 1.0 the default is to use a Git based repository.
This has allowed for the decoupling of the default builtin Spack repository from the system installation of Spack. Such that each user of Spack now holds a local copy of the builtin package git repository in their home directory.
Meaning end-users can now easily directly edit their own local copy of a Spack package’s python install files with spack edit builtin.<package_name>
Adding a Repo
Adding a “Spack Repo” in this way will see all changes written to the “User Scoped Config” at $HOME/.spack/repos.yaml
For more information please see the Spack Documentation here: https://spack.readthedocs.io/en/v1.1.1/repositories.html#git-based-repositories
Builtin Repo
This “Spack Repo” is already be added by default when using the RIS Spack module.
Add the repository’s main branch via GitHub url
spack repo add --name myrepo https://github.com/spack/spack-packages.gitConfirm repo now shows up
spack repo listUpdate local cache as needed
spack repo update
RIS Remote Repo
The washu_it_ris “Spack monorepo” used in this example is already included by default when using the RIS Spack module.
Add the repository
spack repo add --name compute2-spack-packages https://github.com/washu-it-ris/compute2-spack-packages.git[gunnar@c2-login-001 ~]# spack repo add --name compute2-spack-packages https://github.com/washu-it-ris/compute2-spack-packages.git remote: Enumerating objects: 21, done. remote: Counting objects: 100% (21/21), done. remote: Compressing objects: 100% (17/17), done. remote: Total 21 (delta 1), reused 14 (delta 0), pack-reused 0 (from 0) ==> Added repo to config with name 'compute2-spack-packages'.Confirm repos now show up
spack repo list[gunnar@c2-login-001 ~]# spack repo list [+] washu_it_ris.ris v2.0 /root/.spack/package_repos/aozlvq7/repos/spack_repo/washu_it_ris/ris [+] washu_it_ris.artsci v2.0 /root/.spack/package_repos/aozlvq7/repos/spack_repo/washu_it_ris/artsci [+] builtin v2.2 /root/.spack/package_repos/fncqgg4/repos/spack_repo/builtin
Update a Repo
Sync Remote Changes
Update local per-user repo cache
spack repo update
Override default Branch
We will be using the builtin repository for this example. This allows a user to switch to newer or older instances of the default repo than is offered by RIS.
The same steps can be applied to any other repositories as needed.
Identify the current repository that you wish to redirect to another Git branch
spack repo list[gunnar@c2-login-001 ~]$ spack repo list [+] washu_it_ris.ris v2.0 /home/gunnar/.spack/package_repos/aozlvq7/repos/spack_repo/washu_it_ris/ris [+] washu_it_ris.artsci v2.0 /home/gunnar/.spack/package_repos/aozlvq7/repos/spack_repo/washu_it_ris/artsci [+] builtin v2.2 /home/gunnar/.spack/package_repos/fncqgg4/repos/spack_repo/builtinExamine the location and state of the configuration for the repository you wish to change the branch of
spack config blame repos[gunnar@c2-login-001 ~]$ spack config blame repos --- repos: /opt/thpc/linux/software/spack/v1.1/etc/spack/site/repos.yaml:3 compute2-spack-packages: /opt/thpc/linux/software/spack/v1.1/etc/spack/site/repos.yaml:4 git: https://github.com/washu-it-ris/compute2-spack-packages.git /opt/thpc/linux/software/spack/v1.1/etc/spack/site/repos.yaml:5 branch: main /opt/thpc/linux/software/spack/v1.1/etc/spack/defaults/base/repos.yaml:14 builtin: /opt/thpc/linux/software/spack/v1.1/etc/spack/defaults/base/repos.yaml:15 git: https://github.com/spack/spack-packages.git /opt/thpc/linux/software/spack/v1.1/etc/spack/defaults/base/repos.yaml:16 branch: releases/v2025.11Overwrite the configuration to use the newer
v2026.03.0branch from the upstream Spack project by setting new values in$HOME/.spack/repos.yamlvi ~/.spack/repos.yaml# ~/.spack/repos.yaml repos: builtin: branch: v2026.03.0If successful you should now see the branch value changed for the builtin repo
spack config blame repos[gunnar@c2-login-001 ~]$ spack config blame repos --- repos: /home/gunnar/.spack/repos.yaml:2 builtin: /home/gunnar/.spack/repos.yaml:3 branch: v2026.03.0 /opt/thpc/linux/software/spack/v1.1/etc/spack/defaults/base/repos.yaml:15 git: https://github.com/spack/spack-packages.git /opt/thpc/linux/software/spack/v1.1/etc/spack/site/repos.yaml:3 compute2-spack-packages: /opt/thpc/linux/software/spack/v1.1/etc/spack/site/repos.yaml:4 git: https://github.com/washu-it-ris/compute2-spack-packages.git /opt/thpc/linux/software/spack/v1.1/etc/spack/site/repos.yaml:5 branch: mainYou can now run the
spack repo updatecommand to sync up your local copyspack repo update[gunnar@c2-login-001 ~]$ spack repo update remote: Enumerating objects: 504631, done. remote: Counting objects: 100% (504631/504631), done. remote: Compressing objects: 100% (149596/149596), done. remote: Total 495928 (delta 212635), reused 494193 (delta 211290), pack-reused 0 (from 0) ==> builtin: Updated sucessfully. ==> compute2-spack-packages: Already up to date.
Edit a Package
Set the editor that you wish to use if you haven’t already
export EDITOR='vim'Edit the package with the syntax
<repo_name>.<package_name>matlab within the
builtinrepospack edit builtin.matlabmatlab within the
risrepospack edit washu_it_ris.ris.matlabmatlab within the
defaultrepo (first repo shown inspack repo list)spack edit matlab