[petsc-users] How to build FFTW3 interface?

Balay, Satish balay at mcs.anl.gov
Thu Apr 11 21:02:01 CDT 2019

On Thu, 11 Apr 2019, Sajid Ali via petsc-users wrote:

> Hi PETSc Developers,
> To run an example that involves the petsc-fftw interface, I loaded both
> petsc and fftw modules (linked of course to the same mpi) but the compiler
> complains of having no knowledge of functions like MatCreateVecsFFTW which
> happens to be defined at (in the source repo)
> petsc/src/mat/impls/fft/fftw.c. 

Sure. Unless petsc is built with fftw enabled - this interface is not enabled.

> I don't see a corresponding definition in
> the install folder (I may be wrong, but i just did a simple grep to find
> the definition of the function I'm looking for and didn't find it while it
> was present in the header and example files).
> >From previous threads on this list-serv I see that the developers asked
> users to use --download-fftw at configure time, but for users that already
> have an fftw installed, is there an option to ask petsc to build the
> interfaces as well (I didn't see any such option listed either here:
> https://www.mcs.anl.gov/petsc/documentation/installation.html or a variant
> in spack) ?

If you are build petsc from source the configure option is --with-fftw-dir=/location

or let petsc install it with --download-fftw.

> Also, could the fftw version to download be bumped to 3.3.8 (here :
> petsc/config/BuildSystem/config/packages/fftw.py) since 3.3.7 gives
> erroneous results with gcc-8.
> Bug in fftw-3.3.7+gcc-8 :
> https://github.com/FFTW/fftw3/commit/19eeeca592f63413698f23dd02b9961f22581803

Wrt petsc configure - you can try:
./configure --download-fftw=http://www.fftw.org/fftw-3.3.8.tar.gz

Wrt spack - you can try the branch 'balay/petsc-fftw' and see if it works for you

spack install petsc+fftw


More information about the petsc-users mailing list