Introduction to fftw
FFTW 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 (as well as of even/odd data, i.e. the
discrete cosine/sine transforms or DCT/DST).
Note
Development versions of BLFS may not build or run
some packages properly if LFS or dependencies have been updated
since the most recent stable versions of the books.
Package Information
Download (HTTP): https://www.fftw.org/fftw-3.3.10.tar.gz
Download MD5 sum: 8ccbf6a5ea78a16dbc3e1306e234cc5c
Download size: 4.0 MB
Estimated disk space required: 59 MB
Estimated build time: 1.6 SBU (add 3.4 SBU for tests, both using parallelism=4)
Installation of fftw
Note
We build fftw three times for different libraries in different
numerical precisions: the default double precision floating point, the
older 32-bit (single precision) version named float which sacrifices
precision for speed, and the long double which offers increased
precision at the cost of slower execution.
The first build is for double precision arithmetic. Install
fftw by running the following commands:
./configure --prefix=/usr \
--enable-shared \
--disable-static \
--enable-threads \
--enable-sse2 \
--enable-avx \
--enable-avx2 &&
make
To test the results, issue: make check.
On 32-bit systems, the tests can take substantially longer than
they would on 64-bit machines.
Now, as the root
user:
make install
Now build single precision:
make clean &&
./configure --prefix=/usr \
--enable-shared \
--disable-static \
--enable-threads \
--enable-sse2 \
--enable-avx \
--enable-avx2 \
--enable-float &&
make
As the root
user:
make install
Finally, build long double precision:
make clean &&
./configure --prefix=/usr \
--enable-shared \
--disable-static \
--enable-threads \
--enable-long-double &&
make
As the root
user:
make install
Command Explanations
--enable-shared --disable-static
: Use shared
libs instead of static libs.
--enable-threads
: This enables libfftw3_threads.so
to be compiled.
It is used by e.g. the gimp plugin from
G'MIC.
--enable-{sse2,avx,avx2}
: These enables building
the optimized routines using SSE2, AVX, and AVX2 instructions. FFTW
will check if these routines can be really used on the current CPU when
the FFTW library is loaded, so a FFTW build with these routines enabled
can still run on a CPU without SSE2, AVX, or AVX512. These options
are not compatible with --enable-long-double
.
--enable-float
: This enables building the library that
uses single precision floating point arithmetic. It is faster but less
precise than the default double precision library. The library will be
called libfftw3f.so
needed by
PulseAudio-16.1.
--enable-long-double
: This enables building the
library that uses higher precision long-double floating point arithmetic.
The library will be called libfftw3l.so
.
--enable-avx512
: This enables building the optimized
routines using AVX512F instructions. FFTW will check if these routines
can be really used on the current CPU when the FFTW library is loaded,
so a FFTW build with these routines enabled can still run on a CPU
without AVX512F. Use this option if the FFTW build will be used on
a CPU with AVX512F. This option is not compatible with
--enable-long-double
.