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

How do I link the MKL FFTW with Fortran?

david_sallngc_com
1,408 Views

Hi!

I am a new user of the Intel Fortran compiler and the MKL. I have written a Fortran 90 code that currently uses the FFTW libraries (.lib and .dll) on a Windows XP 32-bit platform. In the Fortran code I had to use and INTERFACE statement to "tell" the subroutines how to call FFTW. I am using it via a Matlab mexfunction and creating a dll is simply

mex foo.f90 libfftw3-3.lib

When calling foo.mexw32 (Matlab created dll), all you need is the libfftw3-3.dll file in the directory (or PATH). I am looking for the same functionality using the FFTW libraries in the MKL however I am very confused as to how to do this. I have read the documentation but have not been able to get anything that works.

Do the FFTW libraries need to be compiled or are they included in the main MKL library for static linking, mkl_S.lib? Do I still need to use an INTERFACE statement in my code? What are the wrappers for?

As you can see I am very confused here! Any help would be greatly appreciated

Thank you very much.

Sincerely,

David

The MKL documnetation

0 Kudos
1 Reply
Gennady_F_Intel
Moderator
1,408 Views

David,

1.

Intel MKL offers two wrappers collections, each being the FFTW interface superstructure, to

be used for calling the Intel MKL Fourier transform functions. These collections correspond

to the FFTW versions 2.x and 3.x, respectively.

These Wrapper Libraries dont include in the MKL package but you can build these Libraries.

How to do that? Go to the $MKL_ROOT/interfaces/ fftw3xf folder

and you can build wrapper lib.

For example: nmake lib32

and as a results fftw3x_intel.lib will be built into ia32/lib folder

This is snip from the Makefile:

help:

@echo Usage: nmake {lib32^|libem64t^|lib64} [COMPILER=compiler_name]

@echo compiler_name=ms - using Microsoft C compiler

@echo Intel C Compiler as default

##------------------------------------------------------------------------------

## examples of using:

##

## nmake lib32 - build by Intel C++ compiler (as default)

##

## nmake libem64t COMPILER=ms - build by Microsoft C++ compiler

##

##------------------------------------------------------------------------------

2.

Some more info about FFTW Interface support you can find into userguide.pdf

I hope it will help you.

--Gennady

0 Kudos
Reply