<?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 offload error: cannot load library to the device in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device/m-p/926289#M13910</link>
    <description>&lt;P&gt;I am trying to program the Xeon Phi in offload mode. The program below should just construct objects from the standard library on the card, but linking fails with the following error:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;On the remote process, dlopen() failed. The error message sent back from the sink is /var/volatile/tmp/coi_procs/1/27843/load_lib/icpcoutdlt28i: undefined symbol: _ZNSt6vectorIdSaIdEEC1EmRKdRKS0_&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;offload error: cannot load library to the device 0 (error code 20)&lt;BR /&gt;
	On the sink, dlopen() returned NULL. The result of dlerror() is "/var/volatile/tmp/coi_procs/1/27843/load_lib/icpcoutdlt28i: undefined symbol: _ZNSt6vectorIdSaIdEEC1EmRKdRKS0_"&lt;/P&gt;

&lt;P&gt;if compiled with:&lt;/P&gt;

&lt;P&gt;icpc -openmp example.cpp&lt;/P&gt;

&lt;P&gt;Looks like he is not finding the std library for the mic ..... whats the correct compilation line?&lt;/P&gt;

&lt;P&gt;Dario&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;[cpp]&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;#include&amp;lt;iostream&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;#include&amp;lt;math.h&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;#include&amp;lt;vector&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;#include&amp;lt;omp.h&amp;gt;&lt;/P&gt;

&lt;P&gt;__attribute__((target(mic))) void &amp;nbsp;wrapper() {&lt;/P&gt;

&lt;P&gt;std::vector&amp;lt;double&amp;gt; x(2,0.1), f(1);&lt;/P&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	int main () {&lt;/P&gt;

&lt;P&gt;&amp;nbsp; #pragma omp parallel sections&lt;/P&gt;

&lt;P&gt;&amp;nbsp; {&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; #pragma omp section&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; {&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout &amp;lt;&amp;lt; "Executing on CPUs\n";&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; wrapper();&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout &amp;lt;&amp;lt; "I am done on CPUs\n";&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; #pragma omp section&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; {&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout &amp;lt;&amp;lt; "Executing on Xeon Phi\n";&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;#pragma offload target(mic)&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;{&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wrapper();&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout &amp;lt;&amp;lt; "I am done on Xeon Phi\n";&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;

&lt;P&gt;&amp;nbsp; }&lt;/P&gt;

&lt;P&gt;return 0;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;}[/cpp]&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2013 12:08:56 GMT</pubDate>
    <dc:creator>Dario_I_</dc:creator>
    <dc:date>2013-12-03T12:08:56Z</dc:date>
    <item>
      <title>offload error: cannot load library to the device</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device/m-p/926289#M13910</link>
      <description>&lt;P&gt;I am trying to program the Xeon Phi in offload mode. The program below should just construct objects from the standard library on the card, but linking fails with the following error:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;On the remote process, dlopen() failed. The error message sent back from the sink is /var/volatile/tmp/coi_procs/1/27843/load_lib/icpcoutdlt28i: undefined symbol: _ZNSt6vectorIdSaIdEEC1EmRKdRKS0_&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;offload error: cannot load library to the device 0 (error code 20)&lt;BR /&gt;
	On the sink, dlopen() returned NULL. The result of dlerror() is "/var/volatile/tmp/coi_procs/1/27843/load_lib/icpcoutdlt28i: undefined symbol: _ZNSt6vectorIdSaIdEEC1EmRKdRKS0_"&lt;/P&gt;

&lt;P&gt;if compiled with:&lt;/P&gt;

&lt;P&gt;icpc -openmp example.cpp&lt;/P&gt;

&lt;P&gt;Looks like he is not finding the std library for the mic ..... whats the correct compilation line?&lt;/P&gt;

&lt;P&gt;Dario&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;[cpp]&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;#include&amp;lt;iostream&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;#include&amp;lt;math.h&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;#include&amp;lt;vector&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;#include&amp;lt;omp.h&amp;gt;&lt;/P&gt;

&lt;P&gt;__attribute__((target(mic))) void &amp;nbsp;wrapper() {&lt;/P&gt;

&lt;P&gt;std::vector&amp;lt;double&amp;gt; x(2,0.1), f(1);&lt;/P&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	int main () {&lt;/P&gt;

&lt;P&gt;&amp;nbsp; #pragma omp parallel sections&lt;/P&gt;

&lt;P&gt;&amp;nbsp; {&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; #pragma omp section&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; {&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout &amp;lt;&amp;lt; "Executing on CPUs\n";&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; wrapper();&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout &amp;lt;&amp;lt; "I am done on CPUs\n";&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; #pragma omp section&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; {&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout &amp;lt;&amp;lt; "Executing on Xeon Phi\n";&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;#pragma offload target(mic)&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;{&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wrapper();&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout &amp;lt;&amp;lt; "I am done on Xeon Phi\n";&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;

&lt;P&gt;&amp;nbsp; }&lt;/P&gt;

&lt;P&gt;return 0;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em"&gt;}[/cpp]&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 12:08:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device/m-p/926289#M13910</guid>
      <dc:creator>Dario_I_</dc:creator>
      <dc:date>2013-12-03T12:08:56Z</dc:date>
    </item>
    <item>
      <title>Compilation line is fine.</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device/m-p/926290#M13911</link>
      <description>&lt;P&gt;Compilation line is fine. Program needs to declare instances of headers for the MIC side. Change the include statements&amp;nbsp;to something like this:&lt;/P&gt;

&lt;P&gt;#pragma offload_attribute (push, target(mic))&lt;BR /&gt;
	#include&amp;lt;iostream&amp;gt;&lt;BR /&gt;
	#include&amp;lt;vector&amp;gt;&lt;BR /&gt;
	#pragma offload_attribute (pop)&lt;/P&gt;

&lt;P&gt;You may need to add other includes within the offload_attribute as you expand the code within the offload sections.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 17:43:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device/m-p/926290#M13911</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2013-12-03T17:43:58Z</dc:date>
    </item>
    <item>
      <title>Thanks! That did it :)</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device/m-p/926291#M13912</link>
      <description>&lt;P&gt;Thanks! That did it :)&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 18:17:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device/m-p/926291#M13912</guid>
      <dc:creator>Dario_I_</dc:creator>
      <dc:date>2013-12-03T18:17:28Z</dc:date>
    </item>
  </channel>
</rss>

