Access violation and FFTW

Access violation and FFTW

Hi!

I am trying to use the MKL FFTW library as called from a Matlab mexfunction and am getting an "access violation" when trying to create a plan (I have done this successfully using the FFTW libraries from their website but want to compare results to MKL FFTW). My simplfied test code (modified from Intel's example file) is named "mkl_test_fftw.f90,

subroutine mexfunction(nlhs, plhs, nrhs, prhs)
implicit none
integer nlhs, nrhs
integer plhs(nlhs), prhs(nrhs)
integer, parameter :: fftw_forward = -1
integer, parameter :: fftw_estimate = 64
integer, parameter :: n = 10
integer*8 plan
complex*16 in(n)

! Get access violation when trying to run the next line
call dfftw_plan_1d(plan, n, in, in, fftw_forward, fftw_estimate)

return
end subroutine mexfunction

I compile using the Matlab MEX utility (static linking and Intel Fortran visual compiler),

>> mex mkl_test_fftw.f90 mkl_c.lib fftw3xf_ms.lib libguide40.lib

where,fftw3xf_ms.lib was compiled using the Microsoft C-compiler from MSVS and libguide40.lib is from the Intel compiler directory, not the one supplied with MKL (as instructed in the MKL user manual). I tried using libguide from the MKL directory as well but that did not make a difference.

The mexopt.bat file (supplied by Matlab) has all of the PATHs, INCLUDE, etc... to the Intel compiler and MKL libraries.

Is therea DLL or LIBthat I am missing when trying to run this code. It compiled perfectly but can not find the FFTW library when executing(?).

Thank you very much for your time. Any help that someone could provide would be greatly appreciated.

Sincerely,

David

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi David,

I believe you missed some libraries need to be linked additionally.

Please refer to the KB articles:
Using Intel MKL with MATLAB
http://software.intel.com/en-us/articles/using-intel-mkl-with-matlab/
Using Intel MKL in MATLAB Executable (MEX) Files
http://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-for-windows-using-intel-mkl-in-matlab-executable-mex-files/
Intel Math Kernel Library Link Line Advisor
http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/
I hope can find all info you needed.
--Gennady

Login to leave a comment.