Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- Matlab crashes when invoking functions from intel MKL

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

zhao__kun

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-28-2019
02:21 AM

112 Views

Matlab crashes when invoking functions from intel MKL

I'm trying to link Fortran code with Matlab using the Mex function. I can successfully compile and link the code using the following instruction:

mex COMPFLAGS="$COMPFLAGS -Qopenmp -Qmkl"... '-IC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include'... '-LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64'... ero_dep_fortran.F Module.F prepare_bank_collapse.F LINEAR_ELASTIC_STIFFNESS.F FAILURE_CRITERION.F OUTPUT.F pardisonew.F

However, when I execute the generated .mexw64 function, Matlab crashes without any error information. Then I debug my Fortran code line by line, and I found that Matlab crashes when invoking the function pardiso which comes from Intel MKL library. It seems that when invoking function from MKL, Matlab will crash and I have no idea how to fix it.

I also try to run the code on the Intel Parallel Studio XE 2017 compiler using makefile as:

ifort Module.F OUTPUT.F FAILURE_CRITERION.F pardisonew.F LINEAR_ELASTIC_STIFFNESS.F prepare_bank_collapse.F ero_dep_fortran.F /Qopenmp /Qmkl /nostandard-realloc-lhs /MD -o BANK_COLLAPSE.exe

The generated .exe works. So the problem is not due to the code self or the function pardiso from Intel MKL library. Maybe there are some conflicts between Matlab mkl and intel mkl?

I use Matlab 2019b and Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015 to compile and link the code.

I use windows 10 system and the version of compiler and library is 2017.5.267

Any suggestions will be appreciated.

Link Copied

3 Replies

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-30-2019
08:43 PM

112 Views

zhao__kun

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-31-2019
12:29 AM

112 Views

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-31-2019
06:31 AM

112 Views

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

For more complete information about compiler optimizations, see our Optimization Notice.