Skip to content
forked from pyNFFT/pyNFFT

A pythonic wrapper around the NFFT library (M1 Mac)

License

Notifications You must be signed in to change notification settings

rohandahale/pyNFFT

 
 

Repository files navigation

PyNFFT - Pythonic bindings around the NFFT library (M1 Mac)

"The NFFT is a C subroutine library for computing the nonequispaced discrete Fourier transform (NDFT) in one or more dimensions, of arbitrary input size, and of complex data."

The NFFT library is licensed under GPLv2.

This wrapper provides a somewhat Pythonic access to some of the core NFFT library functionalities and is largely inspired from the pyFFTW project developped by Henry Gomersall (http://hgomersall.github.io/pyFFTW/).

The documentation is hosted on pythonhosted, the source code is available on github and the Python package index page is here.

Installation only for M1 Mac (MacOS > v12.0)

Step-by-step installation instructions

  1. Install fftw
    1. You need gcc compiler for installing fftw with --enable-openmp. The gcc in M1 Mac (MacOS > v12.0) actually points to clang

      Install gcc-12 with brew:

      brew install gcc@12
      
    2. Download FFTW 3.3.10 from fftw.org and extract the folder

    3. cd into the fftw folder and using this configuration:

      ./configure CC="gcc-12" --enable-shared --enable-threads --enable-openmp
      sudo make
      sudo make check
      sudo make install
      
    4. Check /usr/local/lib/ and /usr/local/include/ to see if fftw3 is installed.

  2. Install NFFT
    1. You need autoconf automake libtool for this step. Install it with:

      brew install autoconf automake libtool
      

      Make sure you edit your .zshrc tp add it your PATH

    2. Clone the NFFT git repository:

      git clone https://github.com/NFFT/nfft.git
      
    3. cd into the NFFT folder and using this configuration:

      ./bootstrap.sh
      ./configure CC="gcc-12" --enable-all --enable-openmp --enable-shared --with-fftw3-libdir=/usr/local/lib/ --with-fftw3-includedir=/usr/local/include/
      sudo make
      sudo make check
      sudo make install
      
    4. Check /usr/local/lib/ and /usr/local/include/ to see if nfft is installed.

  3. Install pyNFFT
    1. Clone this repository:

      git clone https://github.com/rohandahale/pyNFFT.git
      
    2. Install cython with pip or conda to run this setup.py:

      pip install Cython==0.29.32
      

      or:

      conda install -c anaconda cython==0.29.32
      
    3. cd into pyNFFT folder and build pynfft from setupy.py using:

      python setup.py build_ext -I /usr/local/include/ -L /usr/local/lib/ -R /usr/local/lib/
      
    4. While being inside the folder, install pynfft with:

      python -m pip install .
      

      or:

      pip install .
      
    5. Done.

Usage

See the tutorial section of the documentation.

Requirements

  • Python 2.7 or greater (recommended 3.8.16)
  • Numpy 1.6 or greater (recommended 1.21.1)
  • NFFT library 3.2 or greater, compiled with openMP support
  • Cython 0.12 or greater (recommended 0.29.32)

Contributing

See the CONTRIBUTING file.

License

The pyNFFT project is licensed under the GPLv3. See the bundled COPYING file for more details.

About

A pythonic wrapper around the NFFT library (M1 Mac)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Cython 71.9%
  • Python 28.1%