Installation¶
Prefered installation procedure¶
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 and Cassiopée, git submodules (std_e…), or Python modules (mpi4py, ruamel). 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.
Installation through Spack¶
Source a Spack repository on your machine.
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.Download the ONERA Spack repository with
git clone https://gitlab.onera.net/informatics/infra/onera_spack_repo.gitTell Spack that package recipes are in
onera_spack_repoby 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)
You should be able to see the package options of Maia with
spack info maiaTo install Maia:
spack install maia
Development workflow¶
For development, it is advised to use Spack to have Maia dependencies, but then follow a typical CMake workflow with cmake/make.
Dependencies¶
To get access to Maia dependencies in your development environment, you can:
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.yamlenvironement 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¶
It is often practical to develop Maia with some of its dependencies, namely:
project_utils
std_e
cpp_cgns
paradigm
pytest_parallel
For that, you need to use git submodules. Maia submodules are located at $MAIA_FOLDER/external. To populate them, use git submodule update --init. Once done, CMake will use these versions of the dependencies. If you don’t populate the submodules, CMake will try to use the ones of your environment (for instance, the one installed by Spack).
We advise that you use some additional submodule configuration utilities provided in this file. In particular, you should use:
cd $MAIA_FOLDER
git submodule update --init
git_config_submodules
The detailed meaning of git_config_submodules and the git submodule developper workflow of Maia is presented here.
If you are using Maia submodules, you can filter them out from your Spack environment view like so:
view:
default:
exclude: ['maia','std-e','cpp-cgns','paradigm','pytest_parallel']
Manual installation procedure¶
Dependencies¶
Maia depends on:
python3
MPI
hdf5
Cassiopée
pytest >6 (python package)
ruamel (python package)
mpi4py (python package)
The build process requires:
Cmake >= 3.14
GCC >= 8 (Clang and Intel should work but no CI)
Other dependencies¶
During the build process, several other libraries will be downloaded:
pybind11
range-v3
doctest
ParaDiGM
project_utils
std_e
cpp_cgns
This process should be transparent.
Optional dependencies¶
The documentation build requires:
Doxygen >= 1.8.19
Breathe >= 4.15 (python package)
Sphinx >= 3.00 (python package)
Build and install¶
Install the required dependencies. They must be in your environment (
PATH,LD_LIBRARY_PATH,PYTHONPATH).
For pytest, you may need these lines :
pip3 install --user pytest
pip3 install --user pytest-mpi
pip3 install --user pytest-html
pip3 install --user pytest_check
pip3 install --user ruamel.yaml
Then you need to populate your
externalfolder. You can do it withgit submodule update --initThen use CMake to build maia, e.g.
SRC_DIR=<path to source repo>
BUILD_DIR=<path to tmp build dir>
INSTALL_DIR=<path to where you want to install Maia>
cmake -S $SRC_DIR -B$BUILD_DIR -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR
cd $BUILD_DIR && make -j && make install