Skip to content

Proposal: Single build directory build

We are still lacking a proper idea how to get rid of the repeated CMake configure runs, which is performed for each module and all its dependencies.

Thus, I want to discuss the idea of a single build directory: the single build directory build.

  1. A single build directory.
  2. Within the directory, all core modules are built.
  3. CMake configure is run for each module, but only once. All CMake variables, targets, Find modules are available for all modules (without re-run or tricky import).
  4. The dependency resolution is done before the built (make) starts. It would be enough to check the presence of a modules dune.module file.
  5. All build artifacts are co-located, e.g., lib/ contains libdunecommon, libdunegeometry, libdunegrid and so on.
  6. Quasi-circular dependency like dune-geometry and dune-localfunctions are not a problem, because whatever module is built first knows from the dependency resolution whether the other module is present or not and can conditionally built features and tests.
  7. As the configuration is done together, we can ensure that all modules have the same flags, the same libraries, the same C++ version and so on.
  8. It would be possible to have multiple build flavors (different compilers, flags, external dependencies), one per build directory.
  9. Distribution as RPM or Deb would just include the source code, similar to the tarball. The user have to set up a build directory and build libdunecommon, libdunegeometry and so on.
Edited by Christoph Grüninger