<?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 is a known issue. The in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-MKL-and-MEX/m-p/967555#M16320</link>
    <description>&lt;P&gt;This is a known issue. The fix will be available in the next MKL release (version 11.1 update 3), which is due in about one month.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Apr 2014 22:14:48 GMT</pubDate>
    <dc:creator>Zhang_Z_Intel</dc:creator>
    <dc:date>2014-04-01T22:14:48Z</dc:date>
    <item>
      <title>Problem with MKL and MEX</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-MKL-and-MEX/m-p/967554#M16319</link>
      <description>&lt;P&gt;I am trying to write a mex programm but it gives errors. When I use the VS2012 the code runs, but when I converted it to mex it didn't work. The code gives errors when it tries to use the mkl library (function dcopy, dgemm etc).&lt;/P&gt;

&lt;P&gt;I have installed the Composer XE 2013 SP1 and I use this command to compile the code&lt;/P&gt;

&lt;P&gt;mex -largeArrayDims ads.c -I"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\mkl\include" -L"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\mkl\lib\intel64" -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blas95_lp64 -lmkl_intel_ilp64 -lmkl_sequential -lmkl_blas95_lp64&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;For example I tried to use the function dcopy and the code and erros are:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;math.h&amp;gt;               
#include &amp;lt;stdio.h&amp;gt;             
#include &amp;lt;stdlib.h&amp;gt;           
#include &amp;lt;mkl.h&amp;gt;
#include "mkl_vml.h"
#include "mex.h"
#include "matrix.h"
#include "mkl_vsl.h"


void mexFunction(int nlhs,  mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
    double a[4]={1,2,3,4};
    double b[4];
    cblas_dcopy(4, a, 1, b, 1);

    return;
}

&lt;/PRE&gt;

&lt;P&gt;Errors:&lt;/P&gt;

&lt;P&gt;&amp;gt;&amp;gt; mex -largeArrayDims ads.c -I"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\mkl\include" -L"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\mkl\lib\intel64" -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blas95_lp64 -lmkl_intel_ilp64 -lmkl_sequential -lmkl_blas95_lp64&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; Creating library C:\Users\F9E9~1\AppData\Local\Temp\mex_VlIT6Y\templib.x and object C:\Users\F9E9~1\AppData\Local\Temp\mex_VlIT6Y\templib.exp&lt;BR /&gt;
	mkl_intel_thread.lib(mkl_threading.obj) : error LNK2019: unresolved external symbol omp_in_parallel referenced in function mkl_serv_get_max_threads&lt;BR /&gt;
	mkl_intel_thread.lib(mkl_threading.obj) : error LNK2019: unresolved external symbol omp_get_max_threads referenced in function mkl_serv_get_max_threads&lt;BR /&gt;
	mkl_intel_thread.lib(mkl_threading.obj) : error LNK2019: unresolved external symbol omp_get_num_procs referenced in function mkl_serv_get_N_Cores&lt;BR /&gt;
	mkl_intel_thread.lib(dcopy_omp.obj) : error LNK2019: unresolved external symbol __kmpc_global_thread_num referenced in function mkl_blas_dcopy_omp&lt;BR /&gt;
	mkl_intel_thread.lib(dcopy_omp.obj) : error LNK2019: unresolved external symbol __kmpc_ok_to_fork referenced in function mkl_blas_dcopy_omp&lt;BR /&gt;
	mkl_intel_thread.lib(dcopy_omp.obj) : error LNK2019: unresolved external symbol __kmpc_push_num_threads referenced in function mkl_blas_dcopy_omp&lt;BR /&gt;
	mkl_intel_thread.lib(dcopy_omp.obj) : error LNK2019: unresolved external symbol __kmpc_fork_call referenced in function mkl_blas_dcopy_omp&lt;BR /&gt;
	mkl_intel_thread.lib(dcopy_omp.obj) : error LNK2019: unresolved external symbol __kmpc_serialized_parallel referenced in function mkl_blas_dcopy_omp&lt;BR /&gt;
	mkl_intel_thread.lib(dcopy_omp.obj) : error LNK2019: unresolved external symbol __kmpc_end_serialized_parallel referenced in function mkl_blas_dcopy_omp&lt;BR /&gt;
	mkl_intel_thread.lib(dcopy_omp.obj) : error LNK2019: unresolved external symbol omp_get_thread_num referenced in function mkl_blas_dcopy_omp&lt;BR /&gt;
	mkl_intel_thread.lib(dcopy_omp.obj) : error LNK2019: unresolved external symbol omp_get_num_threads referenced in function mkl_blas_dcopy_omp&lt;BR /&gt;
	ads.mexw64 : fatal error LNK1120: 11 unresolved externals&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; C:\USERS\F9E9~1\DOCUME~1\MATLAB~1\BIN\MEX.PL: Error: Link of 'ads.mexw64' failed.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I would like to ask if you could help me to fix the errors.&lt;/P&gt;

&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2014 18:22:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-MKL-and-MEX/m-p/967554#M16319</guid>
      <dc:creator>Anas_A_</dc:creator>
      <dc:date>2014-04-01T18:22:35Z</dc:date>
    </item>
    <item>
      <title>This is a known issue. The</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-MKL-and-MEX/m-p/967555#M16320</link>
      <description>&lt;P&gt;This is a known issue. The fix will be available in the next MKL release (version 11.1 update 3), which is due in about one month.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2014 22:14:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-MKL-and-MEX/m-p/967555#M16320</guid>
      <dc:creator>Zhang_Z_Intel</dc:creator>
      <dc:date>2014-04-01T22:14:48Z</dc:date>
    </item>
  </channel>
</rss>

