Help with Fortran Code Using FFTW-3.3alpha1

  • Context: Fortran 
  • Thread starter Thread starter cva
  • Start date Start date
  • Tags Tags
    Code Fortran
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting a Fortran MPI program that utilizes the FFTW-3.3alpha1 library for computing Fourier transforms. Participants are addressing issues related to compilation and linking errors encountered during the development process.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports an 'undefined reference to fftw_mpi_init_' error when compiling their Fortran code, indicating a potential issue with linking the FFTW library.
  • Another participant inquires about the specific MPI library being used and the compilation process, suggesting that there are library-specific methods for compiling MPI programs.
  • A participant clarifies that they are using HP-MPI v2.2.5 and provides details on their compilation command, expressing concern about investing more time without confirmation of success from others.
  • Multiple participants suggest that the error may be a linker issue, possibly due to missing libraries or incorrect order of library specifications during the linking stage.
  • One participant speculates on the FFTW library's operational structure, suggesting that there may be a need to build multiple programs in sequence, which could lead to the reported error if not followed correctly.
  • Another participant reiterates the possibility of a linker error and emphasizes the importance of including the correct libraries as indicated in the FFTW manual.

Areas of Agreement / Disagreement

Participants express varying opinions on the cause of the linking error, with some attributing it to potential misconfiguration in the compilation process and others suggesting it may relate to the FFTW library's usage. No consensus is reached on a definitive solution.

Contextual Notes

There are unresolved questions regarding the specific configuration of the MPI environment and the exact steps taken in the compilation process, which may affect the ability to successfully link the FFTW library.

cva
Messages
17
Reaction score
0
Hello,

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 ?

cva
 
Technology news on Phys.org
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.
 
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 -ldlWell I was just wondering if someone managed to make it work, before I start to invest lots of time and energy.

cva
 
Last edited:
'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!
 
Hurkyl said:
'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!

The fftw library seems to install corectley Then as indicated in the manual the flas -lfftw3 and lfftw_3mpi are added to the compiling .
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 17 ·
Replies
17
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K