Skip to content

Proposal: Add CMake option to enable floating point optimizations

I would like to propose to add a compiler-independent CMake option to enable non-standard compliant floating point optimizations (i. e. the -ffast-math flag of GCC and the corresponding flags on other compilers). This option could be called CMAKE_ENABLE_FAST_MATH or similar.

When I write numerical code, I usually compile with these optimizations enabled, but it is quite tedious to sort the flags of different compilers out, and I think controlling this via a CMake option would be suitable. I also think other developers of numerical C/C++/Fortran software would make use of this.

If this is deemed useful, I might look into implementing this myself.

Thoughts?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information