Skip to content

Fenv: Always use fallback solution for MacOS since old solution is not working...

Lukas and I have investigated the problem with feenableexcept on MacOS. We found several problems:

  • The solution for MacOS, implemented in corsika/detail/framework/utility/CorsikaFenvFallback.inl, is not working on all MacOS architectures anymore due to changes in apple-clang headers
  • The detection that we are on a MacOS architecture using #ifdef CORSIKA_OS_MAC did not work reliably, since it is not correctly propagated from CMake
  • Our detection mechanism which sets HAS_FEENABLEEXCEPT in cmake/corsikaDefines.cmake just checks for the existence of fenv.h, while it should actually look for the existence of the _fenableexcept symbol.

These are all points that should/will be addressed in new issues.

For now, we implement that on MacOS machines, we always use the fallback solution, which means that floating point exception will not be caught. This is important to keep in mind for developers. However, within our CI, the floating point exceptions will still be caught, since the CI runs on Linux machines. This of course requires that our testing is sufficient.

But this means that compiling is possible again on MacOS.

Closes #415

Merge request reports