packages:
  all:
    require:
      - spec: '+ipo'
        when: '%gcc'
      - spec: '^netlib-scalapack'
        when: '%gcc ^scalapack'

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

  apr:
    # https://issues.apache.org/jira/browse/SVN-4813
    require: ['@1.6.2']

  arpack-ng:
    prefer: ['+mpi']

  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']

  cairo:
    # ~X avoids a dependency to python (only prefer due to gtkplus)
    prefer: ['~X']

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

  curl:
    require: ['tls=openssl,mbedtls', '+nghttp2', '+libidn2', '+libssh2']

  emacs:
    prefer: ['+tls', '+X', 'toolkit=athena']

  expat:
    prefer: ['libbsd']

  fenics-dolfinx:
    require: ['@0.8.0', '+slepc']

  ffmpeg:
    require: ['+libx264']

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

  gettext:
    require: ['+libxml2', '+xz']

  gnuplot:
    require: ['@5.4.10', '+cairo']

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

  hypre:
    prefer:
    - spec: '@2.31.0 ~magma'

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

  julia:
    require: ['@1.10.2']

  kokkos:
    require: ['+openmp', '+numactl', '+memkind', '~threads',
             '+aggressive_vectorization', '@4.3.01']

  kokkos-kernels:
    require: ['@4.3.01', '+openmp', '~threads', '~ipo']

  kokkos-nvcc-wrapper:
    prefer: ['@4.3.01']

  lammps:
    require: ['@20230802.3',
              'build_type=Release', '+asphere', '+atc', '+body', '+class2',
              '+colloid', '+compress', '+coreshell', '+dipole', '+diffraction',
              '+extra-dump', '+granular', '+h5md', '+kspace', '+latboltz',
              '+lib', '+manybody', '+mc', '+misc', '+molecule',
              '+mpi', '+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'

  libffi:
    require: ['@3.4.6']

  libssh2:
    prefer: ['crypto=openssl']

  libtiff:
    require: ['build_system=cmake', '+pic', '+shared', '+jpeg']

  libtool:
    require: ['@2.4.6']

  libxcb:
    require: ['+use_spack_interpreter']

  libxml2:
    # python depends on libxml2 this avoid cyclic dependency
    require: ['~python']

  likwid:
    require: ['@5.3.0']

  llvm:
    # avoid compiler in lmod module
    prefer: ['~clang']
    require:
    - spec: '~cuda'
      when: '@15:'

  m4:
    require: ['+sigsegv']

  magma:
    # https://groups.google.com/a/icl.utk.edu/g/magma-user/c/l2XWTKmuBH0
    require: ['~ipo']

  mbedtls:
    prefer: ['@3.3.0']

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

  meson:
    prefer: ['@1.2.1']

  metis:
    require: ['+real64']

  mgard:
    require: ['~cuda']

  mpfr:
    require: ['@4.0.2']

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

  openblas:
    prefer: ['threads=pthreads symbol_suffix=none ~ilp64']

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

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

  openssl:
    prefer: ['+shared', 'certs=system', '~docs']

  pango:
    prefer: [~X]

  papi:
    require: ['+powercap', '+rapl']

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

  python:
    require:
    - spec: '+ssl +tkinter +crypt +bz2 +pyexpat +libxml2 +ctypes +uuid ~sqlite3'
    - spec: '+optimizations'
      when: '%gcc'
    prefer:
    - spec: '%gcc@12.3.0'
      when: '%gcc'

  py-cython:
    require:
    - one_of: ['@0.29.36', '@3.0.8']
    prefer: ['@3.0.8']

  py-fenics-dolfinx:
    require: ['@0.8.0']

  py-numpy:
    prefer: ['@1.26.4']

  py-pandas:
    prefer: ['@2.2.1']

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

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

  py-scipy:
    require: ['@1.13.0']

  py-setuptools:
    require: ['@63.4.3']

  scotch:
    prefer: ['~mpi']

  sirius:
    prefer: ['+fortran', '+elpa', '+wannier90']

  slepc:
    require:
    - spec: '^arpack-ng +mpi'

  suite-sparse:
    require: ['@7.2.1', '+graphblas']

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

  ucx:
    require:
    - spec: '+rdmacm +rc +dc +ud +cma +verbs'

  vtk:
    require:
    - spec: '~python ++mpi +xdmf +ffmpeg'

  xmlto:
    require: ['@0.0.29']

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

  ninja:
    buildable: false
    externals:
    - spec: 'ninja@1.10.2'
      prefix: /usr

  opengl:
    buildable: false
    externals:
    - spec: 'opengl@4.6'
      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


  # ----------------------------------------------------------------------------
  # Externals
  # ----------------------------------------------------------------------------
  abaqus:
    buildable: false
    permissions: {read: group, group: abaqus-soft}
    externals:
    - {spec: abaqus@2019, prefix: /ssoft/spack/external/abaqus/2019}
    - {spec: abaqus@2023, prefix: /ssoft/spack/external/abaqus/2023}
  ansys:
    buildable: false
    externals:
    - {spec: ansys@2020R2, prefix: /ssoft/spack/external/ansys/2020R2/v202}
    - {spec: ansys@2022R1, prefix: /ssoft/spack/external/ansys/2022R1/v221}
    - {spec: ansys@2022R2, prefix: /ssoft/spack/external/ansys/2022R2/v222}
    - {spec: ansys@2024R1, prefix: /ssoft/spack/external/ansys/2024R1/v241}
  cfdplusplus:
    buildable: false
    externals:
    - {spec: cfdplusplus@16.1, prefix: /ssoft/spack/external/CFD++/2016.05}
    - {spec: cfdplusplus@19.1, prefix: /ssoft/spack/external/CFD++/19.1}
  comsol:
    buildable: false
    permissions: {read: group, group: comsol-soft}
    externals:
    - {spec: comsol@5.6, prefix: /ssoft/spack/external/comsol/5.6/comsol56/multiphysics/}
    - {spec: comsol@6.0, prefix: /ssoft/spack/external/comsol/6.0}
    - {spec: comsol@6.2, prefix: /ssoft/spack/external/comsol/6.2}
  fdtd:
    buildable: false
    permissions: {read: group, group: fdtd-soft}
    externals:
    - {spec: fdtd@2020-R2-2387, prefix: /ssoft/spack/external/fdtd/8.24.2387}
    - {spec: fdtd@2020-R2.4-2502, prefix: /ssoft/spack/external/fdtd/2020-R2.4-2502}
    - {spec: fdtd@2021-R2.2-2806, prefix: /ssoft/spack/external/fdtd/2021-R2.2-2806}
    - {spec: fdtd@2022-R1.1-2963, prefix: /ssoft/spack/external/fdtd/2022-R1.1-2963}
  gaussian:
    buildable: false
    externals:
    - {spec: gaussian@g16-A.03, prefix: /ssoft/spack/external/gaussian/g16-A.03/avx2}
    - {spec: gaussian@g16-C.01, prefix: /ssoft/spack/external/gaussian/g16-C.01/avx2}
  gurobi:
    buildable: false
    externals:
    - {spec: gurobi@8.1.1, prefix: /ssoft/spack/external/gurobi/8.1.1}
    - {spec: gurobi@9.5.2, prefix: /ssoft/spack/external/gurobi/9.5.2}
    - {spec: gurobi@10.0.1, prefix: /ssoft/spack/external/gurobi/10.0.1}
  maple:
    buildable: false
    externals:
    - {spec: maple@2017, prefix: /ssoft/spack/external/Maple/2017}
  mathematica:
    buildable: false
    externals:
    - {spec: mathematica@11.1.1, prefix: /ssoft/spack/external/Mathematica/11.1.1}
    - {spec: mathematica@13.0, prefix: /ssoft/spack/external/Mathematica/13.0}
  matlab:
    buildable: false
    externals:
    - {spec: matlab@R2018a, prefix: /ssoft/spack/external/MATLAB/R2018a}
    - {spec: matlab@R2019b, prefix: /ssoft/spack/external/MATLAB/R2019b}
    - {spec: matlab@R2024a, prefix: /ssoft/spack/external/MATLAB/R2024a}
  molpro:
    buildable: false
    externals:
    - {spec: molpro@2022.3.0, prefix: /ssoft/spack/external/molpro/2022.3.0/mpi}
  smr:
    buildable: false
    externals:
    - {spec: smr@2017.0, prefix: /ssoft/spack/external/SMR/2017.06}
  totalview:
    externals:
    - {spec: totalview@2017.2.11, prefix: /ssoft/spack/external/toolworks/totalview.2017.2.11}
    - {spec: totalview@2020.3.11, prefix: /ssoft/spack/external/toolworks/totalview.2020.3.11}
