<?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 I usually have success with in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Compiling-for-Phi-in-the-Configure-command/m-p/941296#M17075</link>
    <description>&lt;P&gt;I usually have success with&lt;/P&gt;
&lt;P&gt;[bash]&lt;/P&gt;
&lt;P&gt;./configure CC=icc CXX=icpc CFLAGS="-mmic" CXXFLAGS="-mmic" --host=x86_64&lt;/P&gt;
&lt;P&gt;[/bash]&lt;/P&gt;
&lt;P&gt;The CC/CXX and CFLAGS/CXXFLAGS handle both C and C++ codes, and "--host=x86_64" indicates cross-compilation. Indicating cross-compilation is a trick: in fact, you are compiling for the MIC architecture and not for x86_64, but "--host=..." tells the configure script not to panic when the executable produced by the compiler cannot be run on the host.&lt;/P&gt;
&lt;P&gt;The link that Tim has sent talks about using "xiar -qoffload-build" instead of "ar" for linking a static library. This is necessary for static libraries with offload. I believe that for native (i.e., non-offload) and dynamic libraries this is not necessary: you can link using the compiler or probably even with "ld".&lt;/P&gt;
&lt;P&gt;If the library has dependencies, you need to compile and install them first, and then, typically, use "-with-OTHERLIBRARY=/path/to/other/library"&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2013 16:30:29 GMT</pubDate>
    <dc:creator>Andrey_Vladimirov</dc:creator>
    <dc:date>2013-07-03T16:30:29Z</dc:date>
    <item>
      <title>Compiling for Phi in the 'Configure' command</title>
      <link>https://community.intel.com/t5/Software-Archive/Compiling-for-Phi-in-the-Configure-command/m-p/941294#M17073</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm new to working with Xeon Phi.&lt;/P&gt;
&lt;P&gt;I'm trying to build a certain library written in C , with Intel C compiler on Linux (CentOS),&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and I intend to run it on the Phi.&lt;/P&gt;
&lt;P&gt;The thing is, I usually build this library with 'configure' and 'make' commands&lt;/P&gt;
&lt;P&gt;and with gcc, and now I have to build it with Intel C and with MIC support.&lt;/P&gt;
&lt;P&gt;Now , I realize that the -mmic flag is available when compiling directly with icpc/ifort ,&lt;/P&gt;
&lt;P&gt;but when I run 'configure' for my library :&lt;/P&gt;
&lt;P&gt;"./configure --with-cc=icc ... "&lt;/P&gt;
&lt;P&gt;I don't know where to add the "-mmic" flag, so that the library will be built for running on Phi.&lt;/P&gt;
&lt;P&gt;Please let me know what you think,&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Chen&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 10:49:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Compiling-for-Phi-in-the-Configure-command/m-p/941294#M17073</guid>
      <dc:creator>Chen_S_1</dc:creator>
      <dc:date>2013-07-03T10:49:17Z</dc:date>
    </item>
    <item>
      <title>Add -mmic to the CFLAGS (or</title>
      <link>https://community.intel.com/t5/Software-Archive/Compiling-for-Phi-in-the-Configure-command/m-p/941295#M17074</link>
      <description>&lt;P&gt;Add -mmic to the CFLAGS (or similar) environment option or&lt;/P&gt;
&lt;P&gt;./configure --with-cc='icc -mmic'&lt;/P&gt;
&lt;P&gt;Library build options may need attention:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-896A68BA-D30F-4553-A9A4-7545C5E6EA41.htm" target="_blank"&gt;http://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-896A68BA-D30F-4553-A9A4-7545C5E6EA41.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 11:07:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Compiling-for-Phi-in-the-Configure-command/m-p/941295#M17074</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2013-07-03T11:07:59Z</dc:date>
    </item>
    <item>
      <title>I usually have success with</title>
      <link>https://community.intel.com/t5/Software-Archive/Compiling-for-Phi-in-the-Configure-command/m-p/941296#M17075</link>
      <description>&lt;P&gt;I usually have success with&lt;/P&gt;
&lt;P&gt;[bash]&lt;/P&gt;
&lt;P&gt;./configure CC=icc CXX=icpc CFLAGS="-mmic" CXXFLAGS="-mmic" --host=x86_64&lt;/P&gt;
&lt;P&gt;[/bash]&lt;/P&gt;
&lt;P&gt;The CC/CXX and CFLAGS/CXXFLAGS handle both C and C++ codes, and "--host=x86_64" indicates cross-compilation. Indicating cross-compilation is a trick: in fact, you are compiling for the MIC architecture and not for x86_64, but "--host=..." tells the configure script not to panic when the executable produced by the compiler cannot be run on the host.&lt;/P&gt;
&lt;P&gt;The link that Tim has sent talks about using "xiar -qoffload-build" instead of "ar" for linking a static library. This is necessary for static libraries with offload. I believe that for native (i.e., non-offload) and dynamic libraries this is not necessary: you can link using the compiler or probably even with "ld".&lt;/P&gt;
&lt;P&gt;If the library has dependencies, you need to compile and install them first, and then, typically, use "-with-OTHERLIBRARY=/path/to/other/library"&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 16:30:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Compiling-for-Phi-in-the-Configure-command/m-p/941296#M17075</guid>
      <dc:creator>Andrey_Vladimirov</dc:creator>
      <dc:date>2013-07-03T16:30:29Z</dc:date>
    </item>
    <item>
      <title>If you've upgraded to MPSS 3</title>
      <link>https://community.intel.com/t5/Software-Archive/Compiling-for-Phi-in-the-Configure-command/m-p/941297#M17076</link>
      <description>&lt;P&gt;If you've upgraded to MPSS 3.2 or later, you might consider this approach:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;. /opt/mpss/3.2/environment-setup-k1om-mpss-linux
gnu-configize  # to update config.sub
./configure $CONFIGURE_FLAGS --prefix=/usr --libdir=/usr/lib64 \
    LDFLAGS='' LD=k1om-mpss-linux-ld CPPFLAGS='' \
    CC=icc CFLAGS='-mmic' CXX=icpc CXXFLAGS='-mmic'&lt;/PRE&gt;

&lt;P&gt;The main difference is the&amp;nbsp;&lt;SPAN style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em; line-height: 1.5;"&gt;--host=k1om-mpss-linux&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;argument which referencing&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em; line-height: 1.5;"&gt;$CONFIGURE_FLAGS&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;adds instead.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Using the GCC port to compile something can be done similarly:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;. /opt/mpss/3.2/environment-setup-k1om-mpss-linux
gnu-configize  # to update config.sub
./configure $CONFIGURE_FLAGS --prefix=/usr --libdir=/usr/lib64&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;...although, of course, using GCC is generally ill-advised, since the port for Xeon Phi is unsophisticated and generates poor quality object code relative to ICC.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;You may find this other thread interesting: &amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&lt;A href="https://software.intel.com/en-us/forums/topic/509026#comment-1785910" target="_blank"&gt;https://software.intel.com/en-us/forums/topic/509026#comment-1785910&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2014 22:14:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Compiling-for-Phi-in-the-Configure-command/m-p/941297#M17076</guid>
      <dc:creator>Evan_P_Intel</dc:creator>
      <dc:date>2014-04-17T22:14:46Z</dc:date>
    </item>
  </channel>
</rss>

