exasim-project / NeoFOAM

WIP Prototype of a modern CFD core
20 stars 1 forks source link

Use CPM as C++ dependency manager #37

Closed greole closed 3 months ago

greole commented 3 months ago

This PR implements CPM as our package manager.

Motivation for a package manager

A package manager helps with the workflow of checking if a dependency is installed and if not pulling it from a given source. It should also help with checking out a specified version. Additionally, it should provide functionally to do offline builds without access to the internet with a provided cache.

Motivation for CPM instead of conan or vcpck

CPM is a quite minimal package manager specifically written for CMake. In contrast to conan or vcpck no additional installation step for the package manager is needed, since the shipped CPM.cmake suffices. Additionally, no modification to build workflow is required like conan profile detect and conan install. Also we can use CPM for cmake packages that are on github but not on a curated package list (required for kokkos.)

Future Work, add Spack integration

It should be possible to additionally add spack support such that users without spack can build NeoFOAM but are required to provide dependencies like python packages, mpi etc theirself. When combined with spack CPM packages should be installed from the spack environment via the cache option.

Note: This PR currently disables the install helpers. I think we have to rework them anyways.

MarcelKoch commented 3 months ago

In your PR description you mention that CPM can use locally installed packages, if they are available. From the CPM documentation I would assume that this is only the case if CPM_USE_LOCAL_PACKAGES is set. At least for kokkos I think it would be quite important to use the locally installed one. I'm looking into that ATM.

greole commented 3 months ago

At least for kokkos I think it would be quite important to use the locally installed one. I'm looking into that ATM.

Also, if we use NeoFOAM in combination with spack it is important.