Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6834 Discussions

Compile errors of mpif90 for a MPI Fortran with FFTW3 code


I have a fortran code using MPI and calling FFTW3. It can be successfully compiled by the command mpiifort. But when I try to use mpif90, it gives errors like:

fftwtest_fwd.f90:(.text+0x2a6): undefined reference to `fftw_mpi_init'
fftwtest_fwd.f90:(.text+0x2e7): undefined reference to `fftw_mpi_local_size_2d_f03'
fftwtest_fwd.f90:(.text+0x2f7): undefined reference to `fftw_alloc_complex'
fftwtest_fwd.f90:(.text+0x46e): undefined reference to `fftw_mpi_plan_dft_2d_f03'
fftwtest_fwd.f90:(.text+0x630): undefined reference to `fftw_mpi_execute_dft'
fftwtest_fwd.f90:(.text+0x937): undefined reference to `fftw_destroy_plan'
fftwtest_fwd.f90:(.text+0x93c): undefined reference to `fftw_mpi_cleanup'
fftwtest_fwd.f90:(.text+0x948): undefined reference to `fftw_free'

I compile the code using my laptop, the parallel studio xe 2017 has been installed.

However, when I use mpiffort and mpif90 compile the same code on a server of my organization, everything is good. Could someone give me directions? Thank you very much.

0 Kudos
1 Reply

A possible reason of the failure on your laptop is because the cluster component of MKL is not installed. The cluster component, which includes MPI support for FFT, scaLAPACK, parallel direct sparse solver for clusters, and so on, is not installed by default. You'd have to re-run the installer and manually select the cluster component to be installed.

0 Kudos