Customized Spack Configuration & Environment
The ARC Spack configuration aims to make installing software simple, so spack install
gmake
should, in many cases, just work!, and install software under your $HOME/.spack/
directory. However in most cases it is better to create and use a Spack environment fine-tuned to your preferences.
- You want to install different software to different locations (for example, you build software for two different projects, or research groups, and want to install some software to
/turbo/project1
and some to/turbo/project2
- You want to install a collection of software into a single tree, where said three has all the binaries, and alternative tree has all the libraries, etc.
- You have software built outside of Spack, and need Spack to build software on your external build, rather than its default approach for building each dependency package.
- You want to use different conventions for directory structure or module file names than the defaults set by ARC.
A Spack environment (https://spack.readthedocs.io/en/latest/environments.html) is a directory with a spack.
yaml
file that outlines software to build, and the configuration modifications to use while building it. To create and activate an environment.
$ module load spack
$ spack env create my-env
$ spack env activate my-env
By default, this environment will be identical to the ARC Spack configuration, i.e it will install software to your default location, but you could change this in the spack.yaml
file. For example:
spack:
config:
install_tree:
# install things into the `install` subdirectory of this environment: root: /path/to/install
# alternatively: install things into my project's /turbo/myproject1/software:
# root: /turbo/myproject1/software/my_project
# put modulefiles generated by Spack in this environment directory:
module_roots:
tcl: /path/to/install/modules
lmod: /path/to/install/lmod
view: /path/to/my_tree
specs: []
Additionally, If your software stack needs something that was installed external to Spack you can add a packages section, to account for it:
spack:
# [snip] packages:
# use the ncl from "module load ncl"
ncl:
externals:
- spec: [email protected]
modules: [ncl/6.5.0]
# use my local install of fftw 3.3.8, as the preferred fftw version:
fftw:
version: [3.3.8]
externals:
- spec: [email protected]
prefix: /path/to/my/fftw/install
For complete, comprehensive and further details about Spack environments, see https://spack.readthedocs.io/en/latest/environments.html