To get started, first thoroughly study and review the official Spack documentation (https://spack.readthedocs.io/en/latest/).
Once familiar with the official Spack documentation, login to our HPC cluster. ARC Spack is provided as a cluster-wide software, available through our module system.
$ module load spack
Once loaded, that’s it! Spack’s setup script is sourced into your linux environment, allowing you to use Spack through the terminal. You can test that Spack is available by entering $ spack
or $ echo $SPACK_ROOT
ARC Spack is configured save all custom configurations, environments, software installations (binaries, scripts, source code), and generated module files into your home directories (~/.spack) folder. If this folder does not exist, it’s automatically created. Deletion of this folder results in all custom configurations, environments, and software’s installed being permanently deleted.
The spack
command has many subcommands. You’ll only need a small subset of them for typical usage. To view a list of out-of-box software available for installation run the command
$ spack list
To get more information on a particular package from the Spack list, use Spack info and Spack spec to show the dependencies, and variants enabled by default. The example below illustrates with gmake.
$ spack info gmake
Package: gmake Description: GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files. Homepage: https://www.gnu.org/software/make/ Preferred version: 4.4.1 https://ftpmirror.gnu.org/make/make-4.4.1.tar.gz Safe versions: 4.4.1 https://ftpmirror.gnu.org/make/make-4.4.1.tar.gz 4.4 https://ftpmirror.gnu.org/make/make-4.4.tar.gz 4.3 https://ftpmirror.gnu.org/make/make-4.3.tar.gz 4.2.1 https://ftpmirror.gnu.org/make/make-4.2.1.tar.gz 4.0 https://ftpmirror.gnu.org/make/make-4.0.tar.gz Deprecated versions: None Variants: build_system [generic] generic Build systems supported by the package guile [false] false, true Support GNU Guile for embedded scripting Build Dependencies: guile pkgconfig Link Dependencies: guile Run Dependencies: None Licenses: GPL-3.0-only
$ spack spec gmake
Input spec -------------------------------- - gmake Concretized -------------------------------- [+] [email protected]%[email protected]~guile build_system=generic arch=linux-rhel8-skylake_avx512 [+] ^[email protected]%[email protected] build_system=generic arch=linux-rhel8-skylake_avx512
The spec command shows that gmake has only one dependency, and that is the gcc-runtime libraries.
To install $ spack install gmake
. To uninstall $ spack uninstall gmake
All Spack installed software automatically integrates with the system’s Lmod module system. Which means you can load Spack software in one of two ways.
$ spack load
gmake
or $ module load gmake
. Strongly preferred to use $ module load
To verify the software is loaded correctly, and the correct (spack installed version is being used), you can run the following commands:
$ which gmake ~/.spack/opt/spack/gmake-4.4.1-qpr6-gcc-13.2.0/bin/gmake
Note: Every time you intend to load Spack installed software, the Spack module must be loaded as well. Spack installed software are appended to your linux environment only If Spack is available, therefore it’s imperative and important that Spack be loaded as a module dependency.
That’s it! gmake is now available for use.