spack:
  include:
      - compiler_definitions.yaml

      - packages_stack.yaml
      - packages_env.yaml

      - modules_stack.yaml
      - modules_env.yaml

      - definitions_env.yaml

      - config_stack.yaml

  definitions:
    # -------------------------------------------------------------------------
    # PE definition
    # -------------------------------------------------------------------------
    - mpi_gcc:
        - openmpi@5.0.3

    - mpi_oneapi:
        - intel-oneapi-mpi@2021.12.1

    - blas_gcc:
        - openblas@0.3.27

    - blas_oneapi:
        - intel-oneapi-mkl@2024.1.0

    - python_gcc:
        - python@3.11.7

    - python_oneapi:
        - python@3.11.7

    # -------------------------------------------------------------------------
    # Core packages
    # -------------------------------------------------------------------------
    - core_codes:
        - bzip2
        - cmake
        - emacs
        - fastqc
        - fio
        - git
        - git-lfs
        - gmp
        - gnuplot
        - gzip
        - intel-oneapi-advisor
        - intel-oneapi-inspector
        - intel-oneapi-vtune
        - libarchive
        - libjpeg-turbo
        - libpng
        - libtiff
        - libxml2
        - likwid
        - lmod
        - mpfr
        - neovim
        #- ninja
        - papi
        - parallel
        - picard
        - rclone
        - sbt
        - sratoolkit
        - subversion
        - tar
        - tcl
        - tk
        - tmux
        - trimmomatic
        - xclip
        - zlib-ng

    # -------------------------------------------------------------------------
    # Serial codes
    # -------------------------------------------------------------------------
    - serial_codes:
        - fftw +openmp ~~mpi
        - fftw ~~openmp ~~mpi
        - gsl
        - hdf5@1.14.3 ~~mpi
        - htslib
        - intel-oneapi-tbb
        - jasper
        - kallisto ^hdf5 ~~mpi
        - kokkos
        - kokkos-kernels
        - mafft
        - metis
        - muscle
        - netcdf-c ~~mpi
        - netcdf-fortran ^netcdf-c ~~mpi
        - nfft ^fftw~~mpi~~openmp
        - python
        - scotch ~~mpi
        - star
        - subread
        - unblur ^fftw~~mpi ~~openmp
        - voropp

    - gcc_serial_codes:
        - bwa
        - eigen
        - ffmpeg
        - glpk+gmp
        - hwloc
        - intel-oneapi-mkl
        - libxc
        - qperf
        - ncview ^netcdf-c ~~mpi ~parallel-netcdf
        - sox
        - stacks

    - oneapi_serial_codes:
        - abaqus@2023
        - intel-oneapi-ipp

    # -------------------------------------------------------------------------
    # Empty to specialize in environments
    # -------------------------------------------------------------------------
    - cuda_system_codes: []

    - cuda_serial_codes: []

    - cuda_mpi_codes: []

    # -------------------------------------------------------------------------
    # Blas dependent codes
    # -------------------------------------------------------------------------
    - blas_codes:
        - arpack-ng ~~mpi
        - superlu
        - suite-sparse

    - gcc_blas_codes:
        - armadillo +hdf5 ^arpack-ng ~~mpi ^hdf5 ~~mpi
        - octave

    # -------------------------------------------------------------------------
    # Python packages
    # -------------------------------------------------------------------------
    - python_codes:
        - bedtools2
        - bowtie2
        - cairo
        - mercurial
        - prinseq-lite
        - py-absl-py
        - py-astunparse
        - py-backports-entry-points-selectable
        - py-certifi
        - py-charset-normalizer
        - py-cycler
        - py-cython
        - py-distlib
        - py-filelock
        - py-gast
        - py-google-pasta
        - py-idna
        - py-kiwisolver
        - py-mpmath
        - py-packaging
        - py-pillow
        - py-pip
        - py-platformdirs
        - py-ply
        - py-protobuf
        - py-pybind11
        - py-pyparsing
        - py-python-dateutil
        - py-pytz
        - py-requests
        - py-semver
        - py-six
        - py-sympy
        - py-termcolor
        - py-urllib3
        - py-virtualenv
        - py-wheel
        - py-wrapt
        - samtools
        - scons
        - snakemake

    - python_blas_codes:
        - boost ~~mpi
        #- gmsh ~~mpi +hdf5 +cgns +eigen ~opencascade +openmp ~fltk ~med
        - iq-tree
        - py-biopython
        - py-keras-preprocessing
        - py-macs3
        - py-matplotlib
        - py-numpy
        - py-opt-einsum
        - py-pandas
        - py-pybigwig
        - py-xarray
        - valgrind ~~mpi

    - gcc_python_codes:
        - blast-plus
        - cistem  ^fftw~~mpi
        - ctffind ^fftw ~~mpi
        - gatk
        - hisat2
        - imagemagick +ghostscript
        - julia+openlibm
        - libgd
        - mesa
        - mummer
        - node-js
        - rust
        - spades
        - xgboost

    - gcc_python_blas_codes:
        - caffe +python ^hdf5~mpi
        - gdb +tui +source-highlight +xz
        - openbabel ++python ^boost ~~mpi
        - polymake ^cddlib@0.94h
        - py-cryolobm
        - py-deeptools
        - py-h5py ~~mpi
        - py-pymol ^hdf5~mpi
        - py-scikit-learn
        - py-scipy
        #- py-statsmodels
        - py-theano
        - r

    # -------------------------------------------------------------------------
    # Parallel codes
    # -------------------------------------------------------------------------
    - mpi_codes:
        - fftw ++mpi +openmp
        - hdf5@1.14.3 ++mpi
        - openfoam-org +metis
        - osu-micro-benchmarks +graphing
        - parmetis
        - phylobayesmpi
        - scotch ++mpi
        - netcdf-c
        - netcdf-fortran
        - parmetis
        - scorep

    - mpi_python_codes:
        - py-mpi4py

    - gcc_mpi_codes:
        - wrf ~pnetcdf build_type=dm+sm

    - mpi_blas_codes:
        - arpack-ng ++mpi
        - hypre@2.31.0
        - mumps@5.6.2
        - superlu-dist@8.2.1
        #- quantum-espresso ++mpi +scalapack +gipaw
        #- quantum-espresso ++mpi +scalapack +gipaw hdf5=parallel

    - gcc_mpi_blas_codes:
        - armadillo +hdf5 ^arpack-ng ++mpi ^hdf5 ++mpi
        - gmsh ++mpi +eigen +openmp +hdf5 ~fltk ~opencascade ~med ^mmg ~vtk
        - cpmd ~openmp
        - elmerfem +mumps +openmp +hypre
        - netlib-scalapack
        - trilinos
        - vtk
        - yambo ++mpi io=iotk,etsf-io

    - mpi_blas_python_codes:
        - boost ++mpi
        - cgal
        - iq-tree@1.6.12++mpi
        - neuron ++mpi +python
        - petsc
        - plumed
        - py-petsc4py
        - slepc
        - sirius

    - gcc_mpi_blas_python_codes:
        # - eman2 ++mpi
        - adios2
        - cp2k ++mpi +plumed +openmp smm=blas
        # - fenics +parmetis +hdf5 +scotch +suite-sparse ~vtk ~trilinos
        - fenics-dolfinx
        - gromacs ++mpi +plumed
        - lammps
        - opencv
        - openfoam +metis
        - paraview@5.12.0 +shared +python +hdf5  +opengl2
        - py-fenics-dolfinx
        - py-h5py ++mpi
        # - py-horovod cannot resolve dependencies with pytorch
        - py-keras
        - py-tensorflow
        - py-torch
        - py-torchvision
        - relion ~mklfft
        - topaz

    # -------------------------------------------------------------------------
    # External packages
    # -------------------------------------------------------------------------
    - external_packages: []
    - when: env['environment_type'] != 'cloud'
      external_packages:
        - ansys
        - cfdplusplus
        - comsol
        - fdtd
        - gurobi
        - gaussian
        - matlab
        - maple
        - mathematica
        - molpro
        - smr

    - when: env['environment_type'] != 'cloud'
      blas_mpi_codes:
        - vasp +hdf5 +scalapack +shmem +wannier90

    # -------------------------------------------------------------------------
    # Generic definitions
    # -------------------------------------------------------------------------
    - mpis:
        - $mpi_oneapi
        - $mpi_gcc

  specs:
    - matrix:
        - [$compilers_specs]

    - matrix:
        - [$blas_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$mpi_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$core_codes]
        - [$%system_compiler]

    - matrix:
        - [$cuda_system_codes]
        - [$%system_compiler]

    - matrix:
        - [$serial_codes]
        - [$%compiler_gcc]

    - matrix:
        - [$gcc_serial_codes]
        - [$%compiler_gcc]

    - matrix:
        - [$cuda_serial_codes]
        - [$%compiler_gcc]

    - matrix:
        - [$blas_codes]
        - [$^blas_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$gcc_blas_codes]
        - [$^blas_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$python_codes]
        - [$^python_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$gcc_python_codes]
        - [$^python_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$python_blas_codes]
        - [$^python_gcc]
        - [$^blas_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$gcc_python_blas_codes]
        - [$^python_gcc]
        - [$^blas_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$mpi_codes]
        - [$^mpi_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$mpi_python_codes]
        - [$^python_gcc]
        - [$^mpi_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$gcc_mpi_codes]
        - [$^mpi_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$cuda_mpi_codes]
        - [$^mpi_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$mpi_blas_codes]
        - [$^blas_gcc]
        - [$^mpi_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$mpi_blas_python_codes]
        - [$^python_gcc]
        - [$^blas_gcc]
        - [$^mpi_gcc]
        - [$%compiler_gcc]

    - matrix:
        - [$gcc_mpi_blas_python_codes]
        - [$^python_gcc]
        - [$^blas_gcc]
        - [$^mpi_gcc]
        - [$%compiler_gcc]

    # --------------------------------------------------------------------------
    - matrix:
        - [$serial_codes]
        - [$%compiler_oneapi]

    - matrix:
        - [$blas_oneapi]
        - [$%compiler_oneapi]

    - matrix:
        - [$mpi_oneapi]
        - [$%compiler_oneapi]

    - matrix:
        - [$oneapi_serial_codes]
        - [$%compiler_oneapi]

    - matrix:
        - [$blas_codes]
        - [$^blas_oneapi]
        - [$%compiler_oneapi]

    - matrix:
        - [$python_codes]
        - [$^python_oneapi]
        - [$%compiler_oneapi]

    - matrix:
        - [$python_blas_codes]
        - [$^python_oneapi]
        - [$^blas_oneapi]
        - [$%compiler_oneapi]

    - matrix:
        - [$mpi_codes]
        - [$^mpi_oneapi]
        - [$%compiler_oneapi]

    - matrix:
        - [$mpi_python_codes]
        - [$^python_oneapi]
        - [$^mpi_oneapi]
        - [$%compiler_oneapi]

    - matrix:
        - [$mpi_blas_codes]
        - [$^blas_oneapi]
        - [$^mpi_oneapi]
        - [$%compiler_oneapi]

    - matrix:
        - [$mpi_blas_python_codes]
        - [$^python_oneapi]
        - [$^blas_oneapi]
        - [$^mpi_oneapi]
        - [$%compiler_oneapi]

  view: false
#    default:
#      root: /stack/packages/
