Help with Fortran Code Using FFTW-3.3alpha1

In summary, you installed the libray on evry computer availbale at your school and an you were able to compile yet your code. However, when you try to link the compiled code and the libraries to produce an executable, you get an error saying "undefined reference to fftw_mpi_init_". This sounds like a linker error, and you should consult the fftw documentation to find out how to build an executable that doesn't include this undefined function.
  • #1
cva
18
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
  • #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.
 
  • #3
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:
  • #4
'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!
 
  • #5
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 .
 

1. What is FFTW-3.3alpha1?

FFTW-3.3alpha1 is a software library for fast Fourier transforms (FFT) developed by the Massachusetts Institute of Technology (MIT). It is designed for efficient calculation of discrete Fourier transforms and is commonly used in scientific and engineering applications.

2. How can FFTW-3.3alpha1 be used to help with Fortran code?

FFTW-3.3alpha1 can be used in Fortran code to perform fast Fourier transforms, which are commonly used in signal processing, image processing, and data analysis. This library provides optimized algorithms for calculating FFTs, making it a valuable tool for improving the speed and accuracy of Fortran code.

3. What are the benefits of using FFTW-3.3alpha1 in Fortran code?

There are several benefits to using FFTW-3.3alpha1 in Fortran code, including improved performance and accuracy. The library also supports a wide range of input sizes and data types, making it versatile for different applications. Additionally, FFTW-3.3alpha1 is open-source and free to use, making it accessible to a wide range of users.

4. How do I integrate FFTW-3.3alpha1 into my Fortran code?

Integrating FFTW-3.3alpha1 into Fortran code involves downloading and installing the library, linking it to your Fortran code, and calling the appropriate functions to perform FFTs. The FFTW website provides detailed documentation and examples for integrating the library into various programming languages, including Fortran.

5. Are there any alternatives to FFTW-3.3alpha1 for performing FFTs in Fortran?

Yes, there are several other libraries and tools available for performing FFTs in Fortran, such as FFTPACK, FFTW++, and Intel MKL. Each of these has its own advantages and may be better suited for specific applications. It is recommended to research and compare different options before deciding on the best one for your needs.

Similar threads

  • Programming and Computer Science
Replies
4
Views
500
  • Programming and Computer Science
Replies
14
Views
4K
  • Programming and Computer Science
Replies
3
Views
983
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
13
Views
2K
  • Programming and Computer Science
Replies
4
Views
6K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
13
Views
3K
  • Programming and Computer Science
Replies
12
Views
1K
Back
Top