I am currently learning to use fftw3-mpi. I followed the 2D example from http://www.fftw.org/fftw3_doc/2d-MPI-example.html but I receive an error saying
/usr/local/lib/libfftw3_mpi.so: undefined reference to fftw_ialignment_of
The problem occurs when calling the function fftw_mpi_init()
#include <mpi.h>
#include <fftw3-mpi.h>
int main(int argc, char **argv)
{
const ptrdiff_t N0 = 32, N1 = 32;
fftw_plan plan;
fftw_complex *data;
ptrdiff_t alloc_local, local_n0, local_0_start, i, j;
MPI_Init(&argc, &argv);
fftw_mpi_init(); // problem occurs here
MPI_Finalize();
return 0;
}
I have looked into /usr/local/lib/ and there indeed is libfftw3_mpi.so so I am not to sure what the problem is. I have also tried reinstalling fftw3 (with mpi enabled), but it doesn't solve the problem.
The code is compiled with the link -lfftw3_mpi -lfftw3 -lm , so here is my line to compile.
mpiCC fftwmpi.cpp -o test.o -lfftw3_mpi -lfftw3 -lm
Any comment is appreciated. Thank you
ldd test.o
says ? what if youmpirun -np 1 ldd test.o
? last but not least, what doesnm /usr/local/lib/libfftw3.so | grep fftw_ialignment_of
says? – Gilles Gouaillardet