The spack.yaml file¶
Environment files must be called spack.yaml
You must save your environment files using the exact name spack.yaml
,
otherwise Spack will throw an error.
Spack environments are defined using a spack.yaml
file. This may be fairly
familiar if you have previously used a
Conda environment.yaml
file.
In fact, the official Spack documentation contains a
useful comparison section.
However, whereas a Conda environment will install the actual binaries and shared libraries to disk inside each environment, Spack environments can leverage an upstream location and then merely create symlinks to existing applications and libraries, which reduces disk usage and reduces the need to constantly install and reinstall the same packages over and over again.
A spack.yaml
file essentially contracts all the individual configuration YAML
files from a custom Spack configuration scope
(i.e. compilers.yaml
, config.yaml
, modules.yaml
etc.) into one single
file (spack.yaml
). What were individual YAML files now become sections
(compilers
, config
, modules
etc.) of a single spack.yaml
file.
Example spack.yaml files¶
Example spack.yaml
files can be found in our
spack-config-templates
repository
inside the environment-templates
sub-directory. There is a directory per Spack
release (e.g. 0.23.1
) - please use the templates that match the version of
Spack you are using, as the requirements for spack.yaml
files can change
between Spack releases. The tutorials that follow use Spack 0.23.1
and the
example environment files and Spack output for each section reflect this.
You should grab each YAML file (or copy and paste its contents) and make sure it
is saved as spack.yaml
inside the directory you then want to use to store the
environment.
Please note, access to the above repository is for QMUL internal users only
(i.e. those with an account attached to a qmul.ac.uk
email address). External
users will need to
raise a ticket with the ITSR
support team and we can copy template config files to your personal Apocrita
storage for you.