Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!


  1. Mar 24, 2009 #1


    User Avatar


    I've been trying for 2 weeks now to write in fortran a MPI program that computes the Fourier transform off a real matrix and then in vers transform using fftw-3.3alpha1. I installed the libray on evry computer availbale at my school and an I was able to compile yet my code. Even if the libray installs properly (libfftw.a and lifftw_mpi.a are created) when I compile my code I get error 'undefined reference to fftw_mpi_init_'.

    Does any of you manged to use fftw-3.3alpha1 to create a fortran code ?

  2. jcsd
  3. Mar 25, 2009 #2
    Which MPI library are you using? OpenMPI? And how are you compiling your code? How are you running it? There are library-specific ways of compiling and invoking MPI programs.

    Your question is way too vague to answer without some more information.
  4. Mar 25, 2009 #3


    User Avatar

    Good point. The MPI version on the server is HP-MPI v2.2.5 implementing MPI 1.2 and full MPI 2 Standard functionality.

    I compile the my codes with:
    bash-3.00$ mpif90 -show
    pgf90 -L/opt/hpmpi/lib/linux_amd64 -I/opt/hpmpi/include/64 -lhpmpio -lhpmpi -ldl

    Well I was just wondering if someone managed to make it work, before I start to invest lots of time and energy.

    Last edited: Mar 25, 2009
  5. Mar 25, 2009 #4


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    'undefined reference to fftw_mpi_init_'.

    This sounds like a linker error -- your code compiles fine, but when the linker tries to link the compiled code and the libraries to produce an executable, it discovers you either forgot to include a necessary library, or maybe you specified the libraries in the wrong order.

    Or... maybe the function really doesn't exist. I haven't used fftw, but I've heard it works as follows:

    * Build program A
    * Run program A to produce the source code for program B
    * Build program B
    * Run program B to compute FFT's.

    If I'm correct and you tried to jump straight into building program B, then it would fail, because you didn't create all of the sources program B needed!
  6. Mar 25, 2009 #5


    User Avatar

    The fftw library seems to install corectley Then as indicated in the manual the flas -lfftw3 and lfftw_3mpi are added to the compiling .
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: FFTW and MPI
  1. MPI in Fortran (Replies: 2)

  2. MPI Bcast (Replies: 3)

  3. MPI Fortran on Mac OSX (Replies: 1)