# Gromacs and FFTW library

**URL:** <https://gromacs.bioexcel.eu/t/gromacs-and-fftw-library/8617>\
**Category:** User discussions\
**Created:** [March 15, 2024, 12:41pm UTC](https://gromacs.bioexcel.eu/t/gromacs-and-fftw-library/8617 "2024-03-15T12:41:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Newsky](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@Newsky](https://gromacs.bioexcel.eu/u/Newsky)\
**Post date:** [March 15, 2024, 12:41pm UTC](https://gromacs.bioexcel.eu/t/gromacs-and-fftw-library/8617/1 "2024-03-15T12:41:30Z")

</div>

GROMACS version: 2023.3  
GROMACS modification: Yes/No

I am trying to get some prints out of what is happening inside the FFTW when Gromacs is running.

I have built Gromacs with -DGMX\_BUILD\_OWN\_FFTW=ON  
Running CMake gives:  
– The GROMACS-managed build of FFTW 3 will configure with the following optimizations: --enable-sse2;–enable-avx;–enable-avx2  
– Using external FFT library - FFTW3 build managed by GROMACS

I have located the downloaded FFTW sources and the object files, and I was able to rebuild those separately. However, gromacs build system does not recognize these changes and it is still using the “old” version of static library even after rebuilding the gromacs.

Any ideas how to achieve this easily?

Thanks,

T

---

<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:** [March 21, 2024, 8:23pm UTC](https://gromacs.bioexcel.eu/t/gromacs-and-fftw-library/8617/2 "2024-03-21T20:23:27Z")

</div>

Hi!

Perhaps the easiest solution would be to build FFTW separately and use `-DFFTWF_INCLUDE_DIR=/path/to/include -DFFTWF_LIBRARY=/path/to/lib/libfftw3f.so -DGMX_BUILD_OWN_FFTW=OFF`.

`GMX_BUILD_OWN_FFTW` is a basic convenience for building on systems without pre-installed FFTW, and this mechanism is not suitable for any advanced usage. You can try changing the [`GMX_BUILD_OWN_FFTW_URL` value](https://gitlab.com/gromacs/gromacs/-/blob/1e00b953415828ab858321a090ace20c32152b69/src/external/build-fftw/CMakeLists.txt) (it can be just a path to a file) if you cannot use the external FFTW.
