nbpr_fftw_double
Library for computing Fast Fourier Transforms, double precision.
fftw packaged for Nerves. Tracks the upstream
Buildroot fftw-double package — this release wraps 3.3.10.
Licence: GPL-2.0-or-later.
Usage
Add this package to your Nerves project's mix.exs:
{:nbpr_fftw_double, "~> 3.0"}
Run mix deps.get, then mix firmware. The full consumer flow —
including the firmware: alias that pulls binaries ahead of the
firmware build, and supervision-tree wiring for daemon-bearing
packages — lives in the NBPR Getting Started
guide. The fastest
path to a working setup is mix igniter.install nbpr.
Which precision do I want?
Buildroot builds each fftw precision as a separate package from one tarball, each producing its own library with its own soname, and NBPR follows that split. Pick by which library your code links:
| Package | Library | Symbols | Link flag |
|---|---|---|---|
nbpr_fftw_double |
libfftw3.so.3 |
fftw_* |
-lfftw3 |
nbpr_fftw_single |
libfftw3f.so.3 |
fftwf_* |
-lfftw3f |
This is the one to take if you just want "FFTW" and aren't sure: it's
what -lfftw3 and the plain fftw_* API refer to, and it's the
precision Buildroot itself defaults to.
The two don't conflict. Code that links both — as Eigen's FFT bindings do — wants both packages in the firmware:
{:nbpr_fftw_double, "~> 3.0"},
{:nbpr_fftw_single, "~> 3.0"}
Buildroot also has long-double and quad-precision variants. Neither is
packaged here yet; quad is x86-only in any case, since kconfig hides it
without gcc's __float128.
Why it exists
No Nerves system ships fftw. Checked against the built system artefacts
for rpi4 2.1.0, rpi5 0.7.0 and bbb 2.29.5 — none has any
libfftw3* in staging.
The library also isn't much use to a NIF unless the headers and the
.so symlink are available at cross-compile time, so this package's
staging slice carries both, alongside the runtime library that lands in
the rootfs.
Configuration
Build options can be overridden in your app's config/target.exs:
config :nbpr_fftw_double, build_opts: [fast: true]
fast builds with -O3 -ffast-math, trading accuracy for speed. It's
off by default, matching Buildroot — say yes only if you need the speed
and can live with inaccurate results.
Source: https://github.com/jimsynz/nbpr.