Installation
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).
- Please download and unpack
nfft-3.5.2.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.2.tar.gz tar -zxf nfft-3.5.2.tar.gz
- Go to the new directory.
cd nfft-3.5.2
- 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
. - Build
make
- Optionally, unit tests may be run.
make check
- Optionally, install on your system.
make install
Windows
The following manual should work with NFFT 3.5.2 on a 64-bit Windows PC with 64-bit Matlab.
- Download and install MSYS2.
- 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
- 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.2
, replace JaneDoe by your username).wget https://www-user.tu-chemnitz.de/~potts/nfft/download/nfft-3.5.2.tar.gz tar -zxf nfft-3.5.2.tar.gz
- Open the NFFT directory in the MinGW-w64 shell
cd nfft-3.5.2
- 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. runcmd /C 'mklink /D matlab-link "C:\Program Files\MATLAB\R2018b"'
). - Compile the nfft
make
- 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 foldermingw64/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 directorynfft-3.5.2/.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.
liboctave.la
and liboctinterp.la
in the subfolder mingw64/lib/octave/5.1.0
of the Octave installation.
Run the nfft configure script
./configure --enable-all --enable-openmp --with-octave=/c/Octavewhere you replace
/c/Octave
by the path of your Octave installation.