<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic This question has been solved in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matlab-crashes-when-invoking-functions-from-intel-MKL/m-p/1163754#M28076</link>
    <description>&lt;P&gt;This question has been solved. See&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/59507831/matlab-crashes-when-invoking-functions-from-intel-mkl"&gt;https://stackoverflow.com/questions/59507831/matlab-crashes-when-invoking-functions-from-intel-mkl&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Dec 2019 08:29:28 GMT</pubDate>
    <dc:creator>zhao__kun</dc:creator>
    <dc:date>2019-12-31T08:29:28Z</dc:date>
    <item>
      <title>Matlab crashes when invoking functions from intel MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matlab-crashes-when-invoking-functions-from-intel-MKL/m-p/1163752#M28074</link>
      <description>&lt;P&gt;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:&lt;/P&gt;
&lt;PRE class="brush:python; class-name:dark;"&gt;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
&lt;/PRE&gt;

&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;I also try to run the code on the Intel Parallel Studio XE 2017 compiler using makefile as:&lt;/P&gt;

&lt;PRE class="brush:fortran; class-name:dark;"&gt;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&lt;/PRE&gt;

&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;I use Matlab 2019b and Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015 to compile and link the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use windows 10 system and the version of compiler and library is&amp;nbsp;2017.5.267&lt;/P&gt;
&lt;P&gt;Any suggestions will be appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2019 10:21:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matlab-crashes-when-invoking-functions-from-intel-MKL/m-p/1163752#M28074</guid>
      <dc:creator>zhao__kun</dc:creator>
      <dc:date>2019-12-28T10:21:21Z</dc:date>
    </item>
    <item>
      <title>This is the question to the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matlab-crashes-when-invoking-functions-from-intel-MKL/m-p/1163753#M28075</link>
      <description>&lt;P&gt;This is the question to the Mathlab support forum.&amp;nbsp; MKL is used as a backend from MatLab. Mathlab uses several domains from MKL, including BLAS, LAPACK, Pardiso and some other.&amp;nbsp; You may check the version of MKL which is used by this current version of Mathlab by calling "version -blas" command line, for example. &amp;nbsp;Could you check?&amp;nbsp; it seems Matlab 2019b uses MKL 2018.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2019 04:43:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matlab-crashes-when-invoking-functions-from-intel-MKL/m-p/1163753#M28075</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-12-31T04:43:16Z</dc:date>
    </item>
    <item>
      <title>This question has been solved</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matlab-crashes-when-invoking-functions-from-intel-MKL/m-p/1163754#M28076</link>
      <description>&lt;P&gt;This question has been solved. See&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/59507831/matlab-crashes-when-invoking-functions-from-intel-mkl"&gt;https://stackoverflow.com/questions/59507831/matlab-crashes-when-invoking-functions-from-intel-mkl&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2019 08:29:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matlab-crashes-when-invoking-functions-from-intel-MKL/m-p/1163754#M28076</guid>
      <dc:creator>zhao__kun</dc:creator>
      <dc:date>2019-12-31T08:29:28Z</dc:date>
    </item>
    <item>
      <title>ok, thanks for keeping us</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matlab-crashes-when-invoking-functions-from-intel-MKL/m-p/1163755#M28077</link>
      <description>&lt;P&gt;ok, thanks for keeping us updated. Actually combining ILP64 and LP64 mode will produce the segfault and this is the expected behavior. if you originally added all details, we were able to resolve this issue here.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2019 14:31:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matlab-crashes-when-invoking-functions-from-intel-MKL/m-p/1163755#M28077</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-12-31T14:31:02Z</dc:date>
    </item>
  </channel>
</rss>

