Setting up Spack¶
Setting up Spack on a given machine should be a one-time process, and ideally shouldn’t be specific to the codes you’re planning to build.
Note
In practice you might want to set up multiple compilers etc, and then have certain projects build using some specific compiler, and so on. Spack allows you to specify details like this when installating a package, but it might be useful to use Spack environments so that you don’t have to remember to keep specifying those details over and over again.
Installing Spack¶
Follow the instructions from the Spack Documentation.
$ git clone -b releases/v0.14 https://github.com/spack/spack.git
Note
v0.14 is the latest spack stable version on 2020-03-17; newer versions will likely work but have not been tested. Using the default ‘develop’ branch is not recommended, as it does break sometimes and introduces a lot of package version churn if you try to track it.
Enable shell support for Spack.
# For bash/zsh users
$ export SPACK_ROOT=/path/to/spack
$ . $SPACK_ROOT/share/spack/setup-env.sh
# For tcsh or csh users (note you must set SPACK_ROOT)
$ setenv SPACK_ROOT /path/to/spack
$ source $SPACK_ROOT/share/spack/setup-env.csh
Cloning the WDMapp-config
repository¶
Just clone the repository from github to the same machine that you just set up Spack on.
$ git clone https://github.com/wdmapp/wdmapp-config
Adding the WDMapp package repo to Spack¶
This will let Spack search the WDMapp repository for packages that aren’t found in its builtin package repository.
$ spack repo add path/to/wdmapp-config/spack/wdmapp
==> Added repo with namespace 'wdmapp'.
Note
To update the wdmapp package repository to the latest, just run git
pull
in the directory where you cloned wdmapp-config/
.