<?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 Re:Linker error with gold in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480892#M34535</link>
    <description>&lt;P&gt;Hi Samuel,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;the programm could be executed successfully.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Glad to know that you are able to run without errors. Could you please confirm if we can close this case from our end?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Varsha&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 27 Apr 2023 14:23:41 GMT</pubDate>
    <dc:creator>VarshaS_Intel</dc:creator>
    <dc:date>2023-04-27T14:23:41Z</dc:date>
    <item>
      <title>Linker error with gold</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480025#M34516</link>
      <description>&lt;P&gt;Hi there, when linking MKL with the GNU gold linker, the binaries seem to be broken:&lt;/P&gt;
&lt;PRE&gt;#!/usr/bin/env bash&lt;BR /&gt;&lt;BR /&gt;function cyan {&lt;BR /&gt;    echo -e "\033[1;34m$*\033[0m"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;MKL_DIR="$HOME/intel/oneapi/mkl/latest"&lt;BR /&gt;MKL_LIB_DIR="$MKL_DIR/lib/intel64"&lt;BR /&gt;MKL_INC_DIR="$MKL_DIR/include"&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt; EOF &amp;gt; demo.cpp&lt;BR /&gt;#include &amp;lt;iostream&amp;gt;&lt;BR /&gt;#include &amp;lt;string&amp;gt;&lt;BR /&gt;#include "mkl.h"&lt;BR /&gt;int main() {&lt;BR /&gt;    std::string buffer(200, '\0');&lt;BR /&gt;    MKL_Get_Version_String(buffer.data(), 200);&lt;BR /&gt;    std::cout &amp;lt;&amp;lt; buffer &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;}&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;COMPILER_ARGS="-I"$MKL_INC_DIR" demo.cpp -L"$MKL_LIB_DIR" -Wl,-rpath="$MKL_LIB_DIR" -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5"&lt;BR /&gt;&lt;BR /&gt;cyan "Without gold:" &lt;BR /&gt;g++ $COMPILER_ARGS -o nogold&lt;BR /&gt;ldd nogold | grep mkl&lt;BR /&gt;./nogold&lt;BR /&gt;&lt;BR /&gt;echo&lt;BR /&gt;cyan "With gold:"&lt;BR /&gt;g++ $COMPILER_ARGS -fuse-ld=gold -o withgold&lt;BR /&gt;ldd withgold | grep mkl&lt;BR /&gt;./withgold&lt;BR /&gt;&lt;BR /&gt;echo&lt;BR /&gt;cyan "With mold:"&lt;BR /&gt;g++ $COMPILER_ARGS -fuse-ld=mold -o withmold&lt;BR /&gt;ldd withmold | grep mkl&lt;BR /&gt;./withmold&lt;BR /&gt;&lt;BR /&gt;echo&lt;BR /&gt;cyan "Without gold, g++-12:"&lt;BR /&gt;g++-12 $COMPILER_ARGS -o nogold12&lt;BR /&gt;ldd nogold12 | grep mkl&lt;BR /&gt;./nogold12&lt;BR /&gt;&lt;BR /&gt;echo&lt;BR /&gt;cyan "With gold, g++-12:"&lt;BR /&gt;g++-12 $COMPILER_ARGS -fuse-ld=gold -o withgold12&lt;BR /&gt;ldd withgold12 | grep mkl&lt;BR /&gt;./withgold12&lt;BR /&gt;&lt;BR /&gt;echo&lt;BR /&gt;cyan "With mold, g++-12:"&lt;BR /&gt;g++-12 $COMPILER_ARGS -fuse-ld=mold -o withmold12&lt;BR /&gt;ldd withmold12 | grep mkl&lt;BR /&gt;./withmold12&lt;/PRE&gt;
&lt;P&gt;The standard linker and mold do fine, but with gold I get:&lt;/P&gt;
&lt;PRE&gt;With gold:&lt;BR /&gt;libmkl_intel_ilp64.so.2 =&amp;gt; ~/intel/oneapi/mkl/latest/lib/intel64/libmkl_intel_ilp64.so.2 (0x00007f6b8daa3000)&lt;BR /&gt;./withgold: symbol lookup error: ~/intel/oneapi/mkl/latest/lib/intel64/libmkl_intel_ilp64.so.2: undefined symbol: mkl_blas_dgemm&lt;/PRE&gt;
&lt;P&gt;This was tested with the latest MKL "2023.1-Product Build 20230303".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 14:27:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480025#M34516</guid>
      <dc:creator>el_samuko</dc:creator>
      <dc:date>2023-04-25T14:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error with gold</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480833#M34530</link>
      <description>&lt;P&gt;Hi Samuel,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for posting in Intel Communities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please try using the below command where we are able to get the expected results using the option "-fuse-ld=gold":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; g++-12 -DMKL_ILP64 -m64 -I"${MKLROOT}/include" demoversion.cpp -o demogold12 -L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_intel_ilp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl -fuse-ld=gold&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please find the below screenshot where we have tried using the option -fuse-ld=gold and also without a gold linker.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VarshaS_Intel_0-1682594361096.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/40772i11E682FAF0A64AC7/image-size/medium?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="VarshaS_Intel_0-1682594361096.png" alt="VarshaS_Intel_0-1682594361096.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And also, you can use the tool Intel Link Line Advisor for compiling and linking your code as it is compatible with several compilers and third-party libraries and provides different interfaces to the functionality. Please find the below link for more details:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html" target="_blank" rel="noopener"&gt;https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please try and let us know if you face any errors?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Varsha&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 13:39:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480833#M34530</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2023-04-27T13:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error with gold</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480849#M34531</link>
      <description>&lt;P&gt;Hi Varsha,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for your tipps. The &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;-Wl,--no-as-needed&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;before the libs was enough that ldd printed all libs and the programm could be executed successfully.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got the command line for the compiler from the MKL included cmake:&lt;/P&gt;
&lt;PRE&gt;find_package(MKL CONFIG REQUIRED)&lt;BR /&gt;target_link_libraries(demo MKL::MKL)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Samuel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 12:37:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480849#M34531</guid>
      <dc:creator>el_samuko</dc:creator>
      <dc:date>2023-04-27T12:37:36Z</dc:date>
    </item>
    <item>
      <title>Re:Linker error with gold</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480892#M34535</link>
      <description>&lt;P&gt;Hi Samuel,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;the programm could be executed successfully.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Glad to know that you are able to run without errors. Could you please confirm if we can close this case from our end?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Varsha&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Apr 2023 14:23:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480892#M34535</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2023-04-27T14:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error with gold</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480904#M34536</link>
      <description>&lt;P&gt;Hi Varsha,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for me, yes.&lt;/P&gt;
&lt;P&gt;I'd add the &lt;FONT face="courier new,courier" color="#339966"&gt;&lt;STRONG&gt;-Wl,--no-as-needed&lt;/STRONG&gt;&lt;/FONT&gt; to cmake, though, as the link line advisor recommends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Samuel&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 15:04:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480904#M34536</guid>
      <dc:creator>el_samuko</dc:creator>
      <dc:date>2023-04-27T15:04:38Z</dc:date>
    </item>
    <item>
      <title>Re:Linker error with gold</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480938#M34537</link>
      <description>&lt;P&gt;Hi Samuel,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;for me, yes.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Thanks for the confirmation. Glad to know that your issue is resolved. If you need any additional information, please post a new question as this thread will&lt;/P&gt;&lt;P&gt;no longer be monitored by Intel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Varsha&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Apr 2023 16:22:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linker-error-with-gold/m-p/1480938#M34537</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2023-04-27T16:22:20Z</dc:date>
    </item>
  </channel>
</rss>

