-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created 'Set up Spack for model builds' page inside 'Getting Started'
- Loading branch information
1 parent
545f223
commit bf7e614
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Set up Spack for model builds | ||
|
||
[Spack](https://spack.io/about/) is a build-from-source package manager, specifically designed to simplify the installation of scientific software on supercomputers. | ||
|
||
## Prerequisites | ||
To use _Spack_ on _Gadi_, you must have an NCI account.<br> | ||
For instructions on how to set up an account, refer to [Set Up your NCI Account](/getting_started/set_up_nci_account). | ||
|
||
## Set up Spack on Gadi | ||
|
||
### Create a directory for the Spack distribution | ||
|
||
!!! tip | ||
This step is optional, but it is recommended you have a selected directory where to keep your _Spack_ distribution. | ||
|
||
The complete _Spack_ distribution is approximately 120 MB in size. For this reason, we reccommend placing its directory somewhere in `/g/data`. An example can be `/g/data/$PROJECT/$USER/spack_distribution`. | ||
|
||
To create the directory mentioned above and navigate into it, run the following command: | ||
``` | ||
mkdir -p /g/data/$PROJECT/$USER/spack_distribution && cd $_ | ||
``` | ||
|
||
### Get Spack executable and configuration files | ||
|
||
To get the _Spack_ executable and configuration files, run the following commands to clone the respective GitHub repositories: | ||
|
||
``` | ||
git clone -c feature.manyFiles=true https://github.com/ACCESS-NRI/spack.git --branch releases/v0.22 --single-branch --depth=1 | ||
git clone https://github.com/ACCESS-NRI/spack-packages.git --branch main | ||
git clone https://github.com/ACCESS-NRI/spack-config.git --branch main | ||
``` | ||
|
||
### Link Spack configuration files | ||
|
||
To link the _Spack_ configuration files to the _Spack_ instance, run the following command: | ||
|
||
``` | ||
ln -s -r -v spack-config/v0.22/gadi/* spack/etc/spack/ | ||
``` | ||
|
||
!!! success | ||
Your _Spack_ setup is complete! | ||
|
||
### Test Spack | ||
|
||
To test _Spack_ we will create an environment (in this example it will be the on to build ACCESS-OM2 executables) and build the relevant packages. Then, we will uninstall all the packages and remove the environment. | ||
|
||
All the steps listed above can be performed by running the following commands (where `<spack_distribution_directory>` is the [directory for the Spack distribution](#create-a-directory-for-the-spack-distribution)): | ||
``` | ||
. <spack_distribution_directory>/spack-config/spack-enable.bash | ||
curl -L https://raw.githubusercontent.com/ACCESS-NRI/ACCESS-OM2/main/spack.yaml -o access-om2-spack.yaml | ||
spack env create access-om2 access-om2-spack.yaml | ||
spack env activate -p access-om2 | ||
spack find | ||
spack install --verbose | ||
spack find | ||
spack uninstall --remove --all -y | ||
spack env deactivate | ||
spack env rm access-om2 -y | ||
rm access-om2-spack.yaml | ||
``` | ||
|
||
### More information | ||
To know more about _Spack_ usage, please familiarise yourself with the [Basic Usage instructions](https://spack.readthedocs.io/en/latest/basic_usage.html) and [Environments](https://spack.readthedocs.io/en/latest/environments.html).<br> | ||
We also reccommend you check the [Spack 101 Tutorial](https://spack-tutorial.readthedocs.io/en/latest/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters