Skip to content

Set up Spack for building ACCESS models

Danger

This page is tailored to experienced users and collaborators developing ACCESS models.

Spack is a build-from-source package manager, specifically designed to simplify the installation of scientific software on supercomputers.

To use Spack, please familiarise yourself with the Basic Usage instructions and Environments.

We also recommend that you refer to the Spack 101 Tutorial.

Prerequisites

These instructions are tailored specifically for Gadi. To use Spack on Gadi, you must have an NCI account. For instructions on how to set up an account, refer to Set Up your NCI Account.

Set up Spack on Gadi

Tip

The steps in this section only need to be done once.

Create a directory for Spack

Create a directory on the filesystem where Spack will be installed (e.g. /g/data/$PROJECT/$USER/spack/0.22).

mkdir -p spack/0.22
cd spack/0.22

Clone the relevant git repositories

Info

ACCESS-NRI maintains a fork of Spack to enable back-porting fixes from more recent spack versions. This fork is the one used in these instructions.

git clone -c feature.manyFiles=true https://github.com/ACCESS-NRI/spack.git --branch releases/v0.22
git clone https://github.com/ACCESS-NRI/spack-packages.git --branch main
git clone https://github.com/ACCESS-NRI/spack-config.git --branch main
ln -s -r -v spack-config/v0.22/gadi/* spack/etc/spack/

Success

Your Spack setup is complete!

Test Spack (OPTIONAL)

To test Spack we will create an ACCESS-TEST environment and build the relevant packages. Then, we will uninstall all the packages and remove the environment.

module purge
cd spack/0.22
. spack-config/spack-enable.bash
git clone https://github.com/ACCESS-NRI/ACCESS-TEST.git
spack env create test ACCESS-TEST/spack.yaml
spack env activate -p test
spack find
spack concretize -f --fresh
spack install --verbose
spack find
spack uninstall --remove --all
spack env deactivate
spack env rm test
rm -rf ACCESS-TEST

Update Spack on Gadi

Keep your Spack instance up-to-date by doing the following:

cd spack/0.22
git -C spack fetch --all -Pp
git -C spack reset --hard origin/releases/v0.22
git -C spack-config pull
git -C spack-packages pull

Last update: October 16, 2024