<?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 Thank for your fast answer. I in Intel® Embree Ray Tracing Kernels</title>
    <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/How-to-properly-link-libembree-so-to-ispc-program/m-p/1046644#M472</link>
    <description>&lt;P&gt;Thank for your fast answer. I didn't know about this feature of the ISPC compiler. By using multi-target mode on my ispc program I managed to make it work properly with Embree.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;For anyone also facing this problem, you can read a bit more about ISPC's multi-target mode on:&amp;nbsp;&lt;A href="http://ispc.github.io/faq.html#how-can-i-generate-a-single-binary-executable-with-support-for-multiple-instruction-sets"&gt;http://ispc.github.io/faq.html#how-can-i-generate-a-single-binary-executable-with-support-for-multiple-instruction-sets&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Sep 2014 08:15:10 GMT</pubDate>
    <dc:creator>Allan_H_</dc:creator>
    <dc:date>2014-09-12T08:15:10Z</dc:date>
    <item>
      <title>How to properly link libembree.so to ispc program?</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/How-to-properly-link-libembree-so-to-ispc-program/m-p/1046641#M469</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm having difficulties working with Embree on an ispc program. For example, I created the following program:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;embree2/rtcore.isph&amp;gt;

export void bar()
{
  rtcInit();
}
&lt;/PRE&gt;

&lt;P&gt;And compiled with:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;$ ispc -I/usr/local/include -o ispc/bar_ispc.o -h ispc/bar_ispc.h ispc/bar.ispc
$ clang -I./ -L/usr/local/lib -lembree ispc/bar_ispc.o main.cpp -v -o ${EXE}
&lt;/PRE&gt;

&lt;P&gt;This results in:&amp;nbsp;ispc/bar.ispc:(.text+0x3): undefined reference to `rtcInit___un_3C_Cunt_3E_'&lt;/P&gt;

&lt;P&gt;"rtcInit()" is implemented in "kernels/common/rtcore_ispc.ispc", so I attempted to compile the file and link statically. The problem is now that all the "ispc*()" methods, like "ispcInit()", are not visible (see below), which makes me think that is not the right way of doing this. The Embree build system explicitly compiles the "rtcore_ispc.ispc" file with "-fvisibility=hidden".&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;hase@kuroi:/usr/local/lib$ readelf -s libembree.so | grep ispcInit
  5412: 000000000001e690     5 FUNC    LOCAL  DEFAULT   12 ispcInit&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;So, what should I do to use Embree inside my ispc program? I was looking into how the Tutorials manage to solve this problem, but if I choose to replicate their build system, I would need to ship the Embree source code with my code, right?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2014 21:50:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/How-to-properly-link-libembree-so-to-ispc-program/m-p/1046641#M469</guid>
      <dc:creator>Allan_H_</dc:creator>
      <dc:date>2014-09-11T21:50:50Z</dc:date>
    </item>
    <item>
      <title>Just a small correction. When</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/How-to-properly-link-libembree-so-to-ispc-program/m-p/1046642#M470</link>
      <description>&lt;P&gt;Just a small correction. When I said "&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;The Embree build system explicitly compiles the "rtcore_ispc.ispc" file with "-fvisibility=hidden".", I meant: "&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;The Embree build system explicitly compiles the "rtcore_ispc.cpp" file with "-fvisibility=hidden". The "rtcore_ispc.cpp" file is the file with the "ispc*()" functions implementations.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2014 23:11:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/How-to-properly-link-libembree-so-to-ispc-program/m-p/1046642#M470</guid>
      <dc:creator>Allan_H_</dc:creator>
      <dc:date>2014-09-11T23:11:45Z</dc:date>
    </item>
    <item>
      <title>The problem is that the</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/How-to-properly-link-libembree-so-to-ispc-program/m-p/1046643#M471</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;The problem is that the libembree.so is compiled with the multi-target mode of ISPC, which generates different symbol names. You also have to enable multiple targets in your ISPC application to make the linking work, e.g. by adding --target sse2,sse4,avx,avx2 to your ISPC command line.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Sep 2014 05:09:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/How-to-properly-link-libembree-so-to-ispc-program/m-p/1046643#M471</guid>
      <dc:creator>SvenW_Intel</dc:creator>
      <dc:date>2014-09-12T05:09:26Z</dc:date>
    </item>
    <item>
      <title>Thank for your fast answer. I</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/How-to-properly-link-libembree-so-to-ispc-program/m-p/1046644#M472</link>
      <description>&lt;P&gt;Thank for your fast answer. I didn't know about this feature of the ISPC compiler. By using multi-target mode on my ispc program I managed to make it work properly with Embree.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;For anyone also facing this problem, you can read a bit more about ISPC's multi-target mode on:&amp;nbsp;&lt;A href="http://ispc.github.io/faq.html#how-can-i-generate-a-single-binary-executable-with-support-for-multiple-instruction-sets"&gt;http://ispc.github.io/faq.html#how-can-i-generate-a-single-binary-executable-with-support-for-multiple-instruction-sets&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Sep 2014 08:15:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/How-to-properly-link-libembree-so-to-ispc-program/m-p/1046644#M472</guid>
      <dc:creator>Allan_H_</dc:creator>
      <dc:date>2014-09-12T08:15:10Z</dc:date>
    </item>
  </channel>
</rss>

