Skip to content

Discussion: OMP dependencies for External Libraries

In many case we have external libraries that can be compiled with OMP support. But (as far as I am aware) we have not settled on what behaviour we want if Octopus is compiled in serial.

For debugging, it is sometimes useful to have all external libraries running in serial.

For any other use case (including feature development), I would suggest that we always want external libraries leveraging OMP, because this leads to performance gains.

The question is, do we want to agree that:

  • All external libraries should be compiled with OMP support, regardless or whether Octopus as a program is compiled with OMP support?
  • Do we want to offer a configuration (preset/on-demand builder) where all external dependencies also run in pure serial?

Related but Tangential Testing - Flag Propagation to Fetched Content

@VileLasagna did a minimal working example of flag propagation:

I put together a minimal example. No sort of README or anything so here's the gist:

Project A is a test app which calls a function from a library B. B is acquired with FetchContent (it's all on the same directory) and not a normal part of the build tree.

The function will just print a message which identifies the build as release or debug and also tries to output some of the compilation flags used by CMake (this is not an extensive list)

And through this I can confirm that the compile flags DO get forwarded to the build of B, the "fetched" library. One COULD control this in detail as part of the FetchContent call as it wraps most of the functionality of ExternalProject but, by default, these generic flags get forwarded

Feel free to clone and build with different configurations to have a check

Edited by Alex Buccheri