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 distributions. If you compile the FFTW yourself, it should be configured with
--enable-shared in order to build the shared NFFT (default).
- Please download and unpack
nfft-3.5.3.tar.gzfrom 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
- Go to the new directory.
cd nfft-3.5.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-allspecifies that all modules should be compiled,
--enable-openmpenables the multicore support,
--with-matlab=path/to/matlabspecifies a path of Matlab, and
--with-octave=path/to/octavedoes 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.3 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.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
- Open the NFFT directory in the MinGW-w64 shell
cd nfft-3.5.3
- Run the configure script
./configure --enable-all --enable-openmp --with-matlab=/c/Programme/MATLAB/R2018b
Here are some useful optional flags:
--enable-allsays that all modules should be compiled,
--enable-openmpenables the multicore support,
--with-matlab=/c/path/to/matlabspecifies 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 executables, you might also need the.dllfile from the directorynfft-3.5.3/.libs. The easiest way to add these libraries is to copy them all into the same directory you run the executable 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 dependencies, check out Dependencies.
Note: When running Matlab, the dll files should be in your current Matlab directory; adding it to 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 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 ./bootstrap.sh