<?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 This does indeed work. in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Using-OpenMP-4-0-target-directives-with-user-libraries/m-p/999816#M29696</link>
    <description>&lt;P&gt;This does indeed work.&lt;/P&gt;

&lt;P&gt;Thanks for that!&lt;/P&gt;</description>
    <pubDate>Mon, 14 Jul 2014 12:41:49 GMT</pubDate>
    <dc:creator>Grund__Aalexander</dc:creator>
    <dc:date>2014-07-14T12:41:49Z</dc:date>
    <item>
      <title>Using OpenMP 4.0 target directives with user libraries</title>
      <link>https://community.intel.com/t5/Software-Archive/Using-OpenMP-4-0-target-directives-with-user-libraries/m-p/999814#M29694</link>
      <description>&lt;P&gt;I tried to get an OpenMP 4.0 test case to run where the code calls a user library that is compiled for host and mic (-mmic)&lt;BR /&gt;
	The host library is in current directory (pwd), the MIC lib is in pwd/mic and I set LD_LIBRARY_PATH to pwd and MIC_LD_LIBRARY_PATH to pwd/mic&lt;BR /&gt;
	However the execution fails with "On the sink, dlopen() returned NULL. The result of dlerror() is "/tmp/coi_procs/1/31669/load_lib/iccoutysEa1j: undefined symbol: foo"&lt;/P&gt;

&lt;P&gt;The code looks like this:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;omp.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include "foo.h"

#pragma omp declare target
int foo();
#pragma omp end declare target

int main()
{
  /* start user code */
#pragma omp target
    {
      foo();
    }
  return 0;
}&lt;/PRE&gt;

&lt;P&gt;Command line is:&lt;BR /&gt;
	icc -shared -fPIC -o libhostlib.so hostlib.c&lt;BR /&gt;
	icc -mmic -shared -fPIC -o mic/libhostlib.so hostlib.c&lt;BR /&gt;
	icc -openmp -o test_mic.o -c test_mic.c&lt;BR /&gt;
	icc -openmp -L. -lhostlib -o test_mic test_mic.o&lt;/P&gt;

&lt;P&gt;How can I get something like this to work or is it just impossible to use custom libraries on the target with the offload model?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2014 12:02:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Using-OpenMP-4-0-target-directives-with-user-libraries/m-p/999814#M29694</guid>
      <dc:creator>Grund__Aalexander</dc:creator>
      <dc:date>2014-07-14T12:02:18Z</dc:date>
    </item>
    <item>
      <title>Try building and running like</title>
      <link>https://community.intel.com/t5/Software-Archive/Using-OpenMP-4-0-target-directives-with-user-libraries/m-p/999815#M29695</link>
      <description>&lt;P&gt;I revised my earlier reply to match all the names you used.&lt;/P&gt;

&lt;P&gt;Try building and running like this:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;icc -openmp -fpic -shared -o libhostlib.so hostlib.c
icc -openmp -fpic -mmic -shared -o mic/libhostlib.so hostlib.c
icc -openmp -L. -lhostlib -otest_mic test_mic.c -offload-option,mic,ld,"-L./mic -lhostlib"

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
export MIC_LD_LIBRARY_PATH=$MIC_LD_LIBRARY_PATH:./mic
./test_mic&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Jul 2014 12:18:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Using-OpenMP-4-0-target-directives-with-user-libraries/m-p/999815#M29695</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2014-07-14T12:18:00Z</dc:date>
    </item>
    <item>
      <title>This does indeed work.</title>
      <link>https://community.intel.com/t5/Software-Archive/Using-OpenMP-4-0-target-directives-with-user-libraries/m-p/999816#M29696</link>
      <description>&lt;P&gt;This does indeed work.&lt;/P&gt;

&lt;P&gt;Thanks for that!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2014 12:41:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Using-OpenMP-4-0-target-directives-with-user-libraries/m-p/999816#M29696</guid>
      <dc:creator>Grund__Aalexander</dc:creator>
      <dc:date>2014-07-14T12:41:49Z</dc:date>
    </item>
    <item>
      <title>Great!  Thank you for useful</title>
      <link>https://community.intel.com/t5/Software-Archive/Using-OpenMP-4-0-target-directives-with-user-libraries/m-p/999817#M29697</link>
      <description>&lt;P&gt;Great!&amp;nbsp; Thank you for useful question/post. I expect it will help others in the future.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2014 15:04:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Using-OpenMP-4-0-target-directives-with-user-libraries/m-p/999817#M29697</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2014-07-14T15:04:01Z</dc:date>
    </item>
  </channel>
</rss>

