Quadmath support breaks compilation with clang when using dune_enable_all_packages()
The CMake test for quadmath adds a library to the Dune package database by calling dune_register_package_flags()
, but does not provide a corresponding add_quadmath_flags()
or something similar. For that reason, nothing in dune-common tests whether these flags actually work.
I just stumbled over this trying to rebuild the CI images for PDELab (which uses dune_enable_all_packages()
and thus pulls in the quadmath library definition). Unfortunately, in addition to adding the required linker flags, the CMake test also adds -fext-numeric-literals
to the compile options, which is a GCC extension not understood by clang, causing the build to fail, cf. https://gitlab.dune-project.org/docker/ci/-/jobs/44285.
I think we need to do two things:
- Add a test to dune-common that actually uses the quadmath library as defined in
dune_register_package_flags()
. - Check that the compiler actually understands
-fext-numeric-literals
. I have no idea whether it is better to disable the whole feature if the option is missing, or whether we should just drop the compile option in that case.