<?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 compiling CBLAS example 1 for C++ compiler on Windows in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-compiling-CBLAS-example-1-for-C-compiler-on-Windows/m-p/791258#M2240</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am just getting started with the Intel C++ compiler and the Intel Math Kernel Library. As a first step I am trying to compile the examples from: &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-blas-cblas-and-lapack-compilinglinking-functions-fortran-and-cc-calls/" target="_blank"&gt;http://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-blas-cblas-and-lapack-compilinglinking-functions-fortran-and-cc-calls/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;To setup the environment I run the "C++ Build Environment for applications running on Intel 64" bat file to start the command window. Then I run the "F:\\Intel\\MKL\\10.2.5.035\\tools\\environment\\mklvars64.bat" file to set the MKL environment variables. &lt;BR /&gt;&lt;BR /&gt;Then I attempt to compile with icl:&lt;BR /&gt;&lt;BR /&gt;icl main.cpp&lt;BR /&gt;&lt;BR /&gt;The error that I get is: &lt;BR /&gt;&lt;BR /&gt;main.cpp(5): error: more than one instance of overloaded function "cblas_zdotc_sub" has "C" linkage
&lt;P&gt;extern "C" void cblas_zdotc_sub(complex16*, int *, complex16 *, int *, complex16 *, int *);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried various permutations of linking -lmkl libraries and different command line options. Can anyone provide some advice? Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The exact source code is:&lt;/P&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;#include "mkl.h"&lt;BR /&gt;typedef struct{ double re; double im; } complex16;&lt;BR /&gt;extern "C" void cblas_zdotc_sub(complex16*, int *, complex16 *, int *, complex16 *, int *);&lt;BR /&gt;&lt;BR /&gt;#define N 5&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt; int n, inca = 1, incb = 1, i;&lt;BR /&gt;&lt;BR /&gt; complex16 a&lt;N&gt;, b&lt;N&gt;, c;&lt;BR /&gt;&lt;BR /&gt; n = N;&lt;BR /&gt; for( i = 0; i &amp;lt; n; i++ ){&lt;BR /&gt; a&lt;I&gt;.re = (double)i; a&lt;I&gt;.im = (double)i * 2.0;&lt;BR /&gt; b&lt;I&gt;.re = (double)(n - i); b&lt;I&gt;.im = (double)i * 2.0;&lt;BR /&gt; }&lt;BR /&gt; cblas_zdotc_sub(&amp;amp;c, &amp;amp;n, a, &amp;amp;inca, b, &amp;amp;incb );&lt;BR /&gt; printf( "The complex dot product is: ( %6.2f, %6.2f) ", c.re, c.im );&lt;BR /&gt;&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/N&gt;&lt;/N&gt;&lt;/STDIO.H&gt;</description>
    <pubDate>Wed, 23 Jun 2010 21:21:36 GMT</pubDate>
    <dc:creator>bob_edwards</dc:creator>
    <dc:date>2010-06-23T21:21:36Z</dc:date>
    <item>
      <title>Problem compiling CBLAS example 1 for C++ compiler on Windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-compiling-CBLAS-example-1-for-C-compiler-on-Windows/m-p/791258#M2240</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am just getting started with the Intel C++ compiler and the Intel Math Kernel Library. As a first step I am trying to compile the examples from: &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-blas-cblas-and-lapack-compilinglinking-functions-fortran-and-cc-calls/" target="_blank"&gt;http://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-blas-cblas-and-lapack-compilinglinking-functions-fortran-and-cc-calls/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;To setup the environment I run the "C++ Build Environment for applications running on Intel 64" bat file to start the command window. Then I run the "F:\\Intel\\MKL\\10.2.5.035\\tools\\environment\\mklvars64.bat" file to set the MKL environment variables. &lt;BR /&gt;&lt;BR /&gt;Then I attempt to compile with icl:&lt;BR /&gt;&lt;BR /&gt;icl main.cpp&lt;BR /&gt;&lt;BR /&gt;The error that I get is: &lt;BR /&gt;&lt;BR /&gt;main.cpp(5): error: more than one instance of overloaded function "cblas_zdotc_sub" has "C" linkage
&lt;P&gt;extern "C" void cblas_zdotc_sub(complex16*, int *, complex16 *, int *, complex16 *, int *);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried various permutations of linking -lmkl libraries and different command line options. Can anyone provide some advice? Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The exact source code is:&lt;/P&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;#include "mkl.h"&lt;BR /&gt;typedef struct{ double re; double im; } complex16;&lt;BR /&gt;extern "C" void cblas_zdotc_sub(complex16*, int *, complex16 *, int *, complex16 *, int *);&lt;BR /&gt;&lt;BR /&gt;#define N 5&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt; int n, inca = 1, incb = 1, i;&lt;BR /&gt;&lt;BR /&gt; complex16 a&lt;N&gt;, b&lt;N&gt;, c;&lt;BR /&gt;&lt;BR /&gt; n = N;&lt;BR /&gt; for( i = 0; i &amp;lt; n; i++ ){&lt;BR /&gt; a&lt;I&gt;.re = (double)i; a&lt;I&gt;.im = (double)i * 2.0;&lt;BR /&gt; b&lt;I&gt;.re = (double)(n - i); b&lt;I&gt;.im = (double)i * 2.0;&lt;BR /&gt; }&lt;BR /&gt; cblas_zdotc_sub(&amp;amp;c, &amp;amp;n, a, &amp;amp;inca, b, &amp;amp;incb );&lt;BR /&gt; printf( "The complex dot product is: ( %6.2f, %6.2f) ", c.re, c.im );&lt;BR /&gt;&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/N&gt;&lt;/N&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Wed, 23 Jun 2010 21:21:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-compiling-CBLAS-example-1-for-C-compiler-on-Windows/m-p/791258#M2240</guid>
      <dc:creator>bob_edwards</dc:creator>
      <dc:date>2010-06-23T21:21:36Z</dc:date>
    </item>
    <item>
      <title>Problem compiling CBLAS example 1 for C++ compiler on Windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-compiling-CBLAS-example-1-for-C-compiler-on-Windows/m-p/791259#M2241</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;Bob,&lt;DIV&gt;let's try to modify the code:&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;complex16 res;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;//cblas_zdotc_sub(&amp;amp;c, &amp;amp;n, a, &amp;amp;inca, b, &amp;amp;incb );&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	cblas_zdotc_sub( n, a, inca, b, incb, &amp;amp;res );&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;--Gennady&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Jun 2010 03:23:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-compiling-CBLAS-example-1-for-C-compiler-on-Windows/m-p/791259#M2241</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2010-06-24T03:23:25Z</dc:date>
    </item>
  </channel>
</rss>

