CMake promotes Fortran reals to 8 bytes

We are using gfortran to build our code. When we build with our legacy configure system, default reals are 4 bytes with 24 digits of precision. When we build with cmake 3.16.5 , default reals are 8-bytes with 53 digits of precision. This produces a lot of diffs in our regression tests. Is there a way to prevent cmake from promoting the default reals to 8 bytes?


Can you provide the flags used by your old build vs. the flags generated by CMake? I see a -fdefault-real-8 flag, but CMake doesn’t have any instance of that flag (textually).

I’m working on it. A lot of build information gets removed automatically after the build completes.

Chalk this up to letting build systems become too complex.

One system used the -fdefault-real-8 flag and the other didn’t.

My bad for not knowing where to check.

It sounds like maybe one system had environment variable FFLAGS set (outside of CMake).