# Wrong compiler when installing with internally built FFTW3?

**URL:** <https://gromacs.bioexcel.eu/t/wrong-compiler-when-installing-with-internally-built-fftw3/12024>\
**Category:** User discussions\
**Created:** [May 2, 2025, 4:40pm UTC](https://gromacs.bioexcel.eu/t/wrong-compiler-when-installing-with-internally-built-fftw3/12024 "2025-05-02T16:40:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luijten](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@luijten](https://gromacs.bioexcel.eu/u/luijten)\
**Post date:** [May 2, 2025, 4:40pm UTC](https://gromacs.bioexcel.eu/t/wrong-compiler-when-installing-with-internally-built-fftw3/12024/1 "2025-05-02T16:40:22Z")

</div>

GROMACS version: 2025.1  
GROMACS modification: No  
Hi!

I apologize ahead of time if this is an oversight on my part. I have a Linux system with two compilers, gcc (=v7) and gcc-11 (=v11). I set up a Gromacs build via:

cmake .. -DCMAKE\_C\_COMPILER=gcc-11 -DCMAKE\_CXX\_COMPILER=g+±11 -DGMX\_SIMD=AVX2\_256 -DREGRESSIONTEST\_DOWNLOAD=ON -DCMAKE\_INSTALL\_PREFIX=/opt/gromacs\_2025.1 -DGMX\_FFT\_LIBRARY=fftw3 -DGMX\_BUILD\_OWN\_FFTW=ON

I noticed that when FFTW3 is built, the compilation defaults to using gcc, instead of gcc-11. Only Gromacs itself is compiled with gcc-11. I can override this by setting the environment variable CC (e.g. ‘export CC=gcc-11’) before issuing the “cmake” command, but in my opinion users might expect the “CMAKE\_C\_COMPILER” setting to be propagated to the compilation of FFTW. Or does all this reflect a misconfiguration in my system?

Many thanks,

Erik

---

<div class="post-metadata">

**Author:** ![al42and](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/al42and/32/1393_2.png) [@al42and](https://gromacs.bioexcel.eu/u/al42and)\
**Post date:** [May 3, 2025, 4:01pm UTC](https://gromacs.bioexcel.eu/t/wrong-compiler-when-installing-with-internally-built-fftw3/12024/2 "2025-05-03T16:01:27Z")

</div>

Hi!

> [@luijten](#):
>
> Or does all this reflect a misconfiguration in my system?

No, nothing wrong with your system. The “build own fftw3” functionality is not very sophisticated and does the simplest thing (i.e., uses the default compiler). You really should not rely on it _too_ much (there are other known issues with it, with handling of compiler flags and the like). Nevertheless, respecting user’s compiler choice is a very reasonable assumption, so I filed a bug, [Build script for "own" FFTW3 ignores the compiler choice (#5344) · Issues · GROMACS / GROMACS · GitLab](https://gitlab.com/gromacs/gromacs/-/issues/5344).

---

<div class="post-metadata">

**Author:** ![luijten](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@luijten](https://gromacs.bioexcel.eu/u/luijten)\
**Post date:** [May 4, 2025, 5:14pm UTC](https://gromacs.bioexcel.eu/t/wrong-compiler-when-installing-with-internally-built-fftw3/12024/3 "2025-05-04T17:14:04Z")

</div>

Thank you! Much appreciated.

Erik
