Putting it all together¶
You should now have your five configuration YAML files in one directory:
This is now your personal "custom configuration scope".
To use it we suggest you request an
interactive qlogin
session
with fairly decent resources:
qlogin -pe smp 8 -l h_rt=24:0:0 -l h_vmem=2G
Once on a compute node, load a Spack module. I will use 0.23.1
as the above configuration files were written for it:
Clear any existing ${HOME}/.spack
directory when upgrading Spack
If you have previously followed this tutorial for an older version of Spack
such as v0.22.0
, you will have an existing hidden ${HOME}/.spack
directory containing files linked to it. When moving to a newer version of
Spack, you must remove this directory first:
rm -rf ${HOME}/.spack
Once you have upgraded to a new release, it is best to never go back to using an older one.
module load spack/0.23.1
Use the Spack modules
Please try to avoid cloning your own version of Spack from GitHub as per the official Spack documentation. Using a module instead means you will use a version we have tested extensively on Apocrita, which may not be the case when cloning via GitHub. Sometimes configuration options change between versions and adjustments would need to be made.
To use your custom configuration scope, you need to pass the path to it via the
-C
flag to all Spack commands. For example, assuming you have cloned the
spack-config-templates
into your home directory:
spack -C ${HOME}/spack-config-templates/0.23.1 find -x -p
That tells Spack to reference your custom configuration scope and merge it with
the defaults as appropriate, and then show all
explicitly installed
packages (-x
) along with their location (-p
):
$ spack -C ${HOME}/spack-config-templates/0.23.1 find -x -p
-- linux-rocky9-x86_64_v4 / gcc@11.4.1 --------------------------
gcc@12.2.0 /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/gcc/12.2.0-6frskzg
-- linux-rocky9-x86_64_v4 / gcc@12.2.0 --------------------------
ant@1.10.14 /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-12.2.0/ant/1.10.14-gvqgwtj
(etc.)
You'll notice that all listed packages are stored in
/share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4
- this is because they
come from the upstreams.yaml
file.