# CMake promotes Fortran reals to 8 bytes

**URL:** https://discourse.cmake.org/t/cmake-promotes-fortran-reals-to-8-bytes/1302
**Category:** Usage
**Tags:** os:linux
**Created:** [June 1, 2020, 3:56pm UTC](https://discourse.cmake.org/t/cmake-promotes-fortran-reals-to-8-bytes/1302 "2020-06-01T15:56:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![RedKnight7](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/c57346/32.png) [@RedKnight7](https://discourse.cmake.org/u/RedKnight7)
#### Post date: [June 1, 2020, 3:56pm UTC](https://discourse.cmake.org/t/cmake-promotes-fortran-reals-to-8-bytes/1302/1 "2020-06-01T15:56:14Z")

</div>

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?

Thanks.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [June 1, 2020, 4:27pm UTC](https://discourse.cmake.org/t/cmake-promotes-fortran-reals-to-8-bytes/1302/2 "2020-06-01T16:27:53Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![RedKnight7](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/c57346/32.png) [@RedKnight7](https://discourse.cmake.org/u/RedKnight7)
#### Post date: [June 1, 2020, 5:38pm UTC](https://discourse.cmake.org/t/cmake-promotes-fortran-reals-to-8-bytes/1302/3 "2020-06-01T17:38:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![RedKnight7](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/c57346/32.png) [@RedKnight7](https://discourse.cmake.org/u/RedKnight7)
#### Post date: [June 1, 2020, 6:22pm UTC](https://discourse.cmake.org/t/cmake-promotes-fortran-reals-to-8-bytes/1302/4 "2020-06-01T18:22:23Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [June 2, 2020, 5:26pm UTC](https://discourse.cmake.org/t/cmake-promotes-fortran-reals-to-8-bytes/1302/5 "2020-06-02T17:26:13Z")

</div>

It sounds like maybe one system had environment variable [FFLAGS](https://cmake.org/cmake/help/latest/envvar/FFLAGS.html) set (outside of CMake).
