RFIF can be built in two modes:
During installation, RFIF checks whether
pkg-config can locate FFTW. If so, the package enables the
FFTW-backed build. If not, the package falls back to the non-FFTW
implementation. FFTW itself supports separate precision builds,
including long-double builds enabled with
--enable-long-double.
In the current RFIF build setup, the FFTW-enabled path
uses pkg-config to discover FFTW and links the appropriate
FFTW libraries when available. In the fallback path, the final link step
omits FFTW libraries entirely.
This vignette shows how to install FFTW so that RFIF can
use the faster path on Windows, macOS, and Linux.
It is useful to check whether FFTW is already visible to
pkg-config:
If these commands succeed, RFIF should generally detect
FFTW during installation. If they fail, install FFTW and, if needed,
update PKG_CONFIG_PATH.
You can also inspect the default pkg-config search
path:
And you can search for the FFTW pkg-config file directly:
FFTW’s Windows installation notes continue to recommend a MinGW-style toolchain rather than a native Windows-specific package-manager workflow.
A common route is:
pkg-config can find fftw3l.pc.After unpacking the FFTW source, a typical build is:
If the installation places fftw3l.pc outside the default
pkg-config search path, set PKG_CONFIG_PATH.
For example:
Then verify:
If Windows installation proves cumbersome, RFIF can
still be installed in fallback mode, described below. FFTW’s own Windows
documentation remains centered on MinGW-style builds, so this is usually
the most reliable route when FFTW speed is needed.
On macOS, the easiest installation path is usually Homebrew:
After installation, check:
If pkg-config still cannot find FFTW, inspect the search
path and locate the .pc file:
pkg-config --variable pc_path pkg-config
find /opt/homebrew /usr/local /opt/local -name 'fftw3l.pc' 2>/dev/nullTypical macOS settings are:
For Apple Silicon Homebrew:
For Intel Homebrew:
FFTW can also be built from source on macOS using the same standard Unix build steps:
Install FFTW development headers and pkg-config
with:
Then verify:
Install:
Then verify:
If your distribution packages are unavailable or unsuitable, build FFTW from source:
If installed into a nonstandard prefix, update
PKG_CONFIG_PATH. A common setting is:
Once FFTW is visible through pkg-config, install
RFIF normally:
On a successful FFTW-enabled build, the configure step should report that FFTW was found, and the final link step should include FFTW libraries.
To test or use the non-FFTW build explicitly:
In the fallback path, the configure step should report that
pkg-config is disabled and the final link step should omit
FFTW libraries.
Fallback mode is useful when:
pkg-config cannot find FFTW,pkg-config cannot find fftw3lCheck:
pkg-config --variable pc_path pkg-config
find /usr /usr/local /opt/local /opt/homebrew -name 'fftw3l.pc' 2>/dev/nullIf fftw3l.pc exists but is outside the search path,
export PKG_CONFIG_PATH to the containing directory.
Check the exact flags returned by pkg-config:
If headers and libraries come from different installation prefixes, installation may fail or pick up inconsistent flags.
You can capture the installation log for inspection.
Normal build:
Fallback build:
In a normal build, the configure output should indicate that FFTW was found and the final link line should include FFTW libraries. In a fallback build, the configure output should indicate that fallback FFT is being used and the final link line should omit FFTW libraries.
RFIF supports both an FFTW-backed build and a fallback
build.
brew install fftw is usually
the simplest solution.libfftw3-dev
and pkg-config.fftw-devel and
pkgconf-pkg-config.RFIF can still build in
fallback mode.