Fortran Help with Fortran Code Using FFTW-3.3alpha1

  • Thread starter Thread starter cva
  • Start date Start date
  • Tags Tags
    Code Fortran
AI Thread Summary
The discussion revolves around troubleshooting a Fortran MPI program that computes the Fourier transform using the FFTW library. The user has encountered a linker error, specifically 'undefined reference to fftw_mpi_init_', despite successfully installing the FFTW library. They are using HP-MPI v2.2.5 and compiling with mpif90, but face challenges in linking the necessary libraries correctly. Suggestions indicate that the issue may stem from either missing libraries or incorrect library order during compilation. Additionally, there is a mention of the FFTW library's operational structure, implying that the user may need to follow specific steps to build their program correctly. The conversation emphasizes the importance of ensuring all required sources and libraries are included in the build process.
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 .
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top