<?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 Unable to run a mkl_malloc function from a package in Go in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918205#M12776</link>
    <description>&lt;P&gt;Hi, I am trying to use mkl_malloc() in Golang.&lt;/P&gt;

&lt;P&gt;I have created a package which wraps mkl_malloc(). I called the wrapper from other Go file.&lt;/P&gt;

&lt;P&gt;The problem comes when I am calling the wrapper. The package is build fine.&lt;/P&gt;

&lt;P&gt;This is the error when I use the wrapper:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;/tmp/go-build655247984/blasl1.a(blasl1.cgo2.o)(.text): MKL_malloc: not defined&lt;BR /&gt;
		MKL_malloc(0): not defined&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;The wrapper:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;func Mal(x int,y int)unsafe.Pointer{&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp; &amp;nbsp;return unsafe.Pointer(C.mkl_malloc(C.size_t(x),C.int(y)))&lt;BR /&gt;
		}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Using the wrapper:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;x := blasl1.MKLMal(1024,64)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Nov 2013 16:04:30 GMT</pubDate>
    <dc:creator>Aditya_Avinash_Atlur</dc:creator>
    <dc:date>2013-11-24T16:04:30Z</dc:date>
    <item>
      <title>Unable to run a mkl_malloc function from a package in Go</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918205#M12776</link>
      <description>&lt;P&gt;Hi, I am trying to use mkl_malloc() in Golang.&lt;/P&gt;

&lt;P&gt;I have created a package which wraps mkl_malloc(). I called the wrapper from other Go file.&lt;/P&gt;

&lt;P&gt;The problem comes when I am calling the wrapper. The package is build fine.&lt;/P&gt;

&lt;P&gt;This is the error when I use the wrapper:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;/tmp/go-build655247984/blasl1.a(blasl1.cgo2.o)(.text): MKL_malloc: not defined&lt;BR /&gt;
		MKL_malloc(0): not defined&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;The wrapper:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;func Mal(x int,y int)unsafe.Pointer{&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp; &amp;nbsp;return unsafe.Pointer(C.mkl_malloc(C.size_t(x),C.int(y)))&lt;BR /&gt;
		}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Using the wrapper:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;x := blasl1.MKLMal(1024,64)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2013 16:04:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918205#M12776</guid>
      <dc:creator>Aditya_Avinash_Atlur</dc:creator>
      <dc:date>2013-11-24T16:04:30Z</dc:date>
    </item>
    <item>
      <title>This is the first time I've</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918206#M12777</link>
      <description>&lt;P&gt;This is the first time I've seen MKL being used with Go. It is interesting! Maybe someone on this forum has had experience with Go can help?&lt;/P&gt;

&lt;P&gt;Meanwhile, please share the command line and options you used to build the wrapper and link with MKL. Also, suppose you are on Linux, you can try 'ldd' on the binary to see if there's any broken dependence.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 18:30:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918206#M12777</guid>
      <dc:creator>Zhang_Z_Intel</dc:creator>
      <dc:date>2013-11-25T18:30:40Z</dc:date>
    </item>
    <item>
      <title>Aditya, I do not know about</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918207#M12778</link>
      <description>&lt;P&gt;Aditya, I do not know about Go, but it seems to me that you may have overlooked the point that on Linux external symbols need to match as to upper/lower case. You probably need to avoid &lt;STRONG&gt;MKL_malloc&lt;/STRONG&gt;, using instead the name&amp;nbsp;&lt;STRONG&gt;mkl_malloc&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 02:50:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918207#M12778</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2013-11-26T02:50:09Z</dc:date>
    </item>
    <item>
      <title>Thank you Zhang. I took the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918208#M12779</link>
      <description>&lt;P&gt;Thank you Zhang. I took the compiler options from MKL-Linking-Advisor. The issue comes at linking.&lt;/P&gt;

&lt;P&gt;Hi mecej4, I have changed the name of the Wrapper Go function. But, it is still showing the same error. Does it mean that Go mapped the name permanently to the file?&lt;/P&gt;

&lt;P&gt;Can some one help me with the linking? Any blogs or whitepapers?&lt;/P&gt;

&lt;P&gt;Also, my installation took place in /opt/intel/. There are 2 mkl/include and 2 mkl/lib folders.&lt;/P&gt;

&lt;P&gt;The first one is /opt/intel/mkl/include&lt;/P&gt;

&lt;P&gt;The second one is /opt/intel/composerxe*2013spe1*16.1/mkl/include&lt;/P&gt;

&lt;P&gt;Which one should is use during compilation and linking?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2013 06:44:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918208#M12779</guid>
      <dc:creator>Aditya_Avinash_Atlur</dc:creator>
      <dc:date>2013-12-04T06:44:42Z</dc:date>
    </item>
    <item>
      <title>Quote:Aditya Avinash Atluri</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918209#M12780</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Aditya Avinash Atluri wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Also, my installation took place in /opt/intel/. There are 2 mkl/include and 2 mkl/lib folders.&lt;/P&gt;

&lt;P&gt;The first one is /opt/intel/mkl/include&lt;/P&gt;

&lt;P&gt;The second one is /opt/intel/composerxe*2013spe1*16.1/mkl/include&lt;/P&gt;

&lt;P&gt;Which one should is use during compilation and linking?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Unless you installed two different versions of MKL side-by-side, there should only be one 'include' and one 'lib'. Can you check and see if one of the folders you mentioned is actually symbolic link to the other?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 00:07:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Unable-to-run-a-mkl-malloc-function-from-a-package-in-Go/m-p/918209#M12780</guid>
      <dc:creator>Zhang_Z_Intel</dc:creator>
      <dc:date>2013-12-06T00:07:38Z</dc:date>
    </item>
  </channel>
</rss>

