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.

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.

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). Use the /g/data filesystem if you wish to run the binaries on the compute nodes.

mkdir -p /g/data/$PROJECT/$USER/spack/0.22
cd /g/data/$PROJECT/$USER/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!

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

This step needs to be carried out for any new login or new shell environment.

cd /g/data/$PROJECT/$USER/spack/0.22
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.

Create a Spack managed environment

git clone https://github.com/ACCESS-NRI/ACCESS-TEST.git
spack env create test ACCESS-TEST/spack.yaml

git clone https://github.com/ACCESS-NRI/ACCESS-TEST.git Cloning into 'ACCESS-TEST'... remote: Enumerating objects: 33, done. remote: Counting objects: 100% (33/33), done. remote: Compressing objects: 100% (20/20), done. remote: Total 33 (delta 12), reused 27 (delta 9), pack-reused 0 (from 0) Receiving objects: 100% (33/33), 15.92 KiB | 1.06 MiB/s, done. Resolving deltas: 100% (12/12), done. spack env create test ACCESS-TEST/spack.yaml ==> Created environment test in: /g/data/$PROJECT/$USER/spack/0.22/environments/test ==> Activate with: spack env -p activate test

Activate the environment

Activate the test Spack environment by running:

spack env activate -p test
spack env activate -p 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 test ==> 1 root specs - access-test@git.2025.04.000=2025.04.000 ==> 0 installed packages spack concretize -f --fresh ==> Concretized access-test@git.2025.04.000=2025.04.000 - ih4cowp access-test@git.2025.04.000=2025.04.000%intel@2021.10.0+mpi build_system=bundle arch=linux-rocky8-x86_64 - bcixn5z ^access-test-component@main%intel@2021.10.0~ipo+mpi build_system=cmake build_type=Release generator=make arch=linux-rocky8-x86_64 - rldyvqn ^cmake@3.24.2%intel@2021.10.0~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-rocky8-x86_64 - doeoclg ^gmake@4.4.1%intel@2021.10.0~guile build_system=generic arch=linux-rocky8-x86_64 - qg5spmh ^openmpi@4.1.5%intel@2021.10.0~atomics~cuda~cxx~cxx_exceptions~gpfs~internal-hwloc~internal-libevent~internal-pmix~java~legacylaunchers~lustre~memchecker~openshmem~orterunprefix~romio+rsh~singularity~static+vt+wrapper-rpath build_system=autotools fabrics=none romio-filesystem=none schedulers=none arch=linux-rocky8-x86_64 - 5elnsoi ^glibc@2.28%intel@2021.10.0 build_system=autotools arch=linux-rocky8-x86_64 ==> Updating view at /g/data/$PROJECT/$USER/spack/0.22/environments/test/.spack-env/view spack install ==> Installing glibc-2.28-5elnsoiqgcg5k5zmmwsp33bmnmaa3g5p [1/6] [+] /g/data/$PROJECT/$USER/spack/0.22/release/linux-rocky8-x86_64/intel-2021.10.0/glibc-2.28-5elnsoiqgcg5k5zmmwsp33bmnmaa3g5p ==> Installing cmake-3.24.2-vc4y4c64s55j5u6kp37ciw2hcghuxhhc [2/6] [+] /g/data/$PROJECT/$USER/spack/0.22/release/linux-rocky8-x86_64/intel-2021.10.0/cmake-3.24.2-vc4y4c64s55j5u6kp37ciw2hcghuxhhc ==> Installing openmpi-4.1.5-qg5spmhetxnuvtyi7nuobd3nv7zwnu5f [3/6] [+] /g/data/$PROJECT/$USER/spack/0.22/release/linux-rocky8-x86_64/intel-2021.10.0/openmpi-4.1.5-qg5spmhetxnuvtyi7nuobd3nv7zwnu5f ==> Installing gmake-4.4.1-j6yscmmcn3qws7n35klote7rivw7foa6 [4/6] [+] /g/data/$PROJECT/$USER/spack/0.22/release/linux-rocky8-x86_64/intel-2021.10.0/gmake-4.4.1-j6yscmmcn3qws7n35klote7rivw7foa6 ==> Installing access-test-component-main-bcixn5z6ou7vlnogzgyy5z23jb4qeunx [5/6] [+] /g/data/$PROJECT/$USER/spack/0.22/release/linux-rocky8-x86_64/intel-2021.10.0/access-test-component-main-bcixn5z6ou7vlnogzgyy5z23jb4qeunx ==> Installing access-test-git.2025.04.000_2025.04.000-ih4cowpiz2kv6tnz4rkualxuly54tizr [6/6] [+] /g/data/$PROJECT/$USER/spack/0.22/release/linux-rocky8-x86_64/intel-2021.10.0/access-test-git.2025.04.000_2025.04.000-ih4cowpiz2kv6tnz4rkualxuly54tizr

Info

The full output has been truncated for brevity.

Check installed packages

spack find
spack find ==> In environment test ==> 1 root specs [+] access-test@git.2025.04.000=2025.04.000 ==> installed packages -- linux-rocky8-x86_64 / intel@2021.10.0 ------------------------ access-test@git.2025.04.000=2025.04.000 access-test-component@main cmake@3.24.2 glibc@2.28 gmake@4.4.1 openmpi@4.1.5@1.5.6 ==> 6 installed packages

Cleanup

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 /g/data/$PROJECT/$USER/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

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


Last update: April 26, 2025