Content Hotkeys
Nonequispaced fast Fourier transform


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

Linux or macOS

  1. Please download and unpack nfft-3.4.1.tar.gz from the Download page. In the following, we work with a bash-compatible shell.
    tar -zxf nfft-3.4.1.tar.gz
  2. Go to the new directory.
    cd nfft-3.4.1
  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.4.1 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 update your installation and install the MinGW-w64 toolchain and FFTW
    pacman -Syuu
    pacman -S mingw-w64-x86_64-toolchain 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.4.1, replace JaneDoe by your username).
  4. Open the NFFT directory in the MinGW-w64 shell
    cd nfft-3.4.1
  5. Run the configure script
    ./configure --enable-all --enable-openmp --with-matlab=/c/Programme/MATLAB/R2017b
    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.
  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.4.1/.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 the Dependecy Walker.
    Note: When running Matlab, the dll files should be in your current Matlab directory, adding it the Matlab path might be insufficient.