# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

spack:
  specs:
  - palace@develop+libxsmm+superlu-dist+mumps+sundials+strumpack+slepc+arpack+gslib
  view: false
  config:
    install_tree:
      root: $HOME/opt/spack
      # Padding supports buildcache relocation.
      padded_length: 256
  concretizer:
    reuse: false
    unify: true
  packages:
    # Build the entire library DAG with one C++ ABI and Fortran runtime.
    c:
      require: ["gcc"]
    cxx:
      require: ["gcc"]
    fortran:
      require: ["gcc"]
    petsc:
      require: ~hdf5
    mpi:
      require: openmpi
    # Spack's variant optimization otherwise prefers OpenMPI 2.1.6, which does
    # not build with the current macOS assembler.
    openmpi:
      require: "@5:"
    blas:
      require: openblas
    lapack:
      require: openblas
    # METIS builds shared objects and therefore requires position-independent
    # code.
    metis:
      require: cflags=-fPIC cppflags=-fPIC
    # Homebrew provides gmake and gsed, while Spack expects make and sed. Let
    # Spack build both tools instead of adding links or changing PATH. GNU Make
    # also needs C17 because C23 breaks its bundled fnmatch.c.
    gmake:
      require: cflags=-std=gnu17
    mfem:
      require: "+exceptions"
