diff --git a/docs/getting_started/index.md b/docs/getting_started/index.md index 1703b8b13..21ed1d6e3 100644 --- a/docs/getting_started/index.md +++ b/docs/getting_started/index.md @@ -23,4 +23,15 @@ + +
+ spack +
+
+ Set up Spack for model builds + + Spack is a flexible package manager used to build ACCESS models. + +
+
diff --git a/docs/getting_started/spack.md b/docs/getting_started/spack.md new file mode 100644 index 000000000..58fc73bcb --- /dev/null +++ b/docs/getting_started/spack.md @@ -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.
+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 `` is the [directory for the Spack distribution](#create-a-directory-for-the-spack-distribution)): +``` +. /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).
+We also reccommend you check the [Spack 101 Tutorial](https://spack-tutorial.readthedocs.io/en/latest/). \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 3b61a706d..ecdd3bcdb 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -77,6 +77,7 @@ markdown_extensions: - pymdownx.mark - pymdownx.tilde - pymdownx.snippets + - pymdownx.highlight - pymdownx.emoji: emoji_index: !!python/name:materialx.emoji.twemoji emoji_generator: !!python/name:materialx.emoji.to_svg @@ -98,6 +99,7 @@ nav: - getting_started/index.md - Set Up your NCI Account: getting_started/set_up_nci_account.md - Australian Research Environment (ARE): getting_started/are.md + - Set up spack for model builds: getting_started/spack.md - Models: - Models: models/index.md