Including FFTW3 in a Project

FFTW (Fastest Fourier Transform in the West) is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data. For more info, visit http://fftw.org.

This KB Article References: High Performance Computing
This Information is Intended for: Instructors, Researchers, Staff
Created: 01/18/2017 Last Updated: 05/15/2024

FFTW version 3.3.7 is available for use with both intel and gcc compilers.  Two environment variables are created upon loading the fftw3/openmpi/gcc/64/3.3.7 module.  $FFTWINCLUDE stores the include path for the headers.  $FFTWDIR stores the linked library path.

Whether compiling for intel, pass the appropriate flags:

mpiicc my_project.c –o my_project –l fftw3 –I $FFTWINCLUDE –L $FFTWDIR

This will make sure that your program finds the fftw3.h header and the linked library.

The same can be done with gcc, but libm must also be linked:

mpicc my_project.c –o my_project –l fftw3 –I $FFTWINCLUDE –L $FFTWDIR -lm

For More Information Contact


IACS Support System

Still Need Help? The best way to report your issue or make a request is by submitting a ticket.

Request Access or Report an Issue