Jump to main content
Nonequispaced fast Fourier transform


We offer compiled binaries of the NFFT library and Matlab and Julia interfaces on the Download page . The following steps are only necessary if you want to compile the NFFT by yourself.

Linux or macOS

The NFFT depends on the FFTW library, which is available for many Linux distros. If you compile the FFTW yourself, it should be configured --enable-shared in order to build the shared NFFT (default).

  1. Please download and unpack nfft-3.5.3.tar.gz from the Download page . In the following, we work with a bash-compatible shell.
    wget https://www-user.tu-chemnitz.de/~potts/nfft/download/nfft-3.5.3.tar.gz
    tar -zxf nfft-3.5.3.tar.gz
  2. Go to the new directory.
    cd nfft-3.5.3
  3. Run the configure script
    ./configure --enable-all --enable-openmp
    Alternatively, you might run the configure script for Matlab
    ./configure --enable-all --enable-openmp --with-matlab=/path/to/matlab
    Here are some useful optional flags:
    --enable-all specifies that all modules should be compiled,
    --enable-openmp enables the multicore support.
    --with-matlab=path/to/matlab specifies a path of Matlab, and
    --with-octave=path/to/octave does the same for GNU Octave.
    For a list of all available options, you can run ./configure --help.
  4. Build
  5. Optionally, unit tests may be run.
    make check
  6. Optionally, install on your system.
    make install


The following manual should work with NFFT 3.5.3 on a 64-bit Windows PC with 64-bit Matlab.

  1. Download and install MSYS2.
  2. Start the MinGW-w64 Win64 Shell, and type the following to install the compiler and FFTW
    pacman -S mingw-w64-x86_64-gcc tar make mingw-w64-x86_64-fftw
  3. Download and unpack the NFFT source code from the Download page to your MSYS2 home directory (e.g. C:/msys64/home/JaneDoe/nfft-3.5.3, replace JaneDoe by your username).
    wget https://www-user.tu-chemnitz.de/~potts/nfft/download/nfft-3.5.3.tar.gz
    tar -zxf nfft-3.5.3.tar.gz
  4. Open the NFFT directory in the MinGW-w64 shell
    cd nfft-3.5.3
  5. Run the configure script
    ./configure --enable-all --enable-openmp --with-matlab=/c/Programme/MATLAB/R2018b
    Here are some useful optional flags:
    --enable-all says that all modules should be compiled,
    --enable-openmp enables the multicore support.
    --with-matlab=/c/path/to/matlab specifies a path of Matlab.
    For a list of all available options, you can run ./configure --help.
    Note: You might run into trouble if the path of your Matlab installation contains a space (e.g. C:\Program Files). An easy way to overcome this is creating a link to your Matlab directory (e.g. run cmd /C 'mklink /D matlab-link "C:\Program Files\MATLAB\R2018b"').
  6. Compile the nfft
  7. The compiled programs need the proper libraries to run correctly, i.e., they require libfftw3-3.dll, libwinpthread-1.dll, libgcc_s_seh-1.dll, libgomp-1.dll (all in the folder mingw64/bin, the latter two are only required if openmp is enabled in the configure script). For some executebles, you might also need the .dll file from the directory nfft-3.5.3/.libs. The easiest way to add these libraries is to copy them all in the same directory you run the executeble from. Alternatively, you can put the dll files in a directory added to the Windows %PATH% environment variable (see also How do I set or change the PATH system variable?). When having problems with dependecies, check out Dependecies.
    Note: When running Matlab, the dll files should be in your current Matlab directory, adding it the Matlab path might be insufficient.

With Octave interface: For Octave 7.1.0, there may be some problems with the official builds. You can circumvent this by deleting the the files liboctave.la and liboctinterp.la in the subfolder mingw64/lib/octave/7.1.0 of the Octave installation. Run the nfft configure script

./configure --enable-all --enable-openmp --with-octave=/c/Octave

where you replace /c/Octave by the path of your Octave installation.

When working with development code from Github instead of the release, you have to install additional libraries and run bootstrap before configure (step 5 above).

pacman -S --needed autoconf perl libtool automake mingw-w64-x86_64-cunit