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

how do i link with fft?

prayerz
Beginner
1,108 Views

Hi All,

i have a code that calls fft routines (rfftwnd_f77_create_plan, rfftwnd_f77_one_real_to_complex, rfftwnd_f77_destroy_plan). pls, how do i link my code to these mkl routines. i already tried -lmkl_em64t but i get errors:

ifort -o fft fft.f -I/usr/local/intel101/mkl/include/fftw -L/usr/local/intel101/mkl/lib/em64t -lmkl_em64t
/home/prayerz/tmp/ifortBMORKv.o: In function `MAIN__':
fft.f:(.text+0x98): undefined reference to `rfftwnd_f77_create_plan_'
fft.f:(.text+0xad): undefined reference to `rfftwnd_f77_one_real_to_complex_'
fft.f:(.text+0x127): undefined reference to `rfftwnd_f77_destroy_plan_'
fft.f:(.text+0x147): undefined reference to `rfftwnd_f77_create_plan_'
fft.f:(.text+0x152): undefined reference to `rfftwnd_f77_one_complex_to_real_'
fft.f:(.text+0x15d): undefined reference to `rfftwnd_f77_destroy_plan_'
make: *** [fft] Error 1

i am using v10 or ifort: ifort -V gives:

Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20070913 Package ID: l_fc_p_10.1.008
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY

thanks for any help!

o.

0 Kudos
2 Replies
Dmitry_B_Intel
Employee
1,108 Views

Hello,

The missing functionsshould be located in interfaces/fftw2xf directory of your MKL installation.Run `make libem64t' in that directory to build the wrappers library and add the latter on your link line. This should help.

Thanks,
Dima

0 Kudos
prayerz
Beginner
1,108 Views

Thanks, Dima. this helped. but i also had to add -lguide -lpthread; i don't know why so i have the libraries:

-lguide -lpthread -lfftw2xf_intel -lmkl_em64t

together with the include directory (for fftw_f77.i)

o.

0 Kudos
Reply