Creating and activating your Spack environment¶
As before, we suggest you use an
interactive qlogin
session
to create and activate your Spack environment.
Once on a compute node, load a Spack module (module load spack/<version>
), and
then activate the Spack environment using:
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.
Avoid the spacktivate
command
You should always try to use spack env activate
rather than the alias
spacktivate
for activating your personal Spack environments. spacktivate
is a bash alias and these won’t work in non-interactive bash environments
(such as job scripts for example), so
best to avoid using it.
spack env activate -p /data/scratch/${USER}/spack-environments/spack-cmake
The -p
flag will once again prepend the name of the activated environment to
your prompt in square brackets:
[spack-cmake] [abc123@ddy123 ~]$