<?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 Hi Kevin, in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106799#M70707</link>
    <description>&lt;P&gt;Hi Kevin,&lt;/P&gt;

&lt;P&gt;Thanks for your advice. I'll update my MPSS version and try again.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jan 2016 15:43:44 GMT</pubDate>
    <dc:creator>wang_p_1</dc:creator>
    <dc:date>2016-01-30T15:43:44Z</dc:date>
    <item>
      <title>offload error: dlopen() failed</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106795#M70703</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;When I try to run my offload code application, I got this error:&lt;/P&gt;

&lt;P&gt;On the remote process, dlopen() failed. The error message sent back from the sink is /tmp/coi_procs/1/3640/load_lib/icpcoutmdD0mj: undefined symbol: _ZSt3maxIiERKT_S2_S2_&lt;BR /&gt;
	On the sink, dlopen() returned NULL. The result of dlerror() is "/tmp/coi_procs/1/3640/load_lib/icpcoutmdD0mj: undefined symbol: _ZSt3maxIiERKT_S2_S2_"&lt;BR /&gt;
	offload error: cannot load library to the device 0 (error code 20)&lt;/P&gt;

&lt;P&gt;My compiler version is :&lt;/P&gt;

&lt;P&gt;Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.2.144 Build 20140120&lt;/P&gt;

&lt;P&gt;Actually, I have try to add compiler option like:&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 12px;"&gt;-offload-option,mic,compiler,"-z defs"&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 12px;"&gt;But I failed. More error information occupied my screen:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;offloadConst:(.rodata+0x0): multiple definition of `_IO_stdin_used'&lt;BR /&gt;
	/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o:(.rodata.cst4+0x0): first defined here&lt;BR /&gt;
	offloadConst: In function `main':&lt;BR /&gt;
	(.text+0x160): multiple definition of `main'&lt;BR /&gt;
	/tmp/icpc4lThgP.o:offloadConst.cpp:(.text+0x0): first defined here&lt;BR /&gt;
	offloadConst:(.rodata+0x8): multiple definition of `__dso_handle'&lt;BR /&gt;
	/usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtbegin.o:(.rodata+0x0): first defined here&lt;BR /&gt;
	offloadConst:(.bss+0x120): multiple definition of `array'&lt;/P&gt;

&lt;P&gt;....&lt;/P&gt;

&lt;P&gt;When I remove the offload code, my application runs well.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Could you please help me how to resolve this problem&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 07:58:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106795#M70703</guid>
      <dc:creator>wang_p_1</dc:creator>
      <dc:date>2016-01-28T07:58:30Z</dc:date>
    </item>
    <item>
      <title>The message typically relates</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106796#M70704</link>
      <description>&lt;P&gt;The message typically relates to a symbol lacking the needed offload declaration.&lt;/P&gt;

&lt;P&gt;First try correcting the syntax you noted using for the "&lt;STRONG&gt;-z defs&lt;/STRONG&gt;" option. What you posted likely did not have the intended affect. If you are performing a single combined compile and link, then use the first form below. The second form is used only when performing a link.&lt;/P&gt;

&lt;P&gt;When passing it through the compiler, the form is:&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;-offload-option,mic,compiler,"-Wl,-zdefs"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;When passing directly to the linker only, the form is:&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;-offload-option,mic,ld,"-z defs"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;If you are still unable to resolve this issue after correcting the "&lt;STRONG&gt;-z defs&lt;/STRONG&gt;"&lt;STRONG&gt; &lt;/STRONG&gt;syntax&amp;nbsp;then please upload a reproducer that we can work with. The compiler you noted is older and there is also always a possibility of an underlying compiler issue causing this too. We could easily check that with the reproducer too.&lt;/P&gt;

&lt;P&gt;Also, what version of MPSS are you using?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 10:54:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106796#M70704</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2016-01-28T10:54:55Z</dc:date>
    </item>
    <item>
      <title>Kevin,</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106797#M70705</link>
      <description>&lt;P&gt;Kevin,&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 12px;"&gt;Thanks for your quick response.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 12px;"&gt;I have try to use the new compiler option like this:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;icpc -o build/debug/volume/volcache.os -c -offload-option,mic,compiler,"-Wl,-zdefs" -O0 -Wall -g -pipe -ipo -no-prec-div -xSSE3 -fp-model fast=2 -openmp -mfpmath=sse -march=nocona -fno-math-errno -fomit-frame-pointer -DMTS_DEBUG -DSINGLE_PRECISION -DSPECTRUM_SAMPLES=3 -DMTS_SSE -DMTS_HAS_COHERENT_RT -fopenmp -fvisibility=hidden -std=c++0x -wd2928 -Qoption,cpp,--rvalue_ctor_is_not_copy_ctor -fPIC -DMTS_HAS_LIBPNG=1 -DMTS_HAS_LIBJPEG=1 -DMTS_HAS_OPENEXR=1 -DMTS_HAS_FFTW=1 -I/usr/include/eigen3 -I/usr/include/OpenEXR -I/usr/local/include -Iinclude src/volume/volcache.cpp&lt;/P&gt;

&lt;P&gt;My MPSS version is:&lt;/P&gt;

&lt;P&gt;MicInfo Utility Log&lt;/P&gt;

&lt;P&gt;Created Thu Jan 28 20:31:59 2016&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;VERSION: 2.1.6720&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Copyright 2011-2013 Intel Corporation All Rights Reserved.&lt;/P&gt;

&lt;P&gt;I'm trying to add offload code into Mitsuba which is an&amp;nbsp;&lt;SPAN style="font-size: 13.008px; line-height: 13.008px;"&gt;open source renderer. &lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 13.008px;"&gt;There was only one .cpp file added with offload code, and it is very simple:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 13.008px;"&gt;//...many head files, like boost&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 13.008px;"&gt;#include &amp;lt;head.h&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 13.008px;"&gt;#pragma offload_attribute(push,target(mic))&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;const Surfel* micSurfelsPtr = 0;&lt;/P&gt;

&lt;P&gt;float* micColorPtr = 0;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 13.008px;"&gt;#pragma offload_attribute(pop)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 13.008px;"&gt;void myFunction{&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 13.008px;"&gt;micSurfelsPtr = ....;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;micColorPtr = ...;&lt;/P&gt;

&lt;P&gt;#pragma offload_transfer target(mic:0) in(micSurfelsPtr:length(size) alloc_if(1) free_if(0)&lt;/P&gt;

&lt;P&gt;...// do something&lt;/P&gt;

&lt;P&gt;#pragma offload target(mic:0) out(micColorPtr:length(size) alloc_if(1) free_if(1)&lt;/P&gt;

&lt;P&gt;{&lt;/P&gt;

&lt;P&gt;// do something&lt;/P&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 13.008px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="line-height: 13.008px;"&gt;Before this error, I have resolved another problem by myself:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;catastrophic error: *MIC* cannot open source file "boost/version.hpp"&amp;nbsp;&lt;/P&gt;

&lt;P&gt;by adding the boost head files path like:&lt;/P&gt;

&lt;P&gt;-I /myBoostIncludePath&lt;/P&gt;

&lt;P&gt;My application could find the boost head files by itself but added offload code it could not.&lt;/P&gt;

&lt;P&gt;Thanks you again.&lt;/P&gt;

&lt;P&gt;Best wishes.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 13:04:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106797#M70705</guid>
      <dc:creator>wang_p_1</dc:creator>
      <dc:date>2016-01-28T13:04:05Z</dc:date>
    </item>
    <item>
      <title>MPSS 2.1 is really old. I</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106798#M70706</link>
      <description>&lt;P&gt;MPSS 2.1 is really old. I recommend you consider upgrading both your MPSS and Parallel Studio versions. I think you would be well served by that.&lt;/P&gt;

&lt;P&gt;I see &lt;STRONG&gt;–c&lt;/STRONG&gt; in your compile line which only compiles to object so the offload-option being added will not have an effect. The &lt;STRONG&gt;–z defs &lt;/STRONG&gt;is a linker option that needs to be passed to the linker. If your build procedure compiles many files to object and then combines them with a single linker step, then you need to add the &lt;STRONG&gt;–offload-option &lt;/STRONG&gt;to that link step. In that case, you need to use icpc to drive the link and add the second form of the option I mentioned in my earlier post.&lt;/P&gt;

&lt;P&gt;I am not proficient in using Boost with offload code. To use Boost functionality/features within the offloaded code you must ensure the Boost headers are available for the offload compilation by encapsulating them in the appropriate &lt;STRONG&gt;#pragma offload_attribute(push/pop) &lt;/STRONG&gt;and that associated run-time libraries are built for Xeon Phi and available at link time.&lt;/P&gt;

&lt;P&gt;I do not know anything beyond what is mentioned in &lt;A href="https://software.intel.com/en-us/forums/intel-many-integrated-core/topic/550880" target="_blank"&gt;this post &lt;/A&gt;about a pre-built Boost available with MPSS, but my guess is it probably applies to newer MPSS releases than 2.1.&lt;/P&gt;

&lt;P&gt;The article, &lt;A href="https://software.intel.com/en-us/articles/building-the-boost-library-to-run-natively-on-intelr-xeon-phitm-coprocessor" target="_blank"&gt;Building the Boost library to run natively on Intel(R) Xeon Phi(tm) Coprocessor&lt;/A&gt;, might be of interest/value too.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 17:06:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106798#M70706</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2016-01-29T17:06:11Z</dc:date>
    </item>
    <item>
      <title>Hi Kevin,</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106799#M70707</link>
      <description>&lt;P&gt;Hi Kevin,&lt;/P&gt;

&lt;P&gt;Thanks for your advice. I'll update my MPSS version and try again.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 15:43:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-dlopen-failed/m-p/1106799#M70707</guid>
      <dc:creator>wang_p_1</dc:creator>
      <dc:date>2016-01-30T15:43:44Z</dc:date>
    </item>
  </channel>
</rss>

