Spack is a tool from Lawrence Livermore National Labs for managing scientific research applications, packages and libraries. This is the description from the Spack page,
"Spack is a package manager for supercomputers, Linux, and macOS. It makes installing scientific software easy. With Spack, you can build a package with multiple versions, configurations, platforms, and compilers, and all of these builds can coexist on the same machine."
Review the documentation and tutorials at the Spack web site for more detailed information.
In Research Computing we have installed Spack at /software/spack/latest. Many of the software modules provided on the Coeus cluster were built using Spack in a specific PDX environment.
We have provided a spack module if there are unique software packages needed for your research project(s). Using the spack module is far preferable to downloading and building an entire Spack clone in your home directory.
The Spack module provides Spack v1.1.1 (currently) and many packages. Use it as you would any other software module.
$ module load spack
Using the module will set up variables and configuration files to incorporate pre-built packages and to allow independent installation of packages unique to your project. When using Spack through the provided module, the Spack configuration is automatically loaded. This configuration can be found in the directory /software/spack/defaults/config/.
This will configure Spack to see the “upstream” Spack packages, which are installed at the cluster level, and available to all users as modules. This way, dependencies that are already installed on the cluster do not need to be re-installed in your Spack environment.
Spack packages that you install will be installed in your home directory, under ~/.spack/.
Use the find command to see if a package already exists that you can load and run (hdf5 in this example.
$ spack find hdf5
-- linux-rocky9-x86_64_v3 / %c=gcc@12.5.0 -----------------------
hdf5@1.14.6
-- linux-rocky9-x86_64_v3 / %c=gcc@13.4.0 -----------------------
hdf5@1.14.6
==> 2 installed packages
From there you can add hdf5 for use with the load command.
$ spack load hdf5@13.4.0
As an example, we can install NetCDF, which is commonly used in climate research. Use the list command to list the available NetCDF packages in Spack.
$ spack list netcdf
netcdf-c netcdf-cxx4 netcdf95 pdiplugin-decl-netcdf py-netcdf4
netcdf-cxx netcdf-fortran parallel-netcdf py-h5netcdf
==> 9 packages
It is best to use an environment within your Spack install, which will group project-specific packages together. This way, you can use the same Spack installation for multiple projects.
spack env create myproject
spack env activate myproject
Now, we can add the NetCDF packages to the environment and install them by running:
$ spack add netcdf-c netcdf-cxx netcdf-fortran
$ spack install
Run spack find again and you should see the NetCDF packages and their dependencies, installed into ~/.spack/opt.