- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello. I'm trying to use MKL DFT's in a MEX application. I recall from a few years backthat there's an environment variable that needs to be set, but I don't remember the reasonor exactly what it is, and can't find it online. Without it,Matlab crashes during the FFT plan creation. If someone can remind me what the variable is, I would appreciate it. I am using Matlab 7 and MKL 10.
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi. Was the variable related to memory management or threading? MKL User's Guide is the place where to look for environment variables, particularly section 6.
Thanks,
Dima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, no, its not one of those threading or memory management environment variables. Its a patch for some kind of incompatibility betweenthe MKL DFT library and MEX libraries. Apparently Matlab isn't high enough on Intel's radar forMEX usebe tested and supported, and vice versa, so its not in the documentation. I don't remember how I found out aboutit before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, I have more information....the problem is that Matlab now uses MKL, so the need is to set the environment so that the MEX application can also link in MKL without a conflict. Still don't know how to do that though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm afraid I don't know. Do you remember if it was an MKL or Matlab variable?
Anybody on the forum familiar with this variable for use of MKL with Matlab?
Anybody on the forum familiar with this variable for use of MKL with Matlab?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suggest you post your question on Mathworks forum,
http://www.mathworks.com/matlabcentral/newsreader/
but first do a search on MKL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is probably that Matlab 7 uses MKL 9.x... and if your MEX DLL uses MKL 10.0 you will crash as there are a number of conflicts. When running in Matlab the ./bin directory ( with the MKL 9.x DLL's) is always first in the PATH.
I have battled with this for some time. There are a couple of solutions however.
1) Link MKL statically into your MEX DLL.
2) Build a 'custom' MKL DLL following the instructions in the MKL documentation, and link your MEX DLL against that. That way, your MEX DLL can load the custom MKL DLL and Matlab will load it's MKL DLL's and there is no longer any conflict.
I have battled with this for some time. There are a couple of solutions however.
1) Link MKL statically into your MEX DLL.
2) Build a 'custom' MKL DLL following the instructions in the MKL documentation, and link your MEX DLL against that. That way, your MEX DLL can load the custom MKL DLL and Matlab will load it's MKL DLL's and there is no longer any conflict.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page