Skip to content

Danger

This page is tailored to experienced users and collaborators developing ACCESS models.
This step is not required if you only want to run a model. If you are looking for information on how to run a model, refer to the Run a Model section.

Tip

13/02/2026: ACCESS-NRI has migrated from Spack v0.22 to Spack v1.1. If you previously followed these instructions to set up Spack v0.22, you will need to repeat the setup process below to install Spack v1.1.

Set up Spack for building 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.

Installing Spack allows users to build ACCESS models directly from the source code, swap model components, and carry out development testing that involves modifying the source code.
After installing Spack, refer to the Build a model page for the next steps.

Prerequisites

  • NCI Account
    These instructions are tailored specifically for Gadi. To use Spack on Gadi, you need to Set Up your NCI Account.
  • Bash shell
    The following instructions must be run in a Bash shell, which is the default shell on Gadi. To check if you are using Bash, run:
    echo "$BASH_VERSION"
    
    If you see output (i.e. the Bash version), you are already in a Bash shell. If there is no output, start a Bash shell by running:
    bash
    

Set up Spack on Gadi

Tip

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

Create a directory for Spack

Create a directory on the filesystem where Spack will be installed (e.g. /g/data/$PROJECT/$USER/spack/1.1). Use the /g/data filesystem if you wish to run the binaries on the compute nodes.

mkdir -p /g/data/$PROJECT/$USER/spack/1.1
cd /g/data/$PROJECT/$USER/spack/1.1

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 https://github.com/ACCESS-NRI/spack.git --branch releases/v1.1
git clone https://github.com/ACCESS-NRI/spack-config.git --branch main
ln -s -r -v spack-config/v1.1/gadi/* spack/etc/spack/

Success

Your Spack setup is complete!

For instructions on how to build an ACCESS model using Spack, refer to Modify and build an ACCESS model's source code.

Enable Spack

Warning

For this step, it is recommended to use a new login Bash shell environment to avoid conflicting environment variables. Additionally, this step must be repeated for every new login or new shell session.

cd /g/data/$PROJECT/$USER/spack/1.1
module purge
. spack-config/spack-enable.bash

Warning

There is a space between the . and the path to the file, as we are sourcing the file.

Test Spack (OPTIONAL)

To test that your Spack installation works as expected, we will create an ACCESS-TEST environment and build the relevant packages (this will take approximately 30 minutes). Then, we will uninstall all the packages and remove the environment.

Clone a Spack environment

git clone https://github.com/ACCESS-NRI/ACCESS-TEST.git

Activate the environment

Activate the ACCESS-TEST Spack environment by running:

spack env activate -p ./ACCESS-TEST
spack env activate -p ./ACCESS-TEST

Compile packages

spack find
spack concretize -f --fresh
spack install

Warning

Some of the commands above might take several minutes to complete.

spack find ==> In environment </path/to/environment/ACCESS-TEST> ==> 1 root specs -- no arch / no compilers --------------------------------------- - access-test ==> 0 installed packages ==> 0 concretized packages to be installed (show with spack find -c) spack concretize -f --fresh ... ==> Concretized 1 spec: - <spec-id> access-test@<version-info><build-info> <architecture-info> - <spec-id> ^<spack-package>@<version-info><build-info> <architecture-info> ... - <spec-id> ^<spack-package>@<version-info><build-info> <architecture-info> spack install ... ==> Installing <spack-package><hash> [1/<N>] ... ==> Installing <spack-package><hash> [2/<N>] ... ==> Installing access-test-<version-info><hash> [<N>/<N>] ... ==> access-test: Successfully installed access-test-<version-info><hash> ... ==> Updating view at </path/to/ACCESS-TEST/.spack-env/view>

Info

The animation above is a generalised example of the expected output, shortened and modified for clarity. Your actual output might vary.

Check installed packages

spack find

spack find ==> In environment </path/to/environment/ACCESS-TEST> ==> 1 root specs -- no arch / no compilers --------------------------------------- [+] access-test -- <architecture-info> / <compilers-info> ----------------------- <spack-package>@<version-info> <spack-package>@<version-info> -- <architecture-info> / <compilers-info> ----------------------- <spack-package>@<version-info> <spack-package>@<version-info> <spack-package>@<version-info> ... ==> <N> installed packages ==> 0 concretized packages to be installed (show with spack find -c)

Info

The animation above is a generalised example of the expected output, shortened and modified for clarity. Your actual output might vary.

Cleanup

spack uninstall --remove --all
spack env deactivate
rm -rf ACCESS-TEST

Update Spack on Gadi

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

cd /g/data/$PROJECT/$USER/spack/1.1
git -C spack fetch --all -Pp
git -C spack reset --hard origin/releases/v1.1
git -C spack-config pull
. spack-config/spack-enable.bash
spack repo update

- https://spack.readthedocs.io/en/latest/