# Modifying the FFTW3 port



## sprock (Oct 11, 2020)

Hello,
I'm trying to modify the math/fftw3 port to enable building the MPI versions of the libraries with MPICH (the current port already has an option to build with OpenMPI).  I modified the port by adding this section to the Makefile:


```
MPI_DESC=                       Build MPICH parallel libraries
MPI_LIB_DEPENDS=                libmpi.so:net/mpich
MPI_CONFIGURE_ENABLE=           mpi
MPI_CONFIGURE_ENV=              MPICC=${LOCALBASE}/bin/mpicc \
                                MPIRUN=${LOCALBASE}/bin/mpirun
```

I test the build using:

sudo poudriere testport -j 114amd64 -p default -o math/fftw3

The test fails and the log says:


```
--Begin OPTIONS List---
===> The following configuration options are available for fftw3-3.3.8_7:
     G77_WRAPPERS=off: Alter Fortran wrappers for use with g77
     MPI=on: Build MPICH parallel libraries
     OPENMP=on: Build OpenMP multithreaded libraries
     OPENMPI=off: Build OpenMPI parallel libraries
     OPTIMIZED_CFLAGS=on: Use extra compiler optimizations
     SIMD=on: Use CPU-specific optimizations
===> Use 'make config' to modify these settings
---End OPTIONS List---
```

So, MPI is shown as being on.  But then the configure script output shows MPI being turned on then off:


```
--CONFIGURE_ARGS--
--enable-shared --enable-threads --disable-fortran --enable-mpi --enable-openmp --disable-mpi --enable-sse2 --prefix=/usr/local ${_LATE_CONFIGURE_ARGS}
--End CONFIGURE_ARGS--
```

I can't figure out where '--disble-mpi' is coming from.  I can build fftw3 outside the ports system and it finds and uses MPICH, so I don't think the problem is inherent to fftw3.

I would appreciate any help in debugging this.

Thanks,
sprock


----------



## SirDice (Oct 12, 2020)

sprock said:


> I can't figure out where '--disble-mpi' is coming from.


OPENMPI is off, which sets this option.


```
OPENMPI_DESC=                   Build OpenMPI parallel libraries
OPENMPI_LIB_DEPENDS=            libmpi.so:net/openmpi
OPENMPI_CONFIGURE_ENABLE=       mpi
OPENMPI_CONFIGURE_ENV=          MPICC=${MPIDIR}/bin/mpicc \
 	                                MPIRUN=${MPIDIR}/bin/mpirun
```









						Chapter 5. Configuring the Makefile
					

Configuring the Makefile for FreeBSD Ports




					www.freebsd.org


----------



## sprock (Oct 21, 2020)

Thank you!


----------

