-
Notifications
You must be signed in to change notification settings - Fork 23
Maintaining Spack Buildcache
Matthew Thompson edited this page Sep 9, 2025
·
18 revisions
This page details the efforts to create a buildcache for use in Spack CI tests in MAPL.
Testing showed we apparently need to increase the length of the padding in the install tree. This is what I ran:
spack config add config:install_tree:padded_length:256
My current packages.yaml is set as:
packages:
gcc:
externals:
- spec: gcc@13.3.0 languages='c,c++,fortran'
prefix: /usr
extra_attributes:
compilers:
c: /usr/bin/gcc
cxx: /usr/bin/g++
fortran: /usr/bin/gfortran
flags: {}
environment: {}
extra_rpaths: []
- spec: gcc@14.2.0 languages='c,c++,fortran'
prefix: /usr
extra_attributes:
compilers:
c: /usr/bin/gcc-14
cxx: /usr/bin/g++-14
fortran: /usr/bin/gfortran-14
flags: {}
environment: {}
extra_rpaths: []
buildable: false
all:
require: target=x86_64_v3
providers:
mpi: [openmpi, intel-oneapi-mpi]
blas: [openblas, intel-oneapi-mkl]
lapack: [openblas, intel-oneapi-mkl]
gcc:
buildable: false
openmpi:
require:
- any_of: ['%gcc']
message: Only use Open MPI with GCC
intel-oneapi-mpi:
require:
- any_of: ['%oneapi']
message: Only use Intel MPI with Intel
hdf5:
variants: +fortran +szip +hl +threadsafe +mpi
# Note that cdo requires threadsafe, but hdf5 doesn't
# seem to want that with parallel. Hmm.
netcdf-c:
variants: +dap
esmf:
variants: ~pnetcdf ~xerces
cdo:
variants: ~proj ~fftw3
# cdo wanted a lot of extra stuff for proj and fftw3. Turn off for now
pflogger:
variants: +mpi
pfunit:
variants: +mpi +fhamcrest
fms:
require: '@2024.03 ~gfs_phys +pic constants=GEOS precision=32,64 +deprecated_io ~yaml target=x86_64_v3'
# NOTE: I have to re-add the target here otherwise spack seemed to not build for a generic processor
mapl:
variants: +extdata2g +fargparse +pflogger +pfunit ~pnetcdfSpack is now split with packages in a separate repo. To be consistent, we manually
clone and put it in a place easy to maintain. As such, our repos.yaml is:
repos:
builtin:
git: git@github.com:spack/spack-packages.git
destination: /home/ubuntu/spack-packages
geosesm: /home/ubuntu/geosesm-spackWe want all the dependencies of GEOS, so we need to do:
spack install --only dependencies mapl
spack install mepo openblas fms@2024.03
This (should) get us everything that MAPL and GEOS needs to build.
It turns out, you can't build or push a buildcache unless you are in a Spack environment. So we need to create one:
spack env create geos-buildcache
spack env activate -p geos-buildcache
spack install --add esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits mepo openblas fms@2024.03
spack concretize -f
spack mirror add --oci-username mathomp4 --oci-password-variable GEOS_BUILDCACHE_TOKEN --unsigned geos-buildcache oci://ghcr.io/GEOS-ESM/geos-buildcache
spack buildcache push --update-index oci://ghcr.io/GEOS-ESM/geos-buildcache