[petsc-users] configure error with fftw and without mpi

Barry Smith bsmith at petsc.dev
Thu Nov 25 10:27:54 CST 2021


  PETSc's install and use of fftw always requires MPI. 

  The code in config/BuildSystem/config/packages/fftw.py and src/mat/impls/fft/fftw/fftw.c could relatively easily be "fixed" to also support building and using FFTW without MPI.  

   Just change the fftw.py to conditionally pass in args.append('--enable-mpi') if self.mpi.found and change  

 self.deps = [self.mpi,self.blasLapack]

 to 

 self.deps = [self.blasLapack] 
 self.odeps = [self.mpi]

and in fftw.c add #if defined(PETSC_HAVE_MPI) around the parts of the code that depend on MPI.

We'd welcome a merge request with these enhancements.

Barry


> On Nov 25, 2021, at 5:15 AM, Fabio Rossi via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> I am trying to compile petsc with the following options (Gentoo build system):
> 
> ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64/petsc/lib64 scrollOutput=1 FFLAGS=-O2 -pipe -fPIC CFLAGS=-march=core2 -O2 -pipe -fPIC CXXFLAGS=-march=core2 -O2 -pipe -fPIC LDFLAGS=-Wl,-O1 -Wl,--as-needed --prefix=/usr/lib64/petsc --with-shared-libraries --with-single-library --with-clanguage=c --with-petsc-arch=linux-gnu-c-opt --with-precision=double --with-gnu-compilers --with-blas-lapack-lib=-lblas -llapack  --with-debugging=0 --with-mpi=0 --with-cc=x86_64-pc-linux-gnu-gcc --with-cxx=x86_64-pc-linux-gnu-g++ --with-fortran=1 --with-fc=x86_64-pc-linux-gnu-gfortran --with-mpi-compilers=0 --with-scalar-type=real --with-windows-graphics=0 --with-matlab=0 --with-cmake:BOOL=1 --with-pthread=1 --with-afterimage=0 --without-hdf5 --with-hypre=0 --without-suitesparse --with-superlu=0 --with-x --with-x11 --with-ptscotch=0
>  --with-
> scalapack=0 --without-mumps --with-imagemagick=0 --with-python=0 --with-boost --with-fftw
> 
> so MPI support is disabled, and I get the following configure error:
> 
> TESTING: consistencyChecks from config.packages.fftw(/var/tmp/portage/sci-mathematics/petsc-3.15.0/work/petsc-3.15.0/config/BuildSystem/config/package.py:963)
> TESTING: checkDependencies from config.packages.fftw(/var/tmp/portage/sci-mathematics/petsc-3.15.0/work/petsc-3.15.0/config/BuildSystem/config/package.py:872)
> *******************************************************************************
>         UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for details):
> -------------------------------------------------------------------------------
> Did not find package MPI needed by fftw.
> Enable the package using --with-mpi
> 
> Isn't MPI optional? Where is the error coming from?
> 
> If I disable fftw then it compiles successfully.
> 
> Fabio



More information about the petsc-users mailing list