# spack commit = e4s-22.02
#
# builds OK, as of 2022-04-14 0800:
#  cpu_specs: 91/104
#  rocm_specs: 14/15 w/ rocm 5.1.0 (15/15 w rocm 4.5.2)
#
# inherent conflicts:
#  (1) libnrm (cray-mpich)
#
# skipped for Crusher:
#  (3) flux-core, nvhpc, openmpi
#
# common failures:
#  (7) language/compile opts: catalyst, geopm, loki, mercury, plumed, variorum, wannier90

spack:
  view: false
  concretization: separately
  config:
    concretizer: clingo
    module_roots:
      lmod: ${SPACK_ROOT}/modules/lmod
  include:
  - modules.yaml

  compilers:
  - compiler:
      spec: gcc@11.2.0
      paths:
        cc: cc
        cxx: CC
        f77: ftn
        fc: ftn
      flags: {}
      operating_system: sles15
      target: any
      modules:
      - PrgEnv-gnu
      - gcc/11.2.0
      environment: {}
      extra_rpaths: []
  packages:
    all:
      compiler:
      - gcc@11.2.0
      providers:
        blas:
        - openblas
        mpi:
        - cray-mpich
      target:
      - x86_64
      variants: +mpi
    binutils:
      variants: +ld +gold +headers +libiberty ~nls
      version: [2.36.1]
    doxygen:
      version: [1.8.20]
    elfutils:
      variants: +bzip2 ~nls +xz
    hdf5:
      variants: +fortran +hl +shared
      version: [1.10.7]
    libfabric:
      buildable: false
      externals:
      - spec: libfabric@1.15
        modules:
        - libfabric/1.15.0.0
    libunwind:
      variants: +pic +xz
    mesa:
      variants: ~llvm
    mesa18:
      variants: ~llvm
    mpich:
      variants: ~wrapperrpath
    ncurses:
      variants: +termlib
    openblas:
      variants: threads=openmp
    python:
      version: [3.8.12]
    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
    cray-mpich:
      buildable: false
      externals:
      - spec: cray-mpich@8.1.12 %gcc@11.2.0
        prefix: /opt/cray/pe/mpich/8.1.12/ofi/gnu/9.1
        modules:
        - cray-mpich/8.1.12
        - libfabric/1.15.0.0
    comgr:
      buildable: false
      externals:
      - spec: comgr@5.1.0
        prefix: /opt/rocm-5.1.0/
    hip-rocclr:
      buildable: false
      externals:
      - spec: hip-rocclr@5.1.0
        prefix: /opt/rocm-5.1.0/hip
    hipblas:
      buildable: false
      externals:
      - spec: hipblas@5.1.0
        prefix: /opt/rocm-5.1.0/
    hipcub:
      buildable: false
      externals:
      - spec: hipcub@5.1.0
        prefix: /opt/rocm-5.1.0/
    hipfft:
      buildable: false
      externals:
      - spec: hipfft@5.1.0
        prefix: /opt/rocm-5.1.0/
    hipsparse:
      buildable: false
      externals:
      - spec: hipsparse@5.1.0
        prefix: /opt/rocm-5.1.0/
    miopen-hip:
      buildable: false
      externals:
      - spec: hip-rocclr@5.1.0
        prefix: /opt/rocm-5.1.0/
    miopengemm:
      buildable: false
      externals:
      - spec: miopengemm@5.1.0
        prefix: /opt/rocm-5.1.0/
    rccl:
      buildable: false
      externals:
      - spec: rccl@5.1.0
        prefix: /opt/rocm-5.1.0/
    rocblas:
      buildable: false
      externals:
      - spec: rocblas@5.1.0
        prefix: /opt/rocm-5.1.0/
    rocfft:
      buildable: false
      externals:
      - spec: rocfft@5.1.0
        prefix: /opt/rocm-5.1.0/
    rocm-clang-ocl:
      buildable: false
      externals:
      - spec: rocm-clang-ocl@5.1.0
        prefix: /opt/rocm-5.1.0/
    rocm-cmake:
      buildable: false
      externals:
      - spec: rocm-cmake@5.1.0
        prefix: /opt/rocm-5.1.0/
    rocm-dbgapi:
      buildable: false
      externals:
      - spec: rocm-dbgapi@5.1.0
        prefix: /opt/rocm-5.1.0/
    rocm-debug-agent:
      buildable: false
      externals:
      - spec: rocm-debug-agent@5.1.0
        prefix: /opt/rocm-5.1.0/
    rocm-device-libs:
      buildable: false
      externals:
      - spec: rocm-device-libs@5.1.0
        prefix: /opt/rocm-5.1.0/
    rocm-gdb:
      buildable: false
      externals:
      - spec: rocm-gdb@5.1.0
        prefix: /opt/rocm-5.1.0/
    rocm-opencl:
      buildable: false
      externals:
      - spec: rocm-opencl@5.1.0
        prefix: /opt/rocm-5.1.0/opencl
    rocm-smi-lib:
      buildable: false
      externals:
      - spec: rocm-smi-lib@5.1.0
        prefix: /opt/rocm-5.1.0/
    hip:
      buildable: false
      externals:
      - spec: hip@5.1.0
        prefix: /opt/rocm-5.1.0/hip
        extra_attributes:
          compilers:
            c: /opt/rocm-5.1.0/llvm/bin/clang++
            c++: /opt/rocm-5.1.0/llvm/bin/clang++
            hip: /opt/rocm-5.1.0/hip/bin/hipcc
    llvm-amdgpu:
      buildable: false
      externals:
      - spec: llvm-amdgpu@5.1.0
        prefix: /opt/rocm-5.1.0/llvm
        extra_attributes:
          compilers:
            c: /opt/rocm-5.1.0/llvm/bin/clang++
            cxx: /opt/rocm-5.1.0/llvm/bin/clang++
    hsakmt-roct:
      buildable: false
      externals:
      - spec: hsakmt-roct@5.1.0
        prefix: /opt/rocm-5.1.0/
    hsa-rocr-dev:
      buildable: false
      externals:
      - spec: hsa-rocr-dev@5.1.0
        prefix: /opt/rocm-5.1.0/
        extra_atributes:
          compilers:
            c: /opt/rocm-5.1.0/llvm/bin/clang++
            cxx: /opt/rocm-5.1.0/llvm/bin/clang++
    roctracer-dev-api:
      buildable: false
      externals:
      - spec: roctracer-dev-api@5.1.0
        prefix: /opt/rocm-5.1.0/roctracer
    rocprim:
      buildable: false
      externals:
      - spec: rocprim@5.1.0
        prefix: /opt/rocm-5.1.0
    rocrand:
      buildable: false
      externals:
      - spec: rocrand@5.1.0
        prefix: /opt/rocm-5.1.0
    rocsolver:
      buildable: false
      externals:
      - spec: rocsolver@5.1.0
        prefix: /opt/rocm-5.1.0
    rocsparse:
      buildable: false
      externals:
      - spec: rocsparse@5.1.0
        prefix: /opt/rocm-5.1.0
    rocthrust:
      buildable: false
      externals:
      - spec: rocthrust@5.1.0
        prefix: /opt/rocm-5.1.0
  definitions:
  - cpu_specs:
    - adios@1.13.1
    - adios2@2.7.1
    - aml@0.1.0
    - amrex@22.02
    - arborx@1.1
    - archer@2.0.0
    - argobots@1.1
    - axom@0.6.1
    - bolt@2.0
    - butterflypack@2.1.0
    - cabana@0.4.0
    - caliper@2.7.0
    - chai@2.4.0 ~benchmarks ~tests
    - charliecloud@0.26
    - conduit@0.8.2
    - darshan-runtime@3.3.1
    - darshan-util@3.3.1
    - datatransferkit@3.1-rc3
    - dyninst@12.0.1
    - exaworks@0.1.0
    - faodel@1.2108.1
    - flecsi@1.4.2
    - flit@2.1.0
    - fortrilinos@2.0.0
    - gasnet@2021.9.0
    - ginkgo@1.4.0
    - globalarrays@5.8
    - gmp@6.2.1
    - gotcha@1.0.3
    - hdf5@1.10.7 +fortran +hl +shared
    - heffte@2.2.0 +fftw
    - hpctoolkit@2022.01.15
    - hpx@1.7.1 networking=mpi
    - hypre@2.24.0
    - kokkos-kernels@3.5.00 +openmp
    - kokkos@3.5.00 +openmp
    - lammps@20220107
    - legion@21.03.0
    - libquo@1.3.1
    - libunwind@1.5.0
    - metall@0.17
    - mfem@4.3.0
    - mpark-variant@1.4.0
    - mpifileutils@0.11.1 ~xattr
    - nccmp@1.9.0.1
    - nco@5.0.1
    - netlib-scalapack@2.1.0
    - ninja@1.10.2
    - nrm@0.1.0
    - omega-h@9.34.1
    - openpmd-api@0.14.4
    - papi@6.0.0.1
    - papyrus@1.0.1
    - parallel-netcdf@1.12.2
    - paraview@5.10.0
    - parsec@3.0.2012 ~cuda
    - pdt@3.25.1
    - petsc@3.16.4
    - phist@1.9.5
    - plasma@21.8.29
    - precice@2.3.0
    - pumi@2.2.6
    - py-cinemasci@1.3
    - py-jupyterhub@1.4.1
    - py-libensemble@0.8.0
    - py-petsc4py@3.16.4
    - py-warpx@22.02 ^warpx dims=2
    - py-warpx@22.02 ^warpx dims=3
    - py-warpx@22.02 ^warpx dims=rz
    - qthreads@1.16 scheduler=distrib
    - raja@0.14.0
    - slate@2021.05.02 ~cuda
    - slepc@3.16.2
    - stc@0.9.0
    - strumpack@6.3.0 ~slate
    - sundials@6.1.1
    - superlu-dist@7.2.0
    - superlu@5.3.0
    - swig@4.0.2
    - swig@4.0.2-fortran
    - sz@2.1.12
    - tasmanian@7.7
    - tau@2.31 +mpi +python
    - trilinos@13.0.1 +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@1.3.0
    - umap@2.1.0
    - umpire@6.0.0
    - upcxx@2021.9.0
    - veloc@1.5
    - zfp@0.5.5
    #
    # CONFLICTS
    # - libnrm@0.1.0 # explicit depends_on("mpich")
    # - gptune@2.1.0 # explicit depends_on("openmpi")
    #
    # NOT RELEVANT ON CRUSHER
    # - flux-core@0.35.0
    # - nvhpc@22.1
    # - openmpi@4.1.2
    #
    # CRUSHER-SPECIFIC FAILURES
    # - alquimia@1.0.9
    # - ascent@0.7.1
    # - catalyst@5.6.0 # Core/vtkMath.h: 1514:15: error: 'clamp' is not a member of 'std'
    # - geopm@1.1.0 # geopmagent_main.c:118:13: error: 'strncpy' specified bound 512 equals destination size [-Werror=stringop-truncation]
    # - loki@0.1.7 # ISO C++17 does not allow dynamic exception specifications
    # - mercury@2.1.0 # na/na_plugin.h:119: multiple definition of `na_ofi_class_ops_g'
    # - plumed@2.6.3 # lepton/Operation.h:902:39: error: 'numeric_limits' is not a member of 'std'
    # - rempi@1.1.0
    # - scr@3.0rc2 # /opt/cray/pe/mpich/8.1.12/ofi/gnu/9.1/lib/libmpi_gnu_91.so: undefined reference to `PMI_Barrier'
    # - unifyfs@0.9.1
    # - variorum@0.4.1 # Intel/CMakeFiles/variorum_intel.dir/IvyBridge_3E.c.o:(.bss+0x0): multiple definition of `g_platform'
    # - vtk-m@1.7.1
    # - wannier90@3.1.0 # Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4))
    #
    # FAILURES NOT SPECIFIC TO CRUSHER ENVIRONMENT
    # - dealii@9.3.2
    # - stat@4.1.0

  - rocm_specs:
    - amrex@22.02 +rocm amdgpu_target=gfx90a
    - chai@2.4.0 ~benchmarks +rocm amdgpu_target=gfx90a
    - ginkgo@1.4.0 +rocm amdgpu_target=gfx90a
    - heffte@2.2.0 +rocm amdgpu_target=gfx90a
    - kokkos@3.5.00 +rocm amdgpu_target=gfx90a
    - magma@2.6.1 ~cuda +rocm amdgpu_target=gfx90a
    - mfem@4.3.0 +rocm amdgpu_target=gfx90a
    - petsc@3.16.4 +rocm amdgpu_target=gfx90a
    - raja@0.14.0 ~openmp +rocm amdgpu_target=gfx90a
    - slate@2021.05.02 +rocm amdgpu_target=gfx90a
    - slepc@3.16.2 +rocm amdgpu_target=gfx90a ^petsc +rocm amdgpu_target=gfx90a
    - strumpack@6.3.0 ~slate +rocm amdgpu_target=gfx90a
    - superlu-dist@7.2.0 +rocm amdgpu_target=gfx90a
    - umpire@6.0.0 +rocm amdgpu_target=gfx90a
    #
    # CRUSHER FAILURES
    # - hpx@1.7.1 +rocm amdgpu_target=gfx90a # rocm@5.1.0 issue (no problems w 4.5.2); asio/require.hpp:412:3: error: dynamic initialization is not supported for __device__
    #
    # FAILURES NOT SPECIFIC TO CRUSHER ENVIRONMENT
    # - arborx@1.1 +rocm ^kokkos +rocm amdgpu_target=gfx90a # Not ROCmPackage # Could not find a package configuration file provided by "rocthrust"
    # - cabana@0.4.0 +rocm # https://github.com/spack/spack/issues/27967
    # - hpctoolkit@2022.01.15 +rocm # Not ROCmPackage
    # - papi@6.0.0.1 +rocm amdgpu_target=gfx90a # https://github.com/spack/spack/issues/27898
    # - sundials@6.1.1 +rocm amdgpu_target=gfx90a
    # - tasmanian@7.7 +rocm amdgpu_target=gfx90a # https://github.com/spack/spack/issues/27896
    # - vtk-m@1.7.1 +rocm amdgpu_target=gfx90a

  specs:
  - $cpu_specs
  - $rocm_specs
