Loading Spack Installed Software

Default Spack Installations

If you specified a view, you can point your $PATH$LD_LIBRARY_PATH, etc to the view. If you did not, you can use  $ module load to load individual packages into your environment, ready to use. Note, have to load the Spack module first as a dependency.

$ module load spack boost

To learn more about Spack views see (https://spack.readthedocs.io/en/latest/packaging_guide.html#views). Spack modules are made available through Lmod (https://lmod.readthedocs.io/en/latest) which is an environment management system. For example, by default, Spack software is installed to ~/.spack/opt and the module files are saved in ~/.spack/share/lmod. Therefore, configure Lmod such that it can see module files located at this location, you have to prepend to your $MODULEPATH the exact path where your module files are saved.
This prepending is already done automatically when you load the Spack module. Below is an explanation of how this is done. If you’re install Spack software at it’s default location, then you DO NOT have to perform these steps. However, If you’re installing software in a custom location, such as a Turbo volume, then the following guide could be useful.

Configuring Lmod to View Spack Modules Installed in Non-Default Locations

For example, consider software installed at <code>/turbo/myproject1/software/my_project</code> Given a directory tree structure as:

To make packages built by the gcc compiler, version 10.3.0 available through the module system, prepend to $MODULEPATH 

/turbo/myproject1/software/my_project/share/spack/lmod/linux-rhel8-x86_64/gcc/10.3.0

In addition, make packages built by the gcc compiler, version 13.2.0 available through the module system, prepend to $MODULEPATH 

/turbo/myproject1/software/my_project/share/spack/lmod/linux-rhel8-x86_64/gcc/13.2.0

$ export MODULEPATH=/turbo/myproject1/software/my_project/share/spack/lmod/linux-rhel8-x86_64/gcc/10.3.0:$MODULEPATH
$ export MODULEPATH=/turbo/myproject1/software/my_project/spack/lmod/linux-rhel8-x86_64/gcc/13.2.0:$MODULEPATH

Verify Result:
$ module avail
-------------------- /turbo/myproject1/software/my_project/share/spack/lmod/linux-rhel8-x86_64/gcc/13.2.0 --------------------

boost/1.83.0-uejfb3g gcc-runtime/13.2.0-msqwczb (D)

-------------------- /turbo/myproject1/software/my_project/share/spack/lmod/linux-rhel8-x86_64/gcc/10.3.0 --------------------

gcc-runtime/10.3.0-pglmvn4 gmake/4.4.1-tdqh6jn