packages:
  all:
    providers:
      mpi: [openmpi, intel-oneapi-mpi]
      jpeg: [libjpeg]
      zlib-api: [zlib-ng]
    require:
      - spec: "^libiconv"
        when: "^iconv"

      # - spec: ^intel-oneapi-mpi
      #   when: '%oneapi ^mpi'

      # - spec: ^openmpi
      #   when: '%gcc ^mpi'

      # - spec: ^openmpi
      #   when: '%aocc ^mpi'

      # - spec: ^nvhpc+mpi
      #   when: '%nvhpc ^mpi'

      # - spec: ^openblas
      #   when: '%gcc ^blas'

      # - spec: ^openblas
      #   when: '%gcc ^lapack'

      # - spec: ^intel-oneapi-mkl
      #   when: '%oneapi ^blas'

      # - spec: ^intel-oneapi-mkl
      #   when: '%oneapi ^lapack'

      # - spec: ^nvhpc+blas
      #   when: '%nvhpc ^blas'

      # - spec: ^nvhpc+lapack
      #   when: '%nvhpc ^lapack'

      # - spec: ^openblas
      #   when: '%gcc ^py-numpy'

      # - spec: ^intel-oneapi-mkl
      #   when: '%oneapi ^py-numpy'

      - spec: '+ipo'
        when: '%gcc'

  # ----------------------------------------------------------------------------
  # Requirements
  # ----------------------------------------------------------------------------
  adios2:
    require: ['+kokkos']

  boost:
    prefer: ['~mpi']
    require: ['cxxstd=14', '+icu', '+python', '+numpy', '+atomic', '+chrono',
    '+container', '+date_time', '+filesystem', '+graph', '+iostreams', '~json',
    '+locale', '+log', '+math', '~pic', '+program_options', '+random', '+regex',
    '+serialization', '+shared', '+signals', '~singlethreaded', '~stacktrace',
    '+system', '~taggedlayout', '+test', '+thread', '+timer', '~type_erasure',
    '~versionedlayout', '+wave', '+exception']

  cuda:
    require:
    - spec: '@12.4.0'
    - spec: '+allow-unsupported-compilers'
      when: '%oneapi'

  fenics-dolfinx:
    require: ['+slepc']

  fftw:
    prefer: ['+mpi', '+openmp']

  gnuplot:
    require:
    - spec: '@5.4.10'

  hdf5:
    prefer:
    - spec: '+mpi'
    - spec: '@1.14.3'
    require:
    - spec: '+hl +threadsafe +szip +cxx +fortran'
    - spec: '+ipo'
      when: '%gcc'

  hypre:
    prefer:
    - spec: '@2.31.0'
    require:
    - spec: '+unified-memory ~magma'
      when: '+cuda'

  intel-oneapi-mkl:
    prefer: ['+cluster']

  kokkos:
    prefer: ['+openmp', '+openmptarget', '+numactl', '+memkind', '+threads', '+aggressive_vectorization']

  lammps:
    require: ['build_type=Release', '+asphere', '+atc', '+body', '+class2',
    '+colloid', '+compress', '+coreshell', '+dipole', '+diffraction', '+extra-dump',
    '+granular', '+h5md', '+kspace', '+latboltz', '+latte', '+lib', '+manybody',
    '+mc', '+misc', '+molecule', '+mpi', '+mpiio', '+netcdf', '+peri', '~poems',
    '+python', '+qeq', '+replica ', '+rigid', '+shock', '+ml-snap', '+srd',
    '+voronoi', '+plumed', '+kokkos']

  libfabric:
    require:
    - spec: 'fabrics=mlx,mrail,psm3,verbs,udp,tcp,sockets,shm'

  llvm:
    prefer: ['~clang']

  libxcb:
    require: ['+use_spack_interpreter']

  mesa:
    require: ['~llvm', '+opengl', '+opengles', '+osmesa']

  metis:
    require: ['+real64']

  netcdf-c:
    prefer: ['+mpi']

  openblas:
    prefer: ['threads=pthreads']

  opencv:
    prefer: ['+vtk', '+python3']

  openmpi:
    require:
    - spec: '@5.0.3 fabrics=ofi,ucx,verbs schedulers=slurm ~rsh +romio romio-filesystem=gpfs +internal-pmix ~memchecker'
    - spec: ^ucx +cuda
      when: +cuda

  petsc:
    require:
    - spec: '+hypre +mumps +saws +scalapack +mpi +suite-sparse +kokkos'

  python:
    require:
    - spec: '+ssl +tkinter'
    - spec: '+optimizations'
      when: '%gcc'

  py-tensorflow:
    require: ['+mpi']

  py-torch:
    require: ['+mpi', '~magma']

  suite-sparse:
    require:
    - spec: '+graphblas'

  tk:
    require: ['+xft', '+xss']

  ucx:
    require:
    - spec: +rdmacm +rc +dc +ud +cma +verbs
    - spec: +gdrcopy
      when: +cuda

  # ----------------------------------------------------------------------------
  # System dependencies
  # ----------------------------------------------------------------------------
  egl:
    buildable: false
    externals:
    - spec: 'egl@21.3.4'
      prefix: /usr

  pmix:
    buildable: false
    externals:
    - spec: 'pmix@5.0.1'
      prefix: /usr

  rdma-core:
    buildable: false
    externals:
    - spec: 'rdma-core@47.1'
      prefix: /usr

  slurm:
    buildable: false
    externals:
    - spec: 'slurm@23-11-7-1'
      prefix: /usr
