<?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 static linking with MKL in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811137#M3939</link>
    <description>&lt;P&gt;gnu ld places ordering requirements. You would need to put your .o files ahead of the MKL libraries, so that the linker knows which MKL functions are required when reading the .a files. Also, as mentioned in an earlier answer, you must remove -lguide, as the -parallel and -openmp options in your compiler imply -liomp5.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Feb 2011 18:19:00 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2011-02-01T18:19:00Z</dc:date>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811130#M3932</link>
      <description>Dear all,&lt;BR /&gt;&lt;BR /&gt;I am using Intel C++ Compiler 11.1 and MKL sipped with the compiler suite on Linux. My code works fine, but I can not link the MKL libraries in static way so the code will be portable without need to have MKL library file on other systems. I use following options:&lt;BR /&gt;&lt;BR /&gt;MKL = -Wl, --start-group "/home/dan/intel/Compiler/11.1/073/mkl/lib/em64t"/libmkl_intel_lp64.a "/home/dan/intel/Compiler/11.1/073/mkl/lib/em64t"/libmkl_intel_thread.a "/home/dan/intel/Compiler/11.1/073/mkl/lib/em64t"/libmkl_core.a -Wl, --end-group -openmp -lpthread -lguide -static-intel -lmkl_solver_lp64 -DMKL_Complex16="std::complex&lt;DOUBLE&gt;"&lt;BR /&gt;&lt;BR /&gt;but the linker fails with this error message:&lt;BR /&gt;&lt;BR /&gt;__tmp_ztrtri.f:(.text+0x37b): undefined reference to `mkl_blas_ztrmm'&lt;BR /&gt;__tmp_ztrtri.f:(.text+0x6a5): undefined reference to `mkl_blas_ztrmm'&lt;BR /&gt;/home/dan/intel/Compiler/11.1/073/mkl/lib/em64t/libmkl_core.a(dtrtri.o): In function `mkl_lapack_dtrtri':&lt;BR /&gt;__tmp_dtrtri.f:(.text+0x383): undefined reference to `mkl_blas_dtrmm'&lt;BR /&gt;__tmp_dtrtri.f:(.text+0x697): undefined reference to `mkl_blas_dtrmm'&lt;BR /&gt;&lt;BR /&gt;I have googled about it but didn't find something different. Have you ever had same experience that would help?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;D.&lt;BR /&gt;&lt;/DOUBLE&gt;</description>
      <pubDate>Tue, 01 Feb 2011 11:51:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811130#M3932</guid>
      <dc:creator>Dan4</dc:creator>
      <dc:date>2011-02-01T11:51:02Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811131#M3933</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You need to&lt;BR /&gt;1) delete -lguide (because you already used -openmp)&lt;BR /&gt;2) move library -lmkl_solver_lp64 before all MKL libraries if you need it or delete</description>
      <pubDate>Tue, 01 Feb 2011 12:49:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811131#M3933</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2011-02-01T12:49:40Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811132#M3934</link>
      <description>Hi Victor and thanks for your help. I did exactly what you mentioned but it didn't help. I can successfully compiler the code with exactly same options but using dynamic libraries (.so instead of .a) without any error.&lt;BR /&gt;&lt;BR /&gt;D.&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2011 12:55:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811132#M3934</guid>
      <dc:creator>Dan4</dc:creator>
      <dc:date>2011-02-01T12:55:23Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811133#M3935</link>
      <description>&lt;P&gt;OK&lt;BR /&gt;Could you please create small testcase to reproduce the problem?&lt;BR /&gt;What MKL version do you use?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2011 13:07:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811133#M3935</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2011-02-01T13:07:50Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811134#M3936</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I queried the version of MKL and it is&lt;BR /&gt;&lt;BR /&gt;Intel Math Kernel Library Version 10.2.6 Product Build 20100728 for Intel 64 architecture applications&lt;BR /&gt;&lt;BR /&gt;About the smaller test case, I guess it would be same, because even with few lines of code, the compiling options would be same so that won't help. Am I right?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;D.&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2011 13:55:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811134#M3936</guid>
      <dc:creator>Dan4</dc:creator>
      <dc:date>2011-02-01T13:55:12Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811135#M3937</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1296569482380="63" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=410217" href="https://community.intel.com/en-us/profile/410217/" class="basic"&gt;danltu.se&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;About the smaller test case, I guess it would be same, because even with few lines of code, the compiling options would be same so that won't help&lt;BR /&gt;&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Well, could you please send it with complete compile and link line?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2011 14:13:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811135#M3937</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2011-02-01T14:13:48Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811136#M3938</link>
      <description>Sure, the compilation is done as:&lt;BR /&gt;&lt;BR /&gt;/home/dan/intel/Compiler/11.1/073/bin/intel64/icpc -DHAVE_CONFIG_H -I. -I/home/dan/intel/Compiler/11.1/073/mkl/include -I.. -I../include -DNOGMM_VERIFY -DUSE_OPENMP -O0 -ipo0 -fp-model precise -parallel -openmp -vec-report -par-report -openmp-report -DMKL_VML_MIXED -static-intel -fasm-blocks -use-msasm -MT solver.o -MD -MP -MF .deps/solver.Tpo -c -o solver.o solver.cpp&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The above line compiles only one file "solver.cpp" but all source files are compiled with same options, and they are linked as:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/home/dan/intel/Compiler/11.1/073/bin/intel64/icpc -O0 -ipo0 -fp-model precise -parallel -openmp -vec-report -par-report -openmp-report -DMKL_VML_MIXED -static-intel -fasm-blocks -use-msasm -Wl, --start-group "/home/dan/intel/Compiler/11.1/073/mkl/lib/em64t"/libmkl_intel_lp64.a "/home/dan/intel/Compiler/11.1/073/mkl/lib/em64t"/libmkl_intel_thread.a "/home/dan/intel/Compiler/11.1/073/mkl/lib/em64t"/libmkl_core.a -Wl, --end-group -openmp -lpthread -static-intel -DMKL_Complex16="std::complex&lt;DOUBLE&gt;" -o peec lproutines.o computation.o comp_wrapper.o util.o functions.o model.o parser.o solver.o peec.o integrationAPI.o subdivision.o matlabPlotter.o vtkPlotter.o incidentField.o FieldCalculator.o -lstdc++ -L/home/dan/intel/Compiler/11.1/073/mkl/lib/em64t -lguide -lpthread -lcxaguard -limf -lirc&lt;BR /&gt;&lt;BR /&gt;Thanks for your help,&lt;BR /&gt;&lt;BR /&gt;D.&lt;BR /&gt;&lt;/DOUBLE&gt;</description>
      <pubDate>Tue, 01 Feb 2011 15:37:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811136#M3938</guid>
      <dc:creator>Dan4</dc:creator>
      <dc:date>2011-02-01T15:37:13Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811137#M3939</link>
      <description>&lt;P&gt;gnu ld places ordering requirements. You would need to put your .o files ahead of the MKL libraries, so that the linker knows which MKL functions are required when reading the .a files. Also, as mentioned in an earlier answer, you must remove -lguide, as the -parallel and -openmp options in your compiler imply -liomp5.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2011 18:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811137#M3939</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2011-02-01T18:19:00Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811138#M3940</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for your help. The problem with MKL static linking isn actually solved! I should have removed the space between "-Wl," and "--start-group"! Now it works fine. The new problem is that when I copy my executable into a virgin machine, it still complains:&lt;BR /&gt;&lt;BR /&gt;error while loading shared libraries: libguide.so: cannot open shared object file: No such file or directory&lt;BR /&gt;&lt;BR /&gt;I tried to link static "libguide.a" and however it was linked without any problem, but the problem still exists. Is there any way to link everything in a static way or there are some shared libraries that should be shipped anyway?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;D.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2011 19:02:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811138#M3940</guid>
      <dc:creator>Dan4</dc:creator>
      <dc:date>2011-02-01T19:02:20Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811139#M3941</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Actually I solved the previous problem by static link to "libguide.a" but now it needs:&lt;BR /&gt;&lt;BR /&gt;error while loading shared libraries: libcxaguard.so.5: cannot open shared object file: No such file or directory&lt;BR /&gt;&lt;BR /&gt;I used static link to "libcxaguard.a" but it didn't fix the problem. Is there any remedy for this?&lt;BR /&gt;&lt;BR /&gt;I am wondering if there is any way to tell compiler (or linker) to use static link whenever a dynamic library is needed by giving the path of course. Here by just testing one by one is a very tedious task.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;D.&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2011 20:32:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811139#M3941</guid>
      <dc:creator>Dan4</dc:creator>
      <dc:date>2011-02-01T20:32:46Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811140#M3942</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you use option -openmp then libguide will not be required. So, it's strange that you had problem with"libguide.a" and "libcxaguard.a".&lt;BR /&gt;&lt;BR /&gt;As to your question:&lt;BR /&gt; any way to tell compiler (or linker) to use static link whenever a dynamic library is needed&lt;BR /&gt;- please clarify what you mean.&lt;BR /&gt;&lt;BR /&gt;Here areoptions to tell compiler to use static or dynamic libraries:&lt;BR /&gt; On Linux can be used options (pair of brackets) -Bstatic .... -Bdynamic when -l&lt;LIBRARY_NAME&gt;are used inside there together with -L&lt;PATH_TO_LIBRARIES&gt;&lt;BR /&gt; Also, you can use -static to use only static linking for all libraries.&lt;/PATH_TO_LIBRARIES&gt;&lt;/LIBRARY_NAME&gt;</description>
      <pubDate>Wed, 02 Feb 2011 04:35:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811140#M3942</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2011-02-02T04:35:31Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811141#M3943</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You were right. I removed "libguide.a" and "libcxaguard.a" and used "-openmp" and it is solved now. So practically no further libraries are needed. I recently read in MKL release notes I think, that it is recommended to use dynamic libraries. I don't know why, so I am thinking to either compile with static linking and also keep the option to ship redistributable libraries by dynamic linking.&lt;BR /&gt;&lt;BR /&gt;Anyway, thank you so much all for your valuable comments and help.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Danesh&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Feb 2011 15:34:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811141#M3943</guid>
      <dc:creator>Dan4</dc:creator>
      <dc:date>2011-02-17T15:34:43Z</dc:date>
    </item>
    <item>
      <title>static linking with MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811142#M3944</link>
      <description>Using dynamic libraries avoids some problems you could get into with link order on static libraries. You can download a redistributable library package should you choose to go that way.</description>
      <pubDate>Fri, 18 Feb 2011 01:17:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811142#M3944</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2011-02-18T01:17:50Z</dc:date>
    </item>
    <item>
      <title>Since this article may still</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811143#M3945</link>
      <description>&lt;P&gt;Since this article may still appear when searching for static linkage, I wanted to point people to the &lt;A href="http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor"&gt;Intel MKL Link Line Advisor&lt;/A&gt; - this should be the first place when linking with Intel MKL libraries. For custom static linkage (e.g., in case of a lagacy build system), the following &lt;A href="http://software.intel.com/en-us/articles/intel-mkl-custom-static-linkage"&gt;article &lt;/A&gt;might be helpful as well.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2013 06:52:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/static-linking-with-MKL/m-p/811143#M3945</guid>
      <dc:creator>Hans_P_Intel</dc:creator>
      <dc:date>2013-08-27T06:52:32Z</dc:date>
    </item>
  </channel>
</rss>

