Spack

Installation through Spack

Warning

The procedure is not up-to-date

Maia depends on quite a few libraries of different kinds, be it system libraries like MPI, third-party libraries like HDF5, ONERA libraries like ParaDiGM , git submodules (std_e…), or Python modules (mpi4py, pyyaml). The prefered way of installing Maia in a coherent environment is by using the Spack package manager. A Spack recipe for Maia can be found on the ONERA Spack repository.

  1. Source a Spack repository on your machine.

  2. If you don’t have a Spack repository ready, you can download one with git clone https://github.com/spack/spack.git. On ONERA machines, it is advised to use the Spacky helper.

  3. Download the ONERA Spack repository with git clone https://gitlab.onera.net/informatics/infra/onera_spack_repo.git

  4. Tell Spack that package recipes are in onera_spack_repo by adding the following lines to $SPACK_ROOT/etc/repos.yaml:

repos:
- path/to/onera_spack_repo

(note that spacky does steps 3. and 4. for you)

  1. You should be able to see the package options of Maia with spack info maia

  2. To install Maia: spack install maia

Dependencies

To get access to Maia dependencies in your development environment, you have several choices:

  • Install a Spack version of Maia, source it in your development environment to get all the dependencies, then override with your own compiled version of Maia

  • Do the same, but use a Spack environment containing Maia instead of just the Maia package

  • Source a Spack environment where Maia has been removed from the environment view. This can be done by adding the following lines to the spack.yaml environement file:

view:
  default:
    exclude: ['maia']

This last option is cleaner because you are sure that you are not using another version of Maia (but it means you need to create or have access to such an environment view)

Source the build folder

You can develop without the need to install Maia. However, in addition to sourcing your dependencies in your development environment, you also need to source the build artifacts by:

cd $MAIA_BUILD_FOLDER
source source.sh

The source.sh file is created by CMake and will source all Maia artifacts (dynamic libraries, python modules…)

Development workflow with submodules

For development, you can still use Spack to have Maia dependencies, but then follow a typical CMake workflow with cmake/make. If you are developping within Maia and its submodules, you can filter them out from your Spack environment view like so:

view:
  default:
    exclude: ['maia','std-e','cpp-cgns','paradigm','pytest_parallel']