Buildspec Tutorial

Please proceed to Buildspec Overview to get an overview of how to write buildspecs. This section can be done on your workstation.

Tutorials Setup


The tutorial setup is required if you want to run buildspecs using the the compiler and spack schema.

To get started for this tutorial, you will need docker on your machine to pull the container. At NERSC, you can use podman or shifter to access the container, you will need to start an interactive shell.

docker pull
docker run -it /bin/bash --login

If you are using podman on Perlmutter, please do the following

mkdir -p $HOME/.config/containers
touch $HOME/.config/containers/storage.conf

Next add the following content in storage.conf:

  driver = "overlay"
  graphroot = "/tmp/<USER>/storage"
    size = ""
    remap-uids = ""
    remap-gids = ""
    ignore_chown_errors = "true"
    remap-user = ""
    remap-group = ""
    mount_program = "/usr/bin/fuse-overlayfs"
    mountopt = ""

Please update the path /tmp/<USER>/storage to your username.

Next, you can pull the container and run an interactive shell as follows

podman pull
podman run -it /bin/bash --login
shifter -E -- /bin/bash --login

We need to install buildtest and setup environment for this tutorial. We recommend you clone buildtest in your HOME directory. This can be done as follows:

cd ~
git clone
cd buildtest
source scripts/spack_container/

This container provides a software stack built with spack, you should see buildtest, spack and module command in your path. The configuration file used for this container is set via BUILDTEST_CONFIGFILE.

spack@ef50085c8a81:~/buildtest$ which spack

spack@ef50085c8a81:~/buildtest$ which buildtest

spack@ef50085c8a81:~/buildtest$ module --version

Modules based on Lua: Version 8.3  2020-01-27 10:32 -06:00
    by Robert McLay

(buildtest) spack@87354844bbf3:~/buildtest$ echo $BUILDTEST_CONFIGFILE