FFTW is a free software library that computes the discrete Fourier transform (DFT) and its variants. It uses an adaptive planner to optimize algorithms for different hardware in order to maximize performance, unlike vendor-optimized programs which are tuned to specific machines. The planner takes a problem description without data and produces a plan calling optimized code fragments ("codelets") to directly solve DFT problems when they are sufficiently simple. Users can generate custom codelets with a special-purpose compiler called genfft, which automatically derives optimized implementations from high-level mathematical descriptions of DFT algorithms.