ghisvail/pyNFFT — pull request #28 by cmarquardt (2014-05-21 23:14:25+00:00)
Title: Support unthreaded fftw and nfft libraries

This is a follow up from issue #27...

On some platforms (like Mac OS-X mavericks with Apple's XCode / clang compiler), the native compiler does not support openmp, so the `nfft` library can't be build in it's parallel / threaded implementation. On other installations, a threded version of the `fftw` library might not be available (as on the Windows system in issues #16 of pyNFFT's issue queue).

I think it would be useful if users would be able to control if the multi-threaded versions of the underlying C libraries are used when building pyNFFT without having to patch the hardcoded library settings in `setup.py`.

In this pull request, I have added options to the `setup.cfg` file which allow to specify the use of threaded libraries for fftw and nfft individually (for documentation, see the newly added `setup.cfg.template` file). It's also possible to set environment variables `USE_FFTW_THREADED` and `USE_NFFT_THREADED` to control the linking, where the environment variables (if being set) will override any settings in setup.cfg. The default behaviour still is to link against the threaded versions of both FFTW and NFFT. The implementation is based on a similar approach in the netcdf4 module for python https://github.com/Unidata/netcdf4-python).

Examples:

python setup.py install # build & install w/nfft_threaded, fftw_threaded, and fftw libs
USE_NFFT_THREADED=No python setup.py install # build & install w/ nfft, fftw_threaded and fftw libs