- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all
I have tried to create a small library which uses parts of the mkl for faster processing. The purpose is that this library is accessible from matlab, so I have made a MEX interface, which allow matlab to create a dll in windows (and something else in linux). I have no problem compiling the code, and get no linker errors. Also, when I use the same code in an example program in C++, it all works fine. But... when I run a part of the code in Matlab that does a call to the MKL library, I get segmentation violation errors.
Basically, I have tried both the vmlSetMode( VML_HA ), and a call to vsSqrt( 5, x, y ). I use MSVC++ 7.1, and does a normal mex call to compile in Matlab. I have tried to compile all the source files in my project and link to the MKL .lib files from matlab, and I have tried to make a static library as well, as well as to a DLL.
I use the MKL library in my project as static linked, which I guess might be causing me the problems. The reason why I want to do this is to reduce the number of files I need to move around for my toolbox to work. Am I doing something wrong when I use it in Matlab as it works fine from another C++ project made by msvc 7.1?
Or is it matlab that does some stupid and removes that part of the project.
Thanks
Henrik Andresen
I have tried to create a small library which uses parts of the mkl for faster processing. The purpose is that this library is accessible from matlab, so I have made a MEX interface, which allow matlab to create a dll in windows (and something else in linux). I have no problem compiling the code, and get no linker errors. Also, when I use the same code in an example program in C++, it all works fine. But... when I run a part of the code in Matlab that does a call to the MKL library, I get segmentation violation errors.
Basically, I have tried both the vmlSetMode( VML_HA ), and a call to vsSqrt( 5, x, y ). I use MSVC++ 7.1, and does a normal mex call to compile in Matlab. I have tried to compile all the source files in my project and link to the MKL .lib files from matlab, and I have tried to make a static library as well, as well as to a DLL.
I use the MKL library in my project as static linked, which I guess might be causing me the problems. The reason why I want to do this is to reduce the number of files I need to move around for my toolbox to work. Am I doing something wrong when I use it in Matlab as it works fine from another C++ project made by msvc 7.1?
Or is it matlab that does some stupid and removes that part of the project.
Thanks
Henrik Andresen
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think what you are trying to use MKL statical library in your DLL. Am I right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Both yes and no.
I am trying 2 cases, where both ultimately leads to a dll being formed by Matlab. One case is to compile it directly by matlab, in which case you are correct. The other thing I try is to compile it to my own static linked library, and then use that to create a dll through matlab.
/Henrik
Both yes and no.
I am trying 2 cases, where both ultimately leads to a dll being formed by Matlab. One case is to compile it directly by matlab, in which case you are correct. The other thing I try is to compile it to my own static linked library, and then use that to create a dll through matlab.
/Henrik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. I think I understand now. It`s incorrect way of MKL usage - to use statical library in dynamical by any ways. If you plan to use your statical library in dinamical, you should link your library with dynamical version of MKL.
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