Access violation and FFTW

Access violation and FFTW


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)

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.



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
Using Intel MKL in MATLAB Executable (MEX) Files
Intel Math Kernel Library Link Line Advisor
I hope can find all info you needed.

Leave a Comment

Please sign in to add a comment. Not a member? Join today