<?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 Dynamic linking error when using dgees() or zgees() LAPACK functions in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dynamic-linking-error-when-using-dgees-or-zgees-LAPACK-functions/m-p/871847#M8576</link>
    <description>&lt;FONT face="Verdana"&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I use MS Visual C++ 2005 Express compiler and Intel MKL 10.0.1.015. When I try to link dynamically a simple C++ program that uses dgees() or zgees() LAPACK functions from MKL, I get the following error:&lt;BR /&gt;&lt;FONT face="Courier New"&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;1&amp;gt;Linking...&lt;BR /&gt;1&amp;gt;mkl_core_dll.lib(_dgees_dyn.obj) : error LNK2005: _select_cdc_dgees1 already defined in mkl_intel_c_dll.lib(_dgees_dll.obj)&lt;BR /&gt;1&amp;gt;schur_mkl.exe : fatal error LNK1169: one or more multiply defined symbols found&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;FONT face="Verdana"&gt;&lt;BR /&gt;This error occures only with MKL 10 and dynamic linking (to DLL libraries). Static linking with this MKL version works fine.&lt;BR /&gt;Here are the MKL libraries I try to link to (for ia32 architecture):&lt;BR /&gt;"mkl_intel_c_dll.lib mkl_sequential_dll.lib mkl_core_dll.lib".&lt;BR /&gt;&lt;BR /&gt;Linking to a dummy library "mkl_c_dll.lib" results in the same error. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Verdana"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Verdana"&gt; I can successfully link dynamically the same example program with MKL 9.1 and MKL 8.1 on the same system.&lt;BR /&gt;
&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Verdana"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Verdana"&gt;&lt;BR /&gt;Can you confirm that it is a bug of MKL 10?&lt;BR /&gt;If not, how should I link dynamically the C++ prgrams that use dgees() and zgees() LAPACK functions?&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;BR,&lt;BR /&gt;/Adam&lt;BR /&gt;&lt;BR /&gt;PS. Here is the source code of a minimal examle program which can be used to reproduce this problem:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;#include &lt;IOSTREAM&gt;&lt;BR /&gt;&lt;BR /&gt;using namespace std;&lt;BR /&gt;&lt;BR /&gt;#define dgees_ dgees&lt;BR /&gt;#define A_SIZE 4&lt;BR /&gt;#define A_ROWS (A_SIZE &amp;gt;&amp;gt; 1)&lt;BR /&gt;&lt;BR /&gt;extern "C" {&lt;BR /&gt; void dgees_(char *jobvs, char *sort, int* select, int *n,&lt;BR /&gt; double *a, int *lda, int *sdim, double *wr,&lt;BR /&gt;        double *wi, double *vs, int *ldvs, double *work,&lt;BR /&gt;        int *lwork, int *bwork, int *info);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int main() {&lt;BR /&gt; double A[A_SIZE] = { 1, 5.0, -2.3, 1e-3 };&lt;BR /&gt;&lt;BR /&gt; char jobvs = 'V';&lt;BR /&gt; char sort = 'N';&lt;BR /&gt; int info;&lt;BR /&gt; int n = A_ROWS;&lt;BR /&gt; int lda = n;&lt;BR /&gt; int ldvs = n;&lt;BR /&gt; int lwork = 3 * n;&lt;BR /&gt; int sdim = 0;&lt;BR /&gt; &lt;BR /&gt; double wr[A_ROWS];&lt;BR /&gt; double wi[A_ROWS];&lt;BR /&gt; double work[3 * A_ROWS];&lt;BR /&gt;&lt;BR /&gt; double T[A_SIZE];&lt;BR /&gt; double U[A_SIZE];&lt;BR /&gt;&lt;BR /&gt; for (int i = 0; i &amp;lt; A_SIZE; ++i)&lt;BR /&gt;  T&lt;I&gt; = A&lt;I&gt;;&lt;BR /&gt;&lt;BR /&gt; dgees_(&amp;amp;jobvs, &amp;amp;sort, 0, &amp;amp;n, T, &amp;amp;lda, &amp;amp;sdim, wr, wi,&lt;BR /&gt;  U, &amp;amp;ldvs, work, &amp;amp;lwork, 0, &amp;amp;info);&lt;BR /&gt;&lt;BR /&gt; cout &amp;lt;&amp;lt; "T = [ ";&lt;BR /&gt; for (int i = 0; i &amp;lt; A_SIZE; ++i)&lt;BR /&gt;  cout &amp;lt;&amp;lt; T&lt;I&gt; &amp;lt;&amp;lt; " ";&lt;BR /&gt; cout &amp;lt;&amp;lt; "]" &amp;lt;&amp;lt; endl;&lt;BR /&gt;&lt;BR /&gt; cout &amp;lt;&amp;lt; "U = [ ";&lt;BR /&gt; for (int i = 0; i &amp;lt; A_SIZE; ++i)&lt;BR /&gt;&amp;amp;nb
sp;  cout &amp;lt;&amp;lt; U&lt;I&gt; &amp;lt;&amp;lt; " ";&lt;BR /&gt; cout &amp;lt;&amp;lt; "]" &amp;lt;&amp;lt; endl;&lt;BR /&gt; &lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/IOSTREAM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;</description>
    <pubDate>Wed, 02 Jan 2008 19:24:11 GMT</pubDate>
    <dc:creator>ediap</dc:creator>
    <dc:date>2008-01-02T19:24:11Z</dc:date>
    <item>
      <title>Dynamic linking error when using dgees() or zgees() LAPACK functions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dynamic-linking-error-when-using-dgees-or-zgees-LAPACK-functions/m-p/871847#M8576</link>
      <description>&lt;FONT face="Verdana"&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I use MS Visual C++ 2005 Express compiler and Intel MKL 10.0.1.015. When I try to link dynamically a simple C++ program that uses dgees() or zgees() LAPACK functions from MKL, I get the following error:&lt;BR /&gt;&lt;FONT face="Courier New"&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;1&amp;gt;Linking...&lt;BR /&gt;1&amp;gt;mkl_core_dll.lib(_dgees_dyn.obj) : error LNK2005: _select_cdc_dgees1 already defined in mkl_intel_c_dll.lib(_dgees_dll.obj)&lt;BR /&gt;1&amp;gt;schur_mkl.exe : fatal error LNK1169: one or more multiply defined symbols found&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;FONT face="Verdana"&gt;&lt;BR /&gt;This error occures only with MKL 10 and dynamic linking (to DLL libraries). Static linking with this MKL version works fine.&lt;BR /&gt;Here are the MKL libraries I try to link to (for ia32 architecture):&lt;BR /&gt;"mkl_intel_c_dll.lib mkl_sequential_dll.lib mkl_core_dll.lib".&lt;BR /&gt;&lt;BR /&gt;Linking to a dummy library "mkl_c_dll.lib" results in the same error. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Verdana"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Verdana"&gt; I can successfully link dynamically the same example program with MKL 9.1 and MKL 8.1 on the same system.&lt;BR /&gt;
&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Verdana"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Verdana"&gt;&lt;BR /&gt;Can you confirm that it is a bug of MKL 10?&lt;BR /&gt;If not, how should I link dynamically the C++ prgrams that use dgees() and zgees() LAPACK functions?&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;BR,&lt;BR /&gt;/Adam&lt;BR /&gt;&lt;BR /&gt;PS. Here is the source code of a minimal examle program which can be used to reproduce this problem:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;#include &lt;IOSTREAM&gt;&lt;BR /&gt;&lt;BR /&gt;using namespace std;&lt;BR /&gt;&lt;BR /&gt;#define dgees_ dgees&lt;BR /&gt;#define A_SIZE 4&lt;BR /&gt;#define A_ROWS (A_SIZE &amp;gt;&amp;gt; 1)&lt;BR /&gt;&lt;BR /&gt;extern "C" {&lt;BR /&gt; void dgees_(char *jobvs, char *sort, int* select, int *n,&lt;BR /&gt; double *a, int *lda, int *sdim, double *wr,&lt;BR /&gt;        double *wi, double *vs, int *ldvs, double *work,&lt;BR /&gt;        int *lwork, int *bwork, int *info);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int main() {&lt;BR /&gt; double A[A_SIZE] = { 1, 5.0, -2.3, 1e-3 };&lt;BR /&gt;&lt;BR /&gt; char jobvs = 'V';&lt;BR /&gt; char sort = 'N';&lt;BR /&gt; int info;&lt;BR /&gt; int n = A_ROWS;&lt;BR /&gt; int lda = n;&lt;BR /&gt; int ldvs = n;&lt;BR /&gt; int lwork = 3 * n;&lt;BR /&gt; int sdim = 0;&lt;BR /&gt; &lt;BR /&gt; double wr[A_ROWS];&lt;BR /&gt; double wi[A_ROWS];&lt;BR /&gt; double work[3 * A_ROWS];&lt;BR /&gt;&lt;BR /&gt; double T[A_SIZE];&lt;BR /&gt; double U[A_SIZE];&lt;BR /&gt;&lt;BR /&gt; for (int i = 0; i &amp;lt; A_SIZE; ++i)&lt;BR /&gt;  T&lt;I&gt; = A&lt;I&gt;;&lt;BR /&gt;&lt;BR /&gt; dgees_(&amp;amp;jobvs, &amp;amp;sort, 0, &amp;amp;n, T, &amp;amp;lda, &amp;amp;sdim, wr, wi,&lt;BR /&gt;  U, &amp;amp;ldvs, work, &amp;amp;lwork, 0, &amp;amp;info);&lt;BR /&gt;&lt;BR /&gt; cout &amp;lt;&amp;lt; "T = [ ";&lt;BR /&gt; for (int i = 0; i &amp;lt; A_SIZE; ++i)&lt;BR /&gt;  cout &amp;lt;&amp;lt; T&lt;I&gt; &amp;lt;&amp;lt; " ";&lt;BR /&gt; cout &amp;lt;&amp;lt; "]" &amp;lt;&amp;lt; endl;&lt;BR /&gt;&lt;BR /&gt; cout &amp;lt;&amp;lt; "U = [ ";&lt;BR /&gt; for (int i = 0; i &amp;lt; A_SIZE; ++i)&lt;BR /&gt;&amp;amp;nb
sp;  cout &amp;lt;&amp;lt; U&lt;I&gt; &amp;lt;&amp;lt; " ";&lt;BR /&gt; cout &amp;lt;&amp;lt; "]" &amp;lt;&amp;lt; endl;&lt;BR /&gt; &lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/IOSTREAM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;</description>
      <pubDate>Wed, 02 Jan 2008 19:24:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dynamic-linking-error-when-using-dgees-or-zgees-LAPACK-functions/m-p/871847#M8576</guid>
      <dc:creator>ediap</dc:creator>
      <dc:date>2008-01-02T19:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic linking error when using dgees() or zgees() LAPACK</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dynamic-linking-error-when-using-dgees-or-zgees-LAPACK-functions/m-p/871848#M8577</link>
      <description>&lt;BR /&gt;Your error message appears to say that you shouldn't use mkl_c library (not, I believe, a new style "layered" library) along with mkl_core. My guess is that you should use mkl_sequential and mkl_core. I would agree that the documentation is buggy, if it led you to unsuccessful combinations. Static link may be successful where dynamic is not, if the objects you actually want are found before any duplicated names of different functionality.&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jan 2008 21:57:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dynamic-linking-error-when-using-dgees-or-zgees-LAPACK-functions/m-p/871848#M8577</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2008-01-02T21:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic linking error when using dgees() or zgees() LAPACK</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dynamic-linking-error-when-using-dgees-or-zgees-LAPACK-functions/m-p/871849#M8578</link>
      <description>&lt;FONT face="Verdana"&gt;Hi Tim,&lt;BR /&gt;&lt;BR /&gt;Your suggestion to use only mkl_sequential with mkl_core does not work. In such case, the _dgees symbol is unresolved:&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;1&amp;gt;Linking...&lt;BR /&gt;1&amp;gt;schur_mkl.obj : error LNK2001: unresolved external symbol _dgees&lt;BR /&gt;1&amp;gt;schur_mkl.exe : fatal error LNK1120: 1 unresolved externals&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;FONT face="Verdana"&gt;&lt;BR /&gt;This is expected behaviour, since the interface library is missing. And according to the documentation one has to select the interface library, threading library and computational library at least.&lt;BR /&gt;&lt;BR /&gt;So, I believe that the documentation is OK, but there is a problem in MKL's DLL libraries in this case. Especially that other LAPACK functions (dgeev(), zgeev(), dgesvd() and zgesvd()) can be used without any problems with the same set of libraries, i.e.: "mkl_intel_c_dll.lib mkl_sequential_dll.lib mkl_core_dll.lib".&lt;BR /&gt;&lt;BR /&gt;Do you happen to know where should I report this bug? Is there any bug tracker service for MKL?&lt;BR /&gt;&lt;BR /&gt;Thanks again for your help.&lt;BR /&gt;&lt;BR /&gt;BR,&lt;BR /&gt;/Adam&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Thu, 03 Jan 2008 09:23:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dynamic-linking-error-when-using-dgees-or-zgees-LAPACK-functions/m-p/871849#M8578</guid>
      <dc:creator>ediap</dc:creator>
      <dc:date>2008-01-03T09:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic linking error when using dgees() or zgees() LAPACK</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dynamic-linking-error-when-using-dgees-or-zgees-LAPACK-functions/m-p/871850#M8579</link>
      <description>&lt;P&gt;Yes, it is the error in MKL DLL libraries. The error will be fixed in the nearest time.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2008 14:20:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dynamic-linking-error-when-using-dgees-or-zgees-LAPACK-functions/m-p/871850#M8579</guid>
      <dc:creator>Andrey_Bespalov</dc:creator>
      <dc:date>2008-02-14T14:20:18Z</dc:date>
    </item>
  </channel>
</rss>

