4

I'm currently writing a program that requires both MKL and FFTW.

The FFTW plan function I need is "fftw_plan_r2r_2d," which according the material I found, is not yet available in MKL, and the wrapper from MKL will always return a NULL pointer.

This is obviously not what I want, and also according to the manual, the MKL FFTW interface is designed to replace of FFTW functions.

So when I link both FFTW and MKL library to the program, the empty wrapper is used, thus I can't compute the transform I want.

Is there a way that I use both library in the same program, cause MKL functions are needed in other part of the program. But it's blocking the part I want to use FFTW.

Roger Lee
  • 78
  • 5
  • See http://stackoverflow.com/questions/678254/what-should-i-do-if-two-libraries-provide-a-function-with-the-same-name-generati : you can write a little wrapper of fftw, with just something like `wrap_fftw_plan_r2r_2d()` in it. The wrapper is statically linked to fftw and the main is linked to the wrapper and MKL. – francis Aug 17 '15 at 19:48
  • @francis http://pastebin.com/FskeKMB8 This is how I did the wrapper, which doesn't work. I'm not the most proficient in linux environment, so I'm not sure if I did the static linking right. One thing to note is that there is no .so in FFTWLIB, so I should static link by default, right? – Roger Lee Aug 17 '15 at 20:56
  • The issue can be related to the flag `FFTW_REDFT10`. Since MKL does not implement real transforms, these flags might have other values in FFTW. Take a look at the `fftw.h` of MKL and the one of FFTW...Moreover, could you print the value of the flag in both cases ? Notice that `wrap_fftw_plan_r2r_2d()` returns a `fftw_plan` which is defined by FFTW for the wrapper and MKL for the main. It might be necessary to wrap `fftw_execute()`and `fftw_destroy_plan()` This is getting tedious...It may not be the right way to go... I have no access to MKL, so the help I can provide is clearly limited ! – francis Aug 18 '15 at 16:39
  • According to https://software.intel.com/fr-fr/node/522278 , The files `fftw.h` and `fftw.f` are borrowed from the FFTW3... Have you tried to turn on verbosity by something like `fftw3_mkl.verbose = 42;` ? – francis Aug 18 '15 at 17:03
  • @francis The verbose didn't output anything. I tried fflush it, no dice. And nothing in stderr either. – Roger Lee Aug 20 '15 at 19:44

0 Answers0