Building istl-solver-playground causes compile time error
Hello ISTL Devs,
Thank you so much for maintaining this project. Here is a short bug report ~
Bug summary Building istl-solver-playground on Intel Mac causes compile time error due to missing identifier in standard header fenv.h
To Reproduce
$ pwd
> release-build/dune-istl/src
$ make istl-solver-playground
> [ 0%] Building CXX object
src/CMakeFiles/istl-solver-playground.dir/istl-solver-playground.cc.o
DUNE/dune-istl/src/istl-solver-playground.cc:104:6: error: use of
undeclared identifier 'feenableexcept'; did you mean 'feraiseexcept'?
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);// | FE_UNDERFLOW);
^~~~~~~~~~~~~~
feraiseexcept
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/fenv.h:299:12:
note: 'feraiseexcept' declared here
extern int feraiseexcept(int /* excepts */);
^
1 error generated
Expected behavior Should be able to find the correct identifier based on the platform.
Describe your setup
-
Source: Tested on branches master and release/2.9 from https://gitlab.dune-project.org/core/dune-istl.git
-
Compiler: Homebrew clang version 16.0.3
-
Target: x86_64-apple-darwin21.6.0, MacOSX12.3.sdk
-
Cmake version 3.27.4
-
GNU Make 4.4.1
Additional context
-
feenableexcept
must be within preprocessor conditionals to guard against its compilation on Mac and windows. Both of them instead haveferaiseexecpt
. I have tested this only on MacOS and it fixes the issue.
Best wishes, Sanchi