Skip to content

Commit

Permalink
getting_started/spack.md: show how to update the Spack instance
Browse files Browse the repository at this point in the history
* Create directories to support multiple versions of Spack.
* Clone Spack with full context.
  • Loading branch information
harshula committed Oct 1, 2024
1 parent 17b5824 commit 869c10e
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions docs/getting_started/spack.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Set up Spack for building ACCESS models

!!! info
Last updated: 30/09/2024

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

Expand All @@ -15,19 +18,25 @@ These instructions are tailored specifically for _Gadi_. To use _Spack_ on _Gadi

## Set up Spack on Gadi

!!! warning
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/<myspack>`). This directory shall be referred to as `<myspack>`.
Create a directory on the filesystem where _Spack_ will be installed (e.g. `/g/data/$PROJECT/$USER/spack/0.22`).

```
mkdir <myspack>
cd <myspack>
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 --single-branch --depth=100
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
```
Expand All @@ -47,7 +56,7 @@ To test _Spack_ we will create an `ACCESS-TEST` environment and build the releva

```
module purge
cd <myspack>
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
Expand All @@ -61,3 +70,15 @@ 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
```

0 comments on commit 869c10e

Please sign in to comment.