mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]

Instructions for building and installing the FFTW library

The FFTW library is probably available from your software/package manager, however I recommend building it yourself to ensure it is fullly optimized for your system, and that you have all of the precisions available.

Build and Install

Folow these steps to build the FFTW library.

  1. download, the latest FFTW library from http://www.fftw.org/
    Note
    As of 2017-03-01 the minimum acceptable version is 3.3.5 (for mxlib).
  2. Unpack the tar-ball.
  3. Build fftw. This requires building each of the precisions and threading possibilities. The commands do this are below. You can also download this script which will perform each of these.
    • To build single precision:
             $ ./configure --enable-float --with-combined-threads --enable-threads --enable-shared
             $ make -j
             $ sudo make install
    • To build double precision:
             $ ./configure --with-combined-threads --enable-threads --enable-shared
             $ make -j
             $ sudo make install
    • To build long double precision:
             $ ./configure --enable-long-double --with-combined-threads --enable-threads --enable-shared
             $ make -j
             $ sudo make install
    • To build quad (__float128) precision:
             $ ./configure --enable-quad-precision --with-combined-threads --enable-threads --enable-shared
             $ make -j
             $ sudo make install

FFTW Environment

mxlib will manage the FFTW environment for you, which really means importing and exporting wisdom and cleaning up memory. This can be done in a simple way using mx::math::fft::fftwEnvironment. To make the best use of this, create a directory to store FFTW wisdom. I typically use

$(HOME)/.fftw 

Then add the environment variable to you bash profile (i.e. in .bash_profile or .bash_aliases) as so

export MXFFTW_WISDOM=/path/to/.fftw

Using this facility requires only that you create an object of type mx::math::fft::fftwEnvironment at the beginning of the program for the real floating point type you are using. See the documentation for mx::math::fft::fftwEnvironment for details.