<?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 dlopen() failed in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/dlopen-failed/m-p/974223#M24683</link>
    <description>&lt;P&gt;I am trying to get console output from an offloaded program. Here is a c++ versions that works:&lt;/P&gt;

&lt;P&gt;#include &amp;lt;stdio.h&amp;gt; __declspec(target(mic)) int myprint() {&amp;nbsp;&amp;nbsp;printf("hello from mic c++ version\n"); &amp;nbsp;return(0); }&lt;/P&gt;

&lt;P&gt;int main() {&amp;nbsp;&amp;nbsp;int i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __declspec(target(mic)) int myprint();&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #pragma offload target(mic) &amp;nbsp;&amp;nbsp;&amp;nbsp; i=myprint(); }&lt;/P&gt;

&lt;P&gt;The above program yields the expected output:&lt;/P&gt;

&lt;P&gt;hello from mic c++ version Press any key to continue . . .&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Here is a putative fortran version&lt;/P&gt;

&lt;P&gt;!DIR$ ATTRIBUTES OFFLOAD:mic :: myprint subroutine myprint() &amp;nbsp;&amp;nbsp; print *, "hello from mic fortran version" end subroutine myprint&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; program main !DIR$ ATTRIBUTES OFFLOAD:mic :: myprint !DIR$ OFFLOAD target(mic) &amp;nbsp;&amp;nbsp; call myprint() end program main &amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;It does not work! Produces the following output:&lt;/P&gt;

&lt;P&gt;On the remote process, dlopen() failed. The error message sent back from the sin k is /var/volatile/tmp/coi_procs/1/4976/load_lib/oct31MIC.out: undefined symbol:&amp;nbsp;&amp;nbsp;for_write_seq_lis On the sink, dlopen() returned NULL. The result of dlerror() is "/var/volatile/t mp/coi_procs/1/4976/load_lib/oct31MIC.out: undefined symbol: for_write_seq_lis" offload error: cannot load library to the device 0 (error code 20) Press any key to continue . . .&lt;/P&gt;

&lt;P&gt;I also get a simular error if I attempt to open and write a file in offloaded fortran code.&lt;/P&gt;

&lt;P&gt;I need to implement my project in fortran any help to resolve this will be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Nov 2013 21:31:55 GMT</pubDate>
    <dc:creator>Dean_B_</dc:creator>
    <dc:date>2013-11-04T21:31:55Z</dc:date>
    <item>
      <title>dlopen() failed</title>
      <link>https://community.intel.com/t5/Software-Archive/dlopen-failed/m-p/974223#M24683</link>
      <description>&lt;P&gt;I am trying to get console output from an offloaded program. Here is a c++ versions that works:&lt;/P&gt;

&lt;P&gt;#include &amp;lt;stdio.h&amp;gt; __declspec(target(mic)) int myprint() {&amp;nbsp;&amp;nbsp;printf("hello from mic c++ version\n"); &amp;nbsp;return(0); }&lt;/P&gt;

&lt;P&gt;int main() {&amp;nbsp;&amp;nbsp;int i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __declspec(target(mic)) int myprint();&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #pragma offload target(mic) &amp;nbsp;&amp;nbsp;&amp;nbsp; i=myprint(); }&lt;/P&gt;

&lt;P&gt;The above program yields the expected output:&lt;/P&gt;

&lt;P&gt;hello from mic c++ version Press any key to continue . . .&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Here is a putative fortran version&lt;/P&gt;

&lt;P&gt;!DIR$ ATTRIBUTES OFFLOAD:mic :: myprint subroutine myprint() &amp;nbsp;&amp;nbsp; print *, "hello from mic fortran version" end subroutine myprint&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; program main !DIR$ ATTRIBUTES OFFLOAD:mic :: myprint !DIR$ OFFLOAD target(mic) &amp;nbsp;&amp;nbsp; call myprint() end program main &amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;It does not work! Produces the following output:&lt;/P&gt;

&lt;P&gt;On the remote process, dlopen() failed. The error message sent back from the sin k is /var/volatile/tmp/coi_procs/1/4976/load_lib/oct31MIC.out: undefined symbol:&amp;nbsp;&amp;nbsp;for_write_seq_lis On the sink, dlopen() returned NULL. The result of dlerror() is "/var/volatile/t mp/coi_procs/1/4976/load_lib/oct31MIC.out: undefined symbol: for_write_seq_lis" offload error: cannot load library to the device 0 (error code 20) Press any key to continue . . .&lt;/P&gt;

&lt;P&gt;I also get a simular error if I attempt to open and write a file in offloaded fortran code.&lt;/P&gt;

&lt;P&gt;I need to implement my project in fortran any help to resolve this will be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2013 21:31:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dlopen-failed/m-p/974223#M24683</guid>
      <dc:creator>Dean_B_</dc:creator>
      <dc:date>2013-11-04T21:31:55Z</dc:date>
    </item>
    <item>
      <title>Both small examples should</title>
      <link>https://community.intel.com/t5/Software-Archive/dlopen-failed/m-p/974224#M24684</link>
      <description>&lt;P&gt;Both small examples should run successfully and are for me on Linux and Windows.&lt;/P&gt;
&lt;P&gt;What ifort compiler did you use and what compiler options (if any)?&lt;/P&gt;
&lt;P&gt;Here's the Fortran case details:&lt;/P&gt;
&lt;P&gt;$ cat -n test.f90&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; !DIR$ ATTRIBUTES OFFLOAD:mic :: myprint&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp; subroutine myprint()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print *, "hello from mic fortran version"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp; end subroutine myprint&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp; program main&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp; !DIR$ ATTRIBUTES OFFLOAD:mic :: myprint&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp; !DIR$ OFFLOAD target(mic)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call myprint()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp; end program main&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;On Linux:&lt;/STRONG&gt;&lt;BR /&gt;$ ifort -V&lt;BR /&gt;Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.1.106 Build 20131008&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;$ ifort test.f90 ; ./a.out&lt;BR /&gt;&amp;nbsp;hello from mic fortran version&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;On Windows:&lt;/STRONG&gt;&lt;BR /&gt;C:\&amp;gt;ifort test.f90&lt;BR /&gt;Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.1.137 Build 20131008&lt;BR /&gt;Copyright (C) 1985-2013 Intel Corporation.&amp;nbsp; All rights reserved.&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;Microsoft (R) Incremental Linker Version 11.00.60315.1&lt;BR /&gt;Copyright (C) Microsoft Corporation.&amp;nbsp; All rights reserved.&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;-out:test.exe&lt;BR /&gt;-subsystem:console&lt;BR /&gt;test.obj&lt;BR /&gt;C:\Temp\2\35244.obj&lt;BR /&gt;-defaultlib:liboffload&lt;BR /&gt;-defaultlib:libiomp5md&lt;BR /&gt;ofldbegin.obj&lt;BR /&gt;ofldend.obj&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;C:\&amp;gt;.\test.exe&lt;BR /&gt;&amp;nbsp;hello from mic fortran version&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2013 09:07:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dlopen-failed/m-p/974224#M24684</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2013-11-05T09:07:00Z</dc:date>
    </item>
  </channel>
</rss>

