Quantcast
Channel: Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 2652

Unable to find reference to fftw3 subroutine

$
0
0

Hello,
In my application i am trying to use Intel MKL wrappers for FFTW3 to call from Fortran code and followed these steps:

To build the fftw3 wrapper library, I followed Intel procedure explained in https://software.intel.com/en-us/node/471470#68C58A01-0636-463B-8A6B-38C376D600B9 
I built using following command within the 'fftw3x_cdft' directory under $MKLROOT/interfaces :

make libintel64

which will be compiled by Intel compiler and Intel MPI and places the built library "libfftw3x_cdft_lp64.a" in
$MKLROOT/lib/intel64/ and

$MKLROOT/lib/intel64_lin/

I have added required links to MKL as follows:

-Wl,--start-group  ${MKLROOT}/lib/intel64/libfftw3x_cdft_ilp64.a ${MKLROOT}/lib/intel64/libmkl_cdft_core.a ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_ilp64.a -Wl,--end-group -lpthread -lm -I${MKLROOT}/include -I${MKLROOT}/include/fftw -mkl -lfftw3x_cdft_lp64

after building I am trying to use the library without any modifications in the fftw3 calling convention in Fortran  at two places as below:

 call fftw_mpi_execute_dft_r2c(p,q,r)
 call fftw_mpi_execute_dft_c2r(x,y,z)

But while compiling the application its throwing error in following function:

inv.o: In function `inverse_fourier_':
inv.f90:(.text+0x86d): undefined reference to `fftw_mpi_execute_dft_c2r'So, I tried checking whether the library is having wrapper for the subroutines or not.
Surprisingly it has the wrapper definition for both, but the build process didn't build the second wrapper subroutine and binary didn't have code for it.
I confirmed this with greping under $MKLROOT:

$ grep -rn "fftw_mpi_execute_dft_r2c" *

include/fftw/fftw3-mpi.f03:409:    subroutine fftw_mpi_execute_dft_r2c(p,in,out) bind(C, name='fftw_mpi_execute_dft_r2c')
include/fftw/fftw3-mpi.f03:414:    end subroutine fftw_mpi_execute_dft_r2c
Binary file interfaces/fftw3x_cdft/obj_intel64_lp64/execute.o matches
Binary file interfaces/fftw3x_cdft/obj_intel64_ilp64/execute.o matches
Binary file lib/intel64_lin/obj_intel64_lp64/execute.o matches
Binary file lib/intel64_lin/libfftw3x_cdft_ilp64.a matches
Binary file lib/intel64_lin/libfftw3x_cdft_lp64.a matches
Binary file lib/intel64/obj_intel64_lp64/execute.o matches
Binary file lib/intel64/libfftw3x_cdft_ilp64.a matches
Binary file lib/intel64/libfftw3x_cdft_lp64.a matches

$ grep -rn "fftw_mpi_execute_dft_c2r" *

include/fftw/fftw3-mpi.f03:416:    subroutine fftw_mpi_execute_dft_c2r(p,in,out) bind(C, name='fftw_mpi_execute_dft_c2r')
include/fftw/fftw3-mpi.f03:421:    end subroutine fftw_mpi_execute_dft_c2r

Why the the build process not creating executable code for the c2r subroutine? Could any one help me out how to resolve the error.


Viewing all articles
Browse latest Browse all 2652

Trending Articles