Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

FFT in Fortran

alastor
Beginner
2,151 Views

Hi,

I just started with usin IFORT and MKL, so I don't have a lot of experiences with them.

I have a code in fortran, which uses mkl for FFT. I try to compile it on my computer. I installed IFORT ver. 10.1.018 nad MKL ver. 10.0.5.025. I compile like this:

ifort -w95 -cm -O3 -align -o prog prog.f /opt/intel/mkl/10.0.5.025/lib/32/libmkl_intel.a -lpthread -Vaxlib

However, I receive an error:

/tmp/ifortSI5ZwN.o: In function `MAIN__':
prog.f:(.text+0x1465): undefined reference to `zfft2d_'
...

This code has been written before several years and probably it uses another version of MKL and compiller. In the original makefile which comes with code is compilation written in this way:

efc -w95 -cm -O3 -align -o prog prog.f /opt/intel/mkl/lib/64/libmkl_itp.a -lpthread -Vaxlib

Shoud I link some other files or libraries or change something in the code?

Thank you very much for your help.

0 Kudos
6 Replies
Gennady_F_Intel
Moderator
2,152 Views
Hi, no you don't change the code but you have to link some others libraries. All needed linking examples you can find in userguide ( for example, please see chapter 5 -Linking Your Application with MKL"
--GIF

0 Kudos
alastor
Beginner
2,152 Views

I linked everything what I found is connected to fast fourier transformation, but I have always the same error statement :-(

0 Kudos
alastor
Beginner
2,152 Views

Hello,

I installed now the latest version of IFORT 11.0 including also MKL.

I built also the interface libaries for FFT (fftw2xf_intel and fftw2xc_intel).

I am compiling now like this:

ifort -w95 -cm -O3 -align -o prog prog.f -I/opt/intel/Compiler/11.0/069/mkl/include/fftw -L/opt/intel/Compiler/11.0/069/mkl/lib/em64t -lguide -lpthread -lfftw2xf_intel -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_cdft -lmkl_cdft_core -lmkl_solver -lmkl_em64t -Vaxlib

(probably there are more libraries as needed, but I want to reasure myself, that everything is there)

and I receive the same error statement:

/tmp/ifortM7tn7N.o: In function `MAIN__':
prog.f:(.text+0x343e): undefined reference to `zfft2d_'
prog.f:(.text+0x345f): undefined reference to `zfft2d_'
prog.f:(.text+0x3480): undefined reference to `zfft2d_'
prog.f:(.text+0x391b): undefined reference to `zfft2d_'
prog.f:(.text+0x393c): undefined reference to `zfft2d_'
/tmp/ifortM7tn7N.o:prog.f:(.text+0x395d): more undefined references to `zfft2d_' follow
make: *** [prog] Error 1

Does anybody know how to solve this??? I don't know whare the problem could be and what to do more :-(

Thank you very much

0 Kudos
Todd_R_Intel
Employee
2,152 Views
The zfft2d function was one of several FFT functions that we discontinued after introducing our new interface several years ago. Please check out the new interface that is described in Chapter11, Fast Fourier Transforms,in the reference manual doc/mklman.pdf.
-Todd
0 Kudos
antony
Beginner
2,152 Views
The zfft2d function was one of several FFT functions that we discontinued after introducing our new interface several years ago. Please check out the new interface that is described in Chapter11, Fast Fourier Transforms,in the reference manual doc/mklman.pdf.
-Todd

Please can we have the old interface back? The new interface is complicated, and in fortran horrible (you have to use EQUIVALENCE to call it; not obvious how to do this will allocatable arrays).

I have well tested code using the old routines which worked fine - why make more work, probably introducing lots of new bugs. If you can't add it to MKL again, could you please post the wrapper code and instructions so we can wrap it ourself? (i.e. still compile old code without having to go through and replace every FFT call).

Or I suppose provide a copy of version MKL 9?

Thank you.

0 Kudos
antony
Beginner
2,152 Views

PS. for anyone else wanting to get old code working, this is the cleanest FFT module I could find:

http://users.bigpond.net.au/amiller/singlton.f90

(though only complex-complex and not optimized, it at least has a simple clean interface and works).

0 Kudos
Reply