<?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 Problem calling MKL VML from Matlab MEX extension in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-calling-MKL-VML-from-Matlab-MEX-extension/m-p/872340#M8615</link>
    <description>I am having problems calling MKL Vector Maths (VML) functions from a Matlab C++ extension (using Mex). For example, when calling vcMul, Matlab exits with the error:&lt;BR /&gt;&lt;BR /&gt;MKL FATAL ERROR: /opt/intel/mkl/10.0.1.014/lib/32/libmkl_vml_def.so: undefined symbol: DftiCreateDescriptor&lt;BR /&gt;&lt;BR /&gt;Strange as DftiCreateDescriptor is intended for use with the FFT, which I am not using! &lt;BR /&gt;&lt;BR /&gt;I am using MKL 10.0.1.014 and icpc 10.1.011 on Ubuntu 7.04&lt;BR /&gt;&lt;BR /&gt;I will explain what I have done in more detail so that hopefully(!) someone will be able to help.&lt;BR /&gt;&lt;BR /&gt;I have a simple example with:&lt;BR /&gt;&lt;BR /&gt;1) a shared library : cmult.so&lt;BR /&gt;&lt;BR /&gt;This simply calls vcMul with two vectors and is built as follows:&lt;BR /&gt;&lt;BR /&gt;icpc -c -o mult.o mult.cc -w1 -g -O -Wno-deprecated&lt;BR /&gt;&lt;BR /&gt;icpc -shared -o libcmult.so mult.o -L. -Wl,--no-undefined -Wall -lstdc++ -lmkl_intel -lmkl_sequential -lmkl_vml_p4 -lmkl_p4 -lmkl_lapack -lpthread -lm&lt;BR /&gt;&lt;BR /&gt;2) an executable testbrace : cmultexe&lt;BR /&gt;&lt;BR /&gt;This is a simple testbrace that links to cmult.so and calls the multiplication function. &lt;BR /&gt;&lt;BR /&gt;This works perfectly.&lt;BR /&gt;&lt;BR /&gt;3) Matlab Mex function cmult.mexglx&lt;BR /&gt;&lt;BR /&gt;The mex wrapper can call Intel IPP code with no problems, but if linked to cmult.so (using MKL) it gives the runtime error pasted near the start of this post.&lt;BR /&gt;&lt;BR /&gt;Any help is very much appreciated. &lt;BR /&gt;&lt;BR /&gt;I have tried many different linking options, including static linking (which I seem to remember from reading another post is not supported for a shared libraries using MKL 10.X (?)) but the results are always similar! I have also tried calling VML functions straight from the mex wrapper (i.e. without the additional .so as described in 1) ) but still no luck.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sun, 30 Dec 2007 17:48:43 GMT</pubDate>
    <dc:creator>pbrown32</dc:creator>
    <dc:date>2007-12-30T17:48:43Z</dc:date>
    <item>
      <title>Problem calling MKL VML from Matlab MEX extension</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-calling-MKL-VML-from-Matlab-MEX-extension/m-p/872340#M8615</link>
      <description>I am having problems calling MKL Vector Maths (VML) functions from a Matlab C++ extension (using Mex). For example, when calling vcMul, Matlab exits with the error:&lt;BR /&gt;&lt;BR /&gt;MKL FATAL ERROR: /opt/intel/mkl/10.0.1.014/lib/32/libmkl_vml_def.so: undefined symbol: DftiCreateDescriptor&lt;BR /&gt;&lt;BR /&gt;Strange as DftiCreateDescriptor is intended for use with the FFT, which I am not using! &lt;BR /&gt;&lt;BR /&gt;I am using MKL 10.0.1.014 and icpc 10.1.011 on Ubuntu 7.04&lt;BR /&gt;&lt;BR /&gt;I will explain what I have done in more detail so that hopefully(!) someone will be able to help.&lt;BR /&gt;&lt;BR /&gt;I have a simple example with:&lt;BR /&gt;&lt;BR /&gt;1) a shared library : cmult.so&lt;BR /&gt;&lt;BR /&gt;This simply calls vcMul with two vectors and is built as follows:&lt;BR /&gt;&lt;BR /&gt;icpc -c -o mult.o mult.cc -w1 -g -O -Wno-deprecated&lt;BR /&gt;&lt;BR /&gt;icpc -shared -o libcmult.so mult.o -L. -Wl,--no-undefined -Wall -lstdc++ -lmkl_intel -lmkl_sequential -lmkl_vml_p4 -lmkl_p4 -lmkl_lapack -lpthread -lm&lt;BR /&gt;&lt;BR /&gt;2) an executable testbrace : cmultexe&lt;BR /&gt;&lt;BR /&gt;This is a simple testbrace that links to cmult.so and calls the multiplication function. &lt;BR /&gt;&lt;BR /&gt;This works perfectly.&lt;BR /&gt;&lt;BR /&gt;3) Matlab Mex function cmult.mexglx&lt;BR /&gt;&lt;BR /&gt;The mex wrapper can call Intel IPP code with no problems, but if linked to cmult.so (using MKL) it gives the runtime error pasted near the start of this post.&lt;BR /&gt;&lt;BR /&gt;Any help is very much appreciated. &lt;BR /&gt;&lt;BR /&gt;I have tried many different linking options, including static linking (which I seem to remember from reading another post is not supported for a shared libraries using MKL 10.X (?)) but the results are always similar! I have also tried calling VML functions straight from the mex wrapper (i.e. without the additional .so as described in 1) ) but still no luck.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 30 Dec 2007 17:48:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-calling-MKL-VML-from-Matlab-MEX-extension/m-p/872340#M8615</guid>
      <dc:creator>pbrown32</dc:creator>
      <dc:date>2007-12-30T17:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem calling MKL VML from Matlab MEX extension</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-calling-MKL-VML-from-Matlab-MEX-extension/m-p/872341#M8616</link>
      <description>I don't have experience calling VML functions from Matlab using MKL 10 versions. But with version 9.x.x, I can call VML routines provided by Intel MKL from C++/Fortran mex files without building a shared library.&lt;BR /&gt;&lt;BR /&gt;Make sure the MKL lib is in your path and set the environment variable BLAS_VERSION so that your separately installed libraries are loaded as opposed to the ones shipped with Matlab. E.g.,&lt;BR /&gt;&lt;BR /&gt;export BLAS_VERSION=libmkl.so:libvml.so:libguide.so&lt;BR /&gt;&lt;BR /&gt;Also set LAPACK_VERBOSITY=1 to see if symbols are resolved as desired.&lt;BR /&gt;&lt;BR /&gt;How does your mexopts.sh file look like/how do you build the mex file?&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Dec 2007 17:12:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-calling-MKL-VML-from-Matlab-MEX-extension/m-p/872341#M8616</guid>
      <dc:creator>malzfreund</dc:creator>
      <dc:date>2007-12-31T17:12:39Z</dc:date>
    </item>
  </channel>
</rss>

