spack:

  view: false

  concretizer:
    reuse: False
    unify: False

  modules:
    default:
      'enable:': [lmod]
      lmod:
        defaults: [cray-mpich@8.1.17]
        core_compilers: [gcc@11.2.0]
        verbose: true
        hash_length: 0
        hierarchy: [mpi]
        projections: {}
        core_specs: []
        all:
          autoload: direct
          environment:
            set:
              ${PACKAGE}_ROOT: ${PREFIX}
          suffixes:
            +rocm: rocm
        py-warpx:
          suffixes:
            ^warpx dims=2: dims2
            ^warpx dims=3: dims3
            ^warpx dims=rz: dimsRZ
        visit:
          suffixes:
            ^vtk-m +rocm: rocm
        exclude_implicits: true
        include: [cray-mpich, autoconf, automake, cmake]
    prefix_inspections:
      lib64: [LD_LIBRARY_PATH]
      lib: [LD_LIBRARY_PATH]

  compilers:
  - compiler:
      spec: gcc@11.2.0
      paths:
        cc: gcc
        cxx: g++
        f77: gfortran
        fc: gfortran
      flags: {}
      operating_system: sles15
      target: any
      modules:
      - PrgEnv-gnu
      - gcc/11.2.0
      environment:
        unset:
        - XALT_OLCF
        - XL_LINKER
        - XALT_ETC_DIR
        remove_path:
          PATH: /sw/crusher/xalt/1.3.0/bin
          PYTHONPATH: /sw/crusher/xalt/1.3.0/site
          LD_LIBRARY_PATH: /sw/aaims/crusher/build/smartbench/lib
      extra_rpaths: []

  packages:
    all:
      require: "%gcc@11.2.0"
      compiler: [gcc@11.2.0]
      providers:
        blas: [openblas]
        lapack: [openblas]
        mpi: [cray-mpich]
        tbb: [intel-tbb]
        scalapack: [netlib-scalapack]
      target: [zen3]
      variants: +mpi
    tbb:
      require: "intel-tbb"
    binutils:
      variants: +ld +gold +headers +libiberty ~nls
    elfutils:
      variants: +bzip2 ~nls +xz
    hdf5:
      variants: +fortran +hl +shared
    libfabric:
      variants: fabrics=sockets,tcp,udp,rxm
    libunwind:
      variants: +pic +xz
    ncurses:
      require: "@6.3 +termlib"
    openblas:
      variants: threads=openmp
    python:
      require: "@3.7.15"
    trilinos:
      variants: +amesos +amesos2 +anasazi +aztec +belos +boost +epetra +epetraext
        +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu
        +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos
        +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long_long
    xz:
      variants: +pic
    mesa:
      version: [21.3.8]

    # FACILITY REQUESTED PREFERENCES
    petsc:
      variants: +batch
    parallel-netcdf:
      variants: +cxx +fortran +fpic
    netlib-scalapack:
      variants: +fpic
    netcdf-c:
      variants: ~hdf4 +mpi +parallel-netcdf +shared
    fftw:
      variants: precision=float,double,long_double
    darshan-runtime:
      variants: scheduler=slurm
    paraview:
      require: ~qt +osmesa
    visit:
      require: ~gui +osmesa

    # EXTERNALS
    cray-mpich:
      buildable: false
      externals:
      - spec: cray-mpich@8.1.17 %gcc@11.2.0
        prefix: /opt/cray/pe/mpich/8.1.17/ofi/gnu/9.1
        modules:
        - cray-mpich/8.1.17
        - libfabric/1.15.0.0
    libfabric:
      buildable: false
      externals:
      - spec: libfabric@1.15
        modules:
        - libfabric/1.15.0.0

    # ROCm
    comgr:
      buildable: false
      externals:
      - spec: comgr@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    hip-rocclr:
      buildable: false
      externals:
      - spec: hip-rocclr@5.4.0
        prefix: /opt/rocm-5.4.0/hip
        modules: [rocm/5.4.0]
    hipblas:
      buildable: false
      externals:
      - spec: hipblas@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    hipcub:
      buildable: false
      externals:
      - spec: hipcub@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    hipfft:
      buildable: false
      externals:
      - spec: hipfft@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    hipsparse:
      buildable: false
      externals:
      - spec: hipsparse@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    miopen-hip:
      buildable: false
      externals:
      - spec: hip-rocclr@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    miopengemm:
      buildable: false
      externals:
      - spec: miopengemm@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    rccl:
      buildable: false
      externals:
      - spec: rccl@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    rocblas:
      buildable: false
      externals:
      - spec: rocblas@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    rocfft:
      buildable: false
      externals:
      - spec: rocfft@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    rocm-clang-ocl:
      buildable: false
      externals:
      - spec: rocm-clang-ocl@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    rocm-cmake:
      buildable: false
      externals:
      - spec: rocm-cmake@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    rocm-dbgapi:
      buildable: false
      externals:
      - spec: rocm-dbgapi@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    rocm-debug-agent:
      buildable: false
      externals:
      - spec: rocm-debug-agent@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    rocm-device-libs:
      buildable: false
      externals:
      - spec: rocm-device-libs@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    rocm-gdb:
      buildable: false
      externals:
      - spec: rocm-gdb@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    rocm-opencl:
      buildable: false
      externals:
      - spec: rocm-opencl@5.4.0
        prefix: /opt/rocm-5.4.0/opencl
        modules: [rocm/5.4.0]
    rocm-smi-lib:
      buildable: false
      externals:
      - spec: rocm-smi-lib@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    hip:
      buildable: false
      externals:
      - spec: hip@5.4.0
        prefix: /opt/rocm-5.4.0
        modules: [rocm/5.4.0]
        extra_attributes:
          compilers:
            c: /opt/rocm-5.4.0/llvm/bin/clang++
            c++: /opt/rocm-5.4.0/llvm/bin/clang++
            hip: /opt/rocm-5.4.0/hip/bin/hipcc
        environment:
          set:
            MPICH_GPU_SUPPORT_ENABLED: 1
    llvm-amdgpu:
      buildable: false
      externals:
      - spec: llvm-amdgpu@5.4.0
        prefix: /opt/rocm-5.4.0/llvm
        modules: [rocm/5.4.0]
        extra_attributes:
          compilers:
            c: /opt/rocm-5.4.0/llvm/bin/clang++
            cxx: /opt/rocm-5.4.0/llvm/bin/clang++
    hsakmt-roct:
      buildable: false
      externals:
      - spec: hsakmt-roct@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
    hsa-rocr-dev:
      buildable: false
      externals:
      - spec: hsa-rocr-dev@5.4.0
        prefix: /opt/rocm-5.4.0/
        modules: [rocm/5.4.0]
        extra_atributes:
          compilers:
            c: /opt/rocm-5.4.0/llvm/bin/clang++
            cxx: /opt/rocm-5.4.0/llvm/bin/clang++
    roctracer-dev-api:
      buildable: false
      externals:
      - spec: roctracer-dev-api@5.4.0
        prefix: /opt/rocm-5.4.0
        modules: [rocm/5.4.0]
    roctracer-dev:
      buildable: false
      externals:
      - spec: roctracer-dev@5.4.0
        prefix: /opt/rocm-5.4.0
        modules: [rocm/5.4.0]
    rocprim:
      buildable: false
      externals:
      - spec: rocprim@5.4.0
        prefix: /opt/rocm-5.4.0
        modules: [rocm/5.4.0]
    rocrand:
      buildable: false
      externals:
      - spec: rocrand@5.4.0
        prefix: /opt/rocm-5.4.0
        modules: [rocm/5.4.0]
    hipsolver:
      buildable: false
      externals:
      - spec: hipsolver@5.4.0
        prefix: /opt/rocm-5.4.0
        modules: [rocm/5.4.0]
    rocsolver:
      buildable: false
      externals:
      - spec: rocsolver@5.4.0
        prefix: /opt/rocm-5.4.0
        modules: [rocm/5.4.0]
    rocsparse:
      buildable: false
      externals:
      - spec: rocsparse@5.4.0
        prefix: /opt/rocm-5.4.0
        modules: [rocm/5.4.0]
    rocthrust:
      buildable: false
      externals:
      - spec: rocthrust@5.4.0
        prefix: /opt/rocm-5.4.0
        modules: [rocm/5.4.0]
    rocprofiler-dev:
      buildable: false
      externals:
      - spec: rocprofiler-dev@5.4.0
        prefix: /opt/rocm-5.4.0
        modules:
        - rocm/5.4.0

  specs:
  # CPU
  - adios
  - alquimia
  - aml
  - amrex
  - arborx
  - archer
  - argobots
  - axom
  - bolt
  - butterflypack
  - cabana
  - caliper
  - chai ~benchmarks ~tests
  - charliecloud
  - conduit
  - datatransferkit
  - dyninst ^intel-tbb
  - ecp-data-vis-sdk +adios2 +ascent +cinema +darshan +faodel +hdf5 +paraview +pnetcdf ~sensei +sz ~unifyfs +veloc +visit +vtkm +zfp ~cuda ~rocm 
  - exaworks
  - flecsi
  - flit
  - flux-core
  - fortrilinos
  - gasnet
  - ginkgo
  - globalarrays
  - gmp
  - gotcha
  - h5bench
  - hdf5-vol-async
  - heffte +fftw
  - hpctoolkit
  - hpx max_cpu_count=512 networking=mpi
  - hypre
  - kokkos-kernels +openmp
  - kokkos +openmp
  - lammps
  - legion
  - libpressio +bitgrooming +bzip2 ~cuda ~cusz +fpzip +hdf5 +libdistributed +lua +openmp +python +sz +sz3 +unix +zfp +json +remote +netcdf
  - libquo
  - libunwind
  - loki
  - mercury
  - metall
  - mfem
  - mpark-variant
  - mpifileutils ~xattr
  - nccmp
  - nco
  - netlib-scalapack
  - nrm
  - omega-h
  - openmpi
  - openpmd-api
  - papi
  - papyrus
  - parsec ~cuda
  - pdt
  - petsc
  - phist
  - plasma
  - plumed
  - precice
  - pumi
  - py-cinemasci
  - py-jupyterhub
  - py-libensemble
  - py-petsc4py
  - py-warpx ^warpx dims=2
  - py-warpx ^warpx dims=3
  - py-warpx ^warpx dims=rz
  - qthreads scheduler=distrib
  - quantum-espresso
  - raja
  - rempi
  - slate ~cuda
  - stc
  - slepc
  - strumpack ~slate
  - sundials
  - superlu-dist
  - superlu
  - swig
  - swig@4.0.2-fortran
  - tasmanian
  - tau +mpi +python
  - trilinos +amesos +amesos2 +anasazi +aztec +belos +boost +epetra +epetraext
    +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu
    +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos
    +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long_long
  - turbine
  - umap
  - umpire
  - unifyfs
  - upcxx
  - variorum

  # no amdgpu_target
  - cabana +rocm ^kokkos +rocm amdgpu_target=gfx90a
  - hpctoolkit +rocm
  - tau +mpi +rocm

  # amdgpu_target=gfx90a
  - amrex +rocm amdgpu_target=gfx90a
  - arborx +rocm amdgpu_target=gfx90a
  - chai ~benchmarks +rocm amdgpu_target=gfx90a
  - ecp-data-vis-sdk +paraview +vtkm +rocm amdgpu_target=gfx90a
  - gasnet +rocm amdgpu_target=gfx90a
  - ginkgo +rocm amdgpu_target=gfx90a
  - heffte +rocm amdgpu_target=gfx90a
  - hpx max_cpu_count=512 +rocm amdgpu_target=gfx90a
  - hypre +rocm amdgpu_target=gfx90a
  - kokkos +rocm amdgpu_target=gfx90a
  - magma ~cuda +rocm amdgpu_target=gfx90a
  - mfem +rocm amdgpu_target=gfx90a
  - petsc +rocm amdgpu_target=gfx90a
  - raja ~openmp +rocm amdgpu_target=gfx90a
  - slate +rocm amdgpu_target=gfx90a
  - slepc +rocm amdgpu_target=gfx90a ^petsc +rocm amdgpu_target=gfx90a
  - strumpack ~slate +rocm amdgpu_target=gfx90a
  - sundials +rocm amdgpu_target=gfx90a
  - superlu-dist +rocm amdgpu_target=gfx90a
  - tasmanian ~openmp +rocm amdgpu_target=gfx90a
  - trilinos@13.4.0 +amesos +amesos2 +anasazi +aztec ~belos +boost +epetra +epetraext
    +ifpack ~ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu
    +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu ~stokhos +stratimikos
    +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long_long
    +rocm amdgpu_target=gfx90a
  - umpire +rocm amdgpu_target=gfx90a
  - upcxx +rocm amdgpu_target=gfx90a

  # INCLUDED IN ECP-DATA-VIS-SDK
  # - adios2
  # - ascent
  # - darshan-runtime
  # - darshan-util
  # - faodel
  # - hdf5 +fortran +hl +shared
  # - parallel-netcdf
  # - paraview
  # - sz
  # - veloc
  # - vtk-m
  # - vtk-m ~openmp ~rendering +rocm amdgpu_target=gfx90a
  # - zfp

  # CPU ERRORS
  # - bricks                # bricks
  # - dealii                # slepc
  # - geopm                 # geopm
  # - pruners-ninja         # pruners-ninja
  # - scr                   # scr
  # - stat                  # launchmon-master
  # - wannier90             # wannier90
  # -----
  # bricks: weak/args.h:14:8: error: 'size_t' does not name a type; VSBrick-7pt.py-Scalar-8x8x8-1:30:3: error: 'vfloat512' was not declared in this scope
  # geopm: configure: error: Failed to determine MPI Fortran build flags use --with-mpi-bin or --with-mpicxx or --disable-mpi
  # pruners-ninja: https://github.com/spack/spack/issues/32112
  # pruners-ninja: test/ninja_test_util.c:34: multiple definition of `a'
  # scr: CMake Error at cmake/SCR_DEPENDENCIES.cmake:10 (MESSAGE): Could not find MPI! Either add an MPI compiler to your path or force CMake
  # wannier90: ../comms.F90:1214:22: Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4)).

  # GPU ERRORS
  # - caliper +rocm amdgpu_target=gfx90a        # caliper
  # - papi +rocm amdgpu_target=gfx90a           # papi
  # ------
  # caliper: /usr/bin/ld: ../../libcaliper-serial.so.2.9.0: undefined reference to `hipKernelNameRef'
  # hpctoolkit: ChecksumError: sha256 checksum failed for /tmp/lpeyrala/spack-stage/spack-stage-a_d2qq9h/411d62544717873432c49ef45c7cb99cc5de2fb8.patch
  # papi: Fatal Error: File '/opt/rocm-5.4.0/llvm/include/omp_lib.mod' opened at (1) is not a GNU Fortran module file

  # SKIPPED
  # - catalyst                   # versions >= 5.7 are in paraview now
  # - gptune ~mpispawn            # hard openmpi dependency
  # - libnrm                     # hard mpich dependency
  # - nvhpc                      # not relevant on AMD GPU system