<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated on Tue, 24 Nov 2009 19:52:21 -0800 -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <atom:link href="http://software.intel.com/en-us/articles/intel-c-compiler-for-linux-kb/type/technical-notes/feed/" rel="self" type="application/rss+xml" />
    <title>Intel Software Network articles feed</title>
    <link>http://software.intel.com/en-us/articles/intel-c-compiler-for-linux-kb/technical-notes/</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>Compile moblin 2.1 kernel sources with Intel Compiler</title>
      <description><![CDATA[ <p>1.  Prepare for build</p>
<p>       a.  su into root.</p>
<p>       b.  Create a ~/.rpmmacros file containing:</p>
<p>       %_topdir %(echo $HOME)/rpmbuild</p>
<p>      %_smp_mflags -j3</p>
<p>      %__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot</p>
<p>      %_default_patch_fuzz 2</p>
<p>      #end of file</p>
<p>      fuzz=2 is critical to allow the 915 patches to merge correctly.</p>
<p>_smp_mflags -jN, N should be set to the number of processor cores on your build system</p>
<p>2.  Setup and do initial build.  Download the kernel source from a source repository:</p>
<p>(Used http://repo.moblin.org/moblin/releases/2.1/source/kernel-2.6.31.5-10.1.moblin2.src.rpm)</p>
<p>       a.  Extract the rpm:</p>
<p>       $ rpm -ivh kernel-2.6.31.5-10.1.moblin2.src.rpm</p>
<p>       b. Prepare and do initial build to rpm:</p>
<p>       $ cd rpmbuild/SPECS</p>
<p>       c. Remove lines 762 &amp; 763, 'BuildKernel %make_target %kernel_image menlow' &amp; 'BuildKernel %make_target %kernel_image ivi'</p>
<p>       $ rpmbuild -bc --target=i586 kernel.spec</p>
<p>       The previous step ensures you have the components to build successfully.</p>
<p>3.  Rebuild with gcc:</p>
<p>       $ cd rpmbuild/BUILD/kernel-2.6.31/linux-2.6.31</p>
<p>       $ make clean</p>
<p>       $ make bzImage</p>
<p>       $ make modules</p>
<p>       $ make modules_install</p>
<p>       $ make install </p>
<p>      Test the image on your netbook by rebooting the system and selecting the kernel at the grub screen.</p>
<p>Rebuild with Intel Compiler</p>
<p>1.  Perform step 1 in the previous section</p>
<p>2.  Setup Intel Compiler environment:</p>
<p>       a.  Set the compiler environment:</p>
<p>       $ source /opt/intel/Compiler/11.1/XXX/bin/ia32/iccvars_ia32.sh</p>
<p>       where XXX is the particular version you are using.</p>
<p>3.  Make source code modifications.</p>
<p>      a.  Modify include/linux/compiler-intel.h and add the following line at</p>
<p>the end of the file:</p>
<p>       #undef __compiler_offsetof</p>
<p>       b.  Modify arch/x86/include/asm/xor_32.h at line 843, change</p>
<p>       : "+r" (lines),</p>
<p>       To:</p>
<p>       : "+rm" (lines),</p>
<p>       This change is required because the code is written to work with gcc's assumption that the stack is 16 byte aligned (contrary to the ABI) and thus there is one additional register available.</p>
<p>c.  Add libirc_s.a to the link command by modifying Makefile at line 699.  Change:</p>
<p>       --start-group $(vmlinux-main) --end-group</p>
<p>       to:</p>
<p>       --start-group $(vmlinux-main) /opt/intel/Compiler/11.1/XXX/lib/ia32/libirc_s.a</p>
<p>--end-group</p>
<p>       d.  Modify arch/x86/include/asm/delay.h and remove the references to __bad_udelay and replace the calls to it with 0.</p>
<p>       e.  Modify include/linux/log2.h and remove the references to ____ilog2_NaN() and replace the calls to it with 0.</p>
<p>       f.  Modify line 47 of arch/x86/kernel/acpi/realmode/Makefile adding a reference to libirc_s.a as follows:<br />        WAKEUP_OBJS = $(addprefix $(obj)/,$(wakeup-y)) /opt/intel/Compiler/11.1/053/lib/ia32/libirc_s.a</p>
<p>        g.  Modify line 89 of arch/x86/boot/Makefile adding a reference to libirc_s.a as follows:<br />SETUP_OBJS = $(addprefix $(obj)/,$(setup-y)) /opt/intel/Compiler/11.1/053/lib/ia32/libirc_s.a</p>
<p>        h. Modify kernel/trace/trace_events.c by adding the following line of code (line 915) at the start of event_create_dir():<br />        if (call-&gt;system==NULL) return -1;<br />This change is due to a kernel issue where the source code makes alignment assumptions that are not enforced in the kernel source code.  This change is merely a workaround, not a fix for the real issue.</p>
<p>        i.  Modify the intelwrapper file documented at <a href="http://www.linuxdna.com/">www.linuxdna.com</a> and make the following changes:<br />          - Enable script to replace -march=i686 | -mtune=pentium3 | -mtune=generic with ‘'<br />          - Enable script to replace -O2 | -Os with ‘-O3 -ip -xSSE3_ATOM'<br />            Performance BKM: The goal of this option change is to enable higher performance.  Note that the default kernel options uses things such as -mnosse and -fno-omit-frame-pointer which can override the higher optimizations in some places.<br />          - Enable script to call gcc to compile drivers/net/wimax/i2400m/fw.c | lib/libcrc32c* | crypto/testmgr* - this is required because 11.1 does not yet support some instances of variable length arrays<br />          - Enable script to call gcc to compile arch/x86/boot/compressed/misc.c - issue with PIC in icc<br />          - Enable script to call gcc to compile drivers/block/spectra/ffsport.c - inline asm issue</p>
<p>4.  Start the build:</p>
<p>       $ cd &lt;build path&gt;/rpmbuild/BUILD/kernel-2.6.31/linux-2.6.31</p>
<p>       $ make clean</p>
<p>       $ make HOSTCC=intelwrapper CC=intelwrapper CONFIG_DEBUG_SECTION_MISMATCH=y KBUILD_MODPOST_WARN=n bzImage</p>
<p>       $ make HOSTCC=intelwrapper CC=intelwrapper CONFIG_DEBUG_SECTION_MISMATCH=y KBUILD_MODPOST_WARN=n modules</p>
<p>       $ make HOSTCC=intelwrapper CC=intelwrapper CONFIG_DEBUG_SECTION_MISMATCH=y KBUILD_MODPOST_WARN=n modules_install</p>
<p>       $ make HOSTCC=intelwrapper CC=intelwrapper CONFIG_DEBUG_SECTION_MISMATCH=y KBUILD_MODPOST_WARN=n install</p>
<p>The make install step will install the kernel and modify grub so that the kernel can be selected upon bootup.</p>
To build with other configurations, such as the mrst config:<br />cp configs/kernel-mrst.config .config and go to step 4.<br />
<div id="art_pre_template"><strong></strong></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/compile-moblin-21-kernel-sources-with-intel-compiler</link>
      <pubDate>Wed, 18 Nov 2009 09:36:37 -0800</pubDate>
      <comments>http://software.intel.com/en-us/articles/compile-moblin-21-kernel-sources-with-intel-compiler#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/compile-moblin-21-kernel-sources-with-intel-compiler</guid>
      <category>Intel® Atom™ Software Developer Community</category>
      <category>Intel C++ Tool Suite for MIDs</category>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
    </item>
    <item>
      <title>Build ffmpeg/ffmpeg-mt using Intel compiler on linux</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Introduction : </b><br />FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. FFmpeg-mt is the multithreaded version of FFmpeg. Visit http://ffmpeg.org for more information.<br /><br /><b>Version : </b><br />I use the latest source from FFMPEG git and Intel C++ compiler 11.1.046 for linux.<br /><br /><br /><b>Obtaining Source Code : </b><br />Get the ffmpeg source:<br />  git clone git://git.ffmpeg.org/ffmpeg<br />  cd ffmpeg<br />  git clone git://git.ffmpeg.org/libswscale<br /><br />Get the ffmpeg-mt source:<br />  git clone git://git.gitorious.org/ffmpeg/ffmpeg-mt<br />  cd ffmpeg-mt<br />  git clone git://git.mplayerhq.hu/libswscale<br /><br /><strong>Build the application:<br /></strong>The build process for ffmpeg and ffmpeg-mt is similar.</div>
<div>1. go to the source code folder.</div>
<div>2. configure the build. Please use ./configure --help for more options. </div>
<div>   ./configure --prefix=/usr --enable-shared</div>
<div>3. Build with gcc compiler by default.</div>
<div>    make &amp; make install</div>
<div>4. To build with Intel compiler, use the following command after step 2.</div>
<div>    source /opt/intel/Compiler/11.1/046/bin/iccvars.sh ia32</div>
<div>    make CC=icc LD=icc</div>
<div>    make install</div>
<div>5. To build with more advanced options like "-ipo" using Intel compiler, we can use a wrapper to change build option. For example:</div>
<div>    1) make a new file with name intelwrapper, input the followings in the file:</div>
<div>            ICCFLAGS="$@ -ipo"</div>
<div>            echo "icc $ICCFLAGS"</div>
<div>            icc $ICCFLAGS</div>
<div>     2) add execution attribute for intelwrapper</div>
<div>            chmod 755 intelwrapper</div>
<div>     3) make CC=/bin/intelwrapper AR=xiar LD=icc<br />     4) make install</div>
<div>     </div> ]]></description>
      <link>http://software.intel.com/en-us/articles/build-ffmpegffmpeg-mt-using-intel-compiler-on-linux</link>
      <pubDate>Mon, 28 Sep 2009 02:31:21 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/build-ffmpegffmpeg-mt-using-intel-compiler-on-linux#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/build-ffmpegffmpeg-mt-using-intel-compiler-on-linux</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
    </item>
    <item>
      <title>Using Intel Compilers for Linux with Caos Linux</title>
      <description><![CDATA[ Using Intel(R) Compilers under Caos NSA 1.0 Linux<br /><br />These notes apply to a Caos NSA 1.0 Linux Desktop installation.  Other installation types (server, base, etc) but should be similar but may require the installation of additional packages.<br /><br />In order to use Intel(R) Compilers ( Fortran or C++ ) under Caos Linux you will need the latest 11.1 version of the Intel compiler(s). Older 10.0 and 9.1 versions of the compilers may not work properly and have not been tested.  Keep in mind that Caos NSA Linux installations are not OFFICIALLY supported by the Intel Compilers.  Please see your ReleaseNotes document with your compiler version for a list of officially supported distributions and versions.<br /><br />If you have active support for your compiler, you can download the latest Intel compiler version from<br />https://registrationcenter.intel.com<br /><br />Follow the directions below after your network connection is configured.  Also, it is recommended that you first update your system to the latest version of Caos.  Open a terminal window as the root user.  Enter the following command to update your Caos installation:<br /><br />smart update<br />smart upgrade<br /><br />BEFORE YOU INSTALL Intel(R) Fortran for Linux or Intel(R) C++ for Linux on your fresh Caos NSA Desktop installation, you will first need to install several packages to prepare the system to serve as a development platform:<br /><br />Check that gcc and g++ are installed. By default. Check this with:<br /><br />gcc --version<br />g++ --version<br /><br />By default you may not have these packages installed.<br /><br />To prepare the system for the Intel Compilers, add the gcc-c++ and glibc-devel packages.  Open a terminal window as the root user.  Use 'smart' to install the following packages:<br /><br />smart install gcc-c++<br />smart install glibc-devel<br /><br />If you are in a 32bit, also known as "CAOS NSA 1.0 for i386" system, you may proceed with the installation of the Intel compilers (see below).  'uname -m' will return "i686" for this configuration.<br /><br /><b>For x86-64 architecture</b>, you will also need another package to supply 32bit libraries needed for developing 32bit applications in addition to 64bit applications.  First, determine the version of the 64bit version of glibc-devel that is installed:<br /><br />smart query glibc-devel<br /><br />the output should show both the 64bit and 32bit packages and their version.  For example:<br /><br />glibc-devel-2.8-13.nsa1@i686<br />glibc-devel-2.8-13.nsa1$x86_64<br /><br />Note that the versions you see may not match "2.8-13".  You may have a newer or older version available.  Find the 'i686' version and use smart install to fetch and install that package:<br /><br />smart install glibc-devel-2.8-13.nsa1@i686   <br /><br />for example.  Use the correct version returned by 'smart query' above, "2.8-13" is just an example to give you the idea.<br /><br /><br />Finally, there is an optional package to consider: The 11.0 version of the Intel Compiler for Linux has a graphical <br />debugger, a new graphical interface for the IDB debugger. If you want to use this debugger, please make sure to install the Java JRE version 1.5 or greater. This can be done at anytime after the installation of the compiler. However, you will get a warning message about 'missing prerequisite' for the JRE - simply ignore that message and proceed with the installation.  OR to avoid that message and enable the graphical IDE, get the latest JRE from:<br /><br /><a href="http://java.com/en/download/manual.jsp">http://java.com/en/download/manual.jsp</a><br /><br />Once installation of prerequisites is complete, you are ready to start the Intel compiler(s) installation. During the installation, you may get a message "Detected operating system (generic) is not supported", followed by<br />----------------------------------------------------------------- ---------------<br /> Missing optional pre-requisite<br /> -- operating system type is not supported.<br /> -- system glibc or kernel version not supported or not detectable<br /> -- binutils version not supported or not detectable<br /> ----------------------------------------------------------------- ---------------<br />"Would you like to perform an unsupported install of this product [yes/no] (no)?"<br /><br />enter "<b>yes</b>"<br /><br />This will complete the installation.  Keep in mind, <b>you will get this warning from the compiler installer until such time as this particular OS and version are supported.</b> Once installed, you can read the ReadMe notes in ...installdir.../Documentation directory which has a list of the supported Linux distributions and versions. ]]></description>
      <link>http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-caos-linux</link>
      <pubDate>Fri, 28 Aug 2009 13:49:34 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-caos-linux#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-caos-linux</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® Fortran Compiler for Linux* Knowledge Base</category>
    </item>
    <item>
      <title>Memory allocation results in segmentation violation</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Problem : <br /></b><br />I observe that when I compiled the following test case using default flag, its working properly. When I disabled optimization using flag -O0, it working for array size 10000, but unfortunately its giving segmentation fault error for size 100000.<br /><br />$ cat mytest1.c<br />// mytest1.c<br /><br />#include &lt;sys/time.h&gt;<br />#include &lt;time.h&gt;<br />#include&lt;stdio.h&gt;<br /><br />#define SIZE 1024 // Size = 1G<br />int main(int argc, char *argv[])<br />{<br />     float *a; //DB Init<br /><br />     long i,size=0,j;<br />     float sum=0;<br />     int k=0;<br />     int return_value;<br /><br /><br />     sscanf(argv[1], "%ld", &amp;size);<br />     printf("\n Size before Allocation = %ld\n",size);<br />     a=(float *) malloc (sizeof(float)* (size+128));<br /><br />     printf("Value of return from malloc = %d",return_value);<br /><br />     if (a == NULL){<br />         printf("\n\n ERROR: Memory Allocation not possible\n\n");<br />         exit(-1);<br />     }<br />     else<br />     {<br />         printf("Value of return pointer after memory allocation = %ld",a);<br />         printf("\n\n probing a[0]\n");<br />         a[0] = 0.;<br />         printf("probing a[%ld]\n", size-1);<br />         a[size-1] = 0.;<br />         printf("probing succeeded\n");<br />         return 0;<br />    }<br /><br />    for(i=0;i&lt; size; i++){<br />        sum+=a[i];<br />    }<br />    printf("\n Addition Complete, # of Element= %ld\n", size);<br />    free((void *)a);<br />    return 0;<br />}<br /><br /><br />$ icc -O0 mytest1.c <br />$ ./a.out 100000<br /><br />Size before Allocation = 100000<br />Value of return pointer after memory allocation = -1788305392<br /><br />probing a[0]<br />Segmentation fault<br /><br />$ icc mytest1.c <br />$ ./a.out 100000<br /><br />Size before Allocation = 100000<br />Value of return pointer after memory allocation = 182895288336<br /><br />probing a[0]<br />probing a[99999]<br />probing succeeded<br /><br /><br /><b>Environment : </b><br /><br />Intel C++ compiler, Linux x86_64<br /><br /><b>Root Cause : </b><br /><br />Implicitly declared malloc() returns improper address pointer and the application crashes. The compiler must know the function signature to handle it properly. <br /><br /><b>Resolution : </b><br /><br />Implicitly declared malloc() returns improper address pointer. The malloc() declaration in stdlib.h is as given below:<br /><br />void * malloc ( size_t size );<br /><br />The compiler must know the function signature to handle it properly. If we do not provide declaration to compiler, the compiler assumes that the value returned by the function is integer. This is called implicit declaration. <br /><br />The implicit declaration will force void pointer returned from malloc() to integer, the integer is converted again to float pointer. These conversions results in improper value for returned memory address and the application crashes.<br /><br /></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/memory-allocation-results-in-segmentation-violation</link>
      <pubDate>Thu, 27 Aug 2009 23:40:59 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/memory-allocation-results-in-segmentation-violation#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/memory-allocation-results-in-segmentation-violation</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Mac OS X* Knowledge Base</category>
    </item>
    <item>
      <title>Icc and variable length arrays</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Problem : </b><br /><br />I am having a compilation issue with icc that seems related with checking the C language standard.<br /><br />I am getting the following error message with icc :<br /><br />error: a field declaration cannot have a type involving a variable length array<br /><br />I get this error with icc whether I am using -std=c99 or nothing (ie default -std=gnu98).<br /><br /><br />When using gcc (4.1.2 and 4.3.3) I get slightly different results:<br /><br />gcc -std=c89 -pedandtic (same with -std=gnu89)<br />warning: ISO C90 forbids variable length array ‘bounds’<br />warning: a member of a structure or union cannot have a variably modified type<br /><br />gcc -std=c99 -pedantic<br />warning: a member of a structure or union cannot have a variably modified type<br />(no C90 forbids...)<br /><br />gcc without -pedantic: no warnings, no errors<br /><br />So I guess that this is a language standard issue<br /><br /><b>Environment : </b><br /><br />Intel C++ compiler 11.0 and older, Linux.<br /><br /><b>Resolution : </b><br /><br />You may use latest Intel C++ compiler 11.1 to resolve this issue. I can compile the varaible length arrays test case with icc 11.1.038. <br /><br />$ cat varLenArray.c<br /><br />// varLenArray.c<br /><br />void func(int sz)<br />{<br />int arr[sz]; // sz ins't const; allowed only in C99<br />}<br /><br />int main()<br />{<br />int size;<br />printf("enter array's size : ");<br />scanf("%d", &amp;size);<br />func(size);<br />return 0;<br />}<br /><br />$ icc -c varLenArray.c<br />$ uname -a<br />Linux maya8 2.6.23.1-42.fc8 #1 SMP Tue Oct 30 13:18:33 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux<br /><br /></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/icc-and-variable-length-arrays</link>
      <pubDate>Mon, 24 Aug 2009 03:38:26 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/icc-and-variable-length-arrays#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/icc-and-variable-length-arrays</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
    </item>
    <item>
      <title>Intel thread affinity environment variable for OpenMP*</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Problem : <br /></b><br />I am using the Intel® compiler and openMP* to parallelize some work as follows:<br /><br />
<pre name="code" class="cpp">#pragma omp parallel num_threads(4)
{
DoWork();
}</pre>
<br />I would d like to experiment with Intel's thread affinity feature for OpenMP but I a unsure of exactly how to use the environment variable (for example, where do I place the environment statement in my code?).<br /><br />Could you give a little example showing proper usage and where to place the statement ? <br /><br /><br /><b>Environment : </b><br />Intel C++ compiler, Linux*, Mac OS* X, Windows*<br /><br /><b>Resolution : </b><br /><br /><br />Intel thread affinity environment variable KMP_AFFINITY for openMP is explained in Compiler Intel® compiler user guide topic “Thread Affinity Interface (Linux* and Windows*)”. You may review the topic for detailed information.<br /><br />There are many ways to set the thread affinity using KMP_AFFINITY. I am providing an example below. In the example I am mapping OpenMP threads 0, 1, 2 and 3 to OS processor 3, 2, 1 and 0 respectively. <br /><br />
<pre name="code" class="cpp">$ cat tstcase.cpp
// tstcase.cpp
// Thread afinity interface
//


#include &lt;omp.h&gt;
#include &lt;iostream&gt;
using namespace std;

#define N 1000

int main ()
{
cout &lt;&lt; "Starting openmp test." &lt;&lt; endl;

int i;
float a[N], b[N], c[N], d[N];

/* Some initializations */
for (i=0; i &lt; N; i++)
{
a[i] = i * 1.5;
b[i] = i + 22.35;
}

#pragma omp parallel shared(a,b,c,d) private(i)
{

#pragma omp sections nowait
{

// Section #1
//
#pragma omp section
{
cout &lt;&lt; "Section #1." &lt;&lt; endl;
for (i=0; i &lt; N; i++)
c[i] = a[i] + b[i]; // End of section #1
a[0] = 3.45;
}

// Section #2
//
#pragma omp section
{
cout &lt;&lt; "Section #2." &lt;&lt; endl;
for (i=0; i &lt; N; i++)
d[i] = a[i] * b[i]; // End of section #2
a[1] = 5.67;
}

} // End of sections

} // End of parallel

cout &lt;&lt; "Exiting openmp test." &lt;&lt; endl;
return 0;
}</pre>
<br />$ icc -openmp tstcase.cpp<br />$ export KMP_AFFINITY="verbose,proclist=[3,2,1,0]"<br />$ ./a.out<br />OMP: Warning #63: KMP_AFFINITY: proclist specified, setting affinity type to "explicit".<br />Starting openmp test.<br />OMP: Info #149: KMP_AFFINITY: Affinity capable, using global cpuid instr info<br />OMP: Info #154: KMP_AFFINITY: Initial OS proc set respected: {0,1,2,3}<br />OMP: Info #156: KMP_AFFINITY: 4 available OS procs<br />OMP: Info #157: KMP_AFFINITY: Uniform topology<br />OMP: Info #159: KMP_AFFINITY: 2 packages x 2 cores/pkg x 1 threads/core (4 total cores)<br />OMP: Info #160: KMP_AFFINITY: OS proc to physical thread map ([] =&gt; level not in map):<br />OMP: Info #168: KMP_AFFINITY: OS proc 0 maps to package 0 core 0 [thread 0]<br />OMP: Info #168: KMP_AFFINITY: OS proc 2 maps to package 0 core 1 [thread 0]<br />OMP: Info #168: KMP_AFFINITY: OS proc 1 maps to package 3 core 0 [thread 0]<br />OMP: Info #168: KMP_AFFINITY: OS proc 3 maps to package 3 core 1 [thread 0]<br />OMP: Info #147: KMP_AFFINITY: Internal thread 0 bound to OS proc set {3}<br />OMP: Info #147: KMP_AFFINITY: Internal thread 1 bound to OS proc set {2}<br />OMP: Info #147: KMP_AFFINITY: Internal thread 2 bound to OS proc set {1}<br />OMP: Info #147: KMP_AFFINITY: Internal thread 3 bound to OS proc set {0}<br />Section #1.<br />Section #2.<br />Exiting openmp test.<br /><br /><br /><br /></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/intel-thread-affinity-environment-variable-for-openmp</link>
      <pubDate>Mon, 24 Aug 2009 02:31:41 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/intel-thread-affinity-environment-variable-for-openmp#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/intel-thread-affinity-environment-variable-for-openmp</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Mac OS X* Knowledge Base</category>
      <category>Intel® C++ Compiler for Windows* Knowledge Base</category>
    </item>
    <item>
      <title>Effect of wrong value returned by time() system call</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Problem : </b><br />There is system call failure reported that are related with time function.<br />If x86 base system used TSC(Time Stamp Counter) for clock source (It's default) <br />and RedHat Kernel is older than 2.6.18-92.1.6.el5, then gettimeofday(2) system<br />call returns current time + 4398 sec.<br /><br />This link has an example: http://www.unix.com/high-level-programming/75447-problem-gettimeofday.html. <br /><br />Two other links with additional information:<br /><br />http://lkml.org/lkml/2007/8/23/96<br />https://bugzilla.redhat.com/show_bug.cgi?id=452185<br /><br />The following are the questions for Intel C++ compiler for Linux*:<br /><br />(1) Does icc use the following system calls ? <br />- gettimeofday(2), time(2), ftime(3) ?<br />- clock_gettime(3) with CLOCK_REALTIME or CLOCK_MINOTONIC as 1st parameter?<br />- getdata(3) or getdate_r(3), because it calls time(2) function when parameter do not have hour/min/sec?<br />- pthead_cond_timedwait(3), pthread_rwlock_timedrdlock(3), pthread_wrlock_timedwrlock(3) or pthread_mutex_timedlock(3)?<br />- aio_suspend(3)<br /><br />(2) If above system calls are failed, then icc carry out unjust operation ?<br /><br /><br /><b>Environment : </b><br /><br />Linux*, Intel C++ compiler<br /> <br /><br /><b>Resolution : </b><br /><br />The time() is being used in the pgopti runtime library to create the name of the .dyn file, and to get start and end time stamps for the .dyn file. These start and end time stamps are used in the merging process (profmerge) to compute the duration of the run, which is used in the weighted profile feature. This feature allows users to assign weights to the profiles, rather than having longer runs automatically get greater weight.<br /><br />So, if time() can’t be trusted, neither can this feature. On the plus side, it’s a relatively new feature. On the minus side, we put it in there because IBM DB2 wanted it. We can find out what platform they are using to see if they personally would be affected.<br /><br />As for other uses of time()-like functions in PGO:<br /><br />(1) clock() is used in interval based profiling to tell when another interval is set.<br /><br />(2) As for merging of files, the time is determined by the ‘mtime’ variable in the structure returned by a stat() call. <br /><br />Other than PGO, the time is used for in the compiler for date stamping objects, for implementing __TIME__ macro expansion, ...<br /><br />So we don't think it will be used for anything that will cause "bad"<br />code except for getting incorrect values for these sorts of things. You could argue that this isn't really bad code in the sense that it agrees with what the system told the compiler.<br /><br /></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/effect-of-wrong-value-returned-by-time-system-call</link>
      <pubDate>Mon, 24 Aug 2009 01:45:13 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/effect-of-wrong-value-returned-by-time-system-call#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/effect-of-wrong-value-returned-by-time-system-call</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
    </item>
    <item>
      <title>Intel® C++ Compiler for Linux* - Building ACE+TAO with Intel® C++ Compiler for Linux*</title>
      <description><![CDATA[ <!--page break-->
<hr />
<div class="sectionHeading">Introduction</div>
<p>This document explains how to configure and build ACE+TAO. From the ACE+TAO web site:</p>
<ul>
<li><a href="http://www.cs.wustl.edu/~schmidt/ACE.html">ACE</a>† is an open-source framework that provides many components and <a href="http://www.cs.wustl.edu/~schmidt/POSA">patterns</a>† for developing high-performance, distributed real-time and embedded systems. ACE provides powerful, yet efficient abstractions for sockets, demultiplexing loops, threads, synchronization primitives.</li>
<li><a href="http://www.cs.wustl.edu/~schmidt/TAO.html">TAO</a>† (The ACE ORB) is an open-source implementation of a <a href="http://www.cs.wustl.edu/~schmidt/corba.html">CORBA</a>† Object Request Broker (ORB) built using components and patterns in the ACE framework. <br />Several companies provide commercial support for ACE+TAO, see <a href="http://www.cs.wustl.edu/~schmidt/commercial-support.html">http://www.cs.wustl.edu/~schmidt/commercial-support.html</a>† for information. Remedy IT, <a href="http://www.theaceorb.nl">http://www.theaceorb.nl</a>† , provides support for building ACE+TAO with the Intel® C++ Compiler.</li>
<li><strong>Version Information <br /></strong>The version of ACE+TAO used in this document is ACE version 5.5.8.</li>
<li><strong>Obtaining the Source Code</strong><br />The ACE+TAO source code was downloaded from <a href="http://software.intel.com/file/7247">http://software.intel.com/file/7247</a>† .</li>
<li><strong>Obtaining the latest version of Intel® C++ Compiler</strong><br />See <a href="http://www3.intel.com/cd/software/products/asmo-na/eng/compilers/clin/277618.htm">http://www3.intel.com/cd/software/products/asmo-na/eng/compilers/clin/277618.htm</a> for details.</li>
<li><strong>Prerequisites</strong><br />None.</li>
<li><strong>Configuration and Set-up Information</strong>
<p> </p>
<table border="0" width="100%" cellpadding="4" cellspacing="0" style="MARGIN-TOP: -10px; PADDING-TOP: 0px">
<tbody>
<tr>
<td width="100%" style="FONT-SIZE: 11px">
<pre name="code" class="cpp">$ tar zxvf ACE+TAO-src.tar.gz <br />
$ cd ACE_wrappers/<br />
$ export ACE_ROOT=`pwd`<br />
# create configuration file<br />
$ echo 'zlib=1<br />
inline=0<br />
boost=0<br />
CFLAGS+=-Wp64<br />
include $(ACE_ROOT)/include/makeinclude/platform_linux_icc.GNU' &gt;<br /> $ACE_ROOT/include/makeinclude/platform_macros.GNU<br />
# create configuration file<br />
$ echo '#include "ace/config-linux.h"' &gt; $ACE_ROOT/ace/config.h<br />
$ cd $ACE_ROOT<br />
$ export LD_LIBRARY_PATH=$ACE_ROOT/lib:$LD_LIBRARY_PATH<br />
$ gmake &gt;&amp; gmake.log<br />
</pre>
</td>
</tr>
</tbody>
</table>
<p> </p>
</li>
<li><strong>TAO Configuration and Set-up Information</strong>
<p> </p>
<table border="0" width="100%" cellpadding="4" cellspacing="0" style="MARGIN-TOP: -10px; PADDING-TOP: 0px">
<tbody>
<tr>
<td width="100%" style="FONT-SIZE: 11px">
<pre name="code" class="cpp">$ export TAO_ROOT=$ACE_ROOT/TAO<br />
$ cd $TAO_ROOT <br />
$ gmake &gt;&amp; gmake.log <br />
$<br />
</pre>
</td>
</tr>
</tbody>
</table>
<p> </p>
</li>
<li><strong>Source Code Changes</strong><br />None required.</li>
<li><strong>Building and Running Applications</strong><br />One can test the TAO build is correctly configured by following the instructions on how to run the various examples in $TAO_ROOT/tests.</li>
<li><strong>Verifying Correctness</strong><br />Run the various examples in $TAO_ROOT/tests and compare with the ACE+TAO scorecard, which lists the status of the ACE+TAO build. The ACE+TAO scorecard for the Intel <sup>®</sup> C++ Compiler builds are performed by <a href="http://www.theaceorb.nl/en/acetao.html">Remedy IT</a>† can be found at <a href="http://www.dre.vanderbilt.edu/~remedynl/">http://www.dre.vanderbilt.edu/~remedynl/</a>† .</li>
<li><strong>Related topics<br /></strong><a href="http://software.intel.com/en-us/articles/building-acetao-with-intelr-c-compiler-for-linux/">http://software.intel.com/en-us/articles/building-acetao-with-intelr-c-compiler-for-linux/</a></li>
<li><strong>Known Issues and Limitations</strong><br />None. Contact Intel® Premier Support website if you encounter problems or want to provide feedback.</li>
</ul>
<p> </p>
<p><img width="1" src="http://software.intel.com/file/6408" height="10" /></p>
<p><sup>†</sup> This link will take you off of the Intel Web site. Intel does not control the content of the destination Web Site.</p>
<!--page break-->
<hr /> ]]></description>
      <link>http://software.intel.com/en-us/articles/intel-c-compiler-for-linux-building-acetao-with-intel-c-compiler-for-linux</link>
      <pubDate>Tue, 04 Aug 2009 02:50:07 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/intel-c-compiler-for-linux-building-acetao-with-intel-c-compiler-for-linux#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/intel-c-compiler-for-linux-building-acetao-with-intel-c-compiler-for-linux</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
    </item>
    <item>
      <title>Installing Intel Compilers on OpenSUSE</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Problem : </b>I am having trouble installing my Intel Compiler Pro v11.1 on OpenSUSE<br /><br /><br /><b>Environment : </b>This article was written for OpenSUSE 11.2 and 11.1 but should apply to 11.0 installations as well.  This guide applies ONLY to the Intel Compilers Profession <b>Version 11.1 and greater</b>.  If you have an older Intel compiler, please upgrade to 11.1.  Compatibility of OpenSUSE 11.2 with anything other than Intel Compiler Pro 11.1 is not guaranteed to work - consider getting an older OpenSUSE 10.x or older version to work with your older Intel compiler.<br /><br /><br /><b>Root Cause : </b>As of this writing OpenSUSE 11.2 is not officially supported by the Intel Compiler Professional edition. The procedures herein are intended to assist the user configure OpenSUSE to support installation of the Intel Compiler Professional Edition.  However, this is not a supported configuration.  Please see your Release Notes document for a list of officially supported Linux distributions and versions.<br /><br />The default OpenSUSE installation may not have all the packages needed to support software development (gcc, g++, and binutils packages along with header files).  Also, the Intel compiler released versions are targeted and built for distributions available 12-16 months before the compiler is actually released to customers.  Thus, by the time development is completed for a particular compiler version, many Linux distributions have progressed forward one or two versions.  Intel tries to stay current with Linux distributions, but it often takes us many months after a distribution release to add support.  See your Release Notes from the compiler documentation to determine supported distributions and versions.<br /><br /><br /><b>Resolution : </b>Add several packages to your OpenSUSE installation PRIOR to installation of the compiler.<br /><br /><br /><b>Procedure:</b><br /><br /><b>00) Remove any previous failed installations: </b><br />If you have an installation of the Intel Compiler Pro v11.1 on your system from a failed attempt, uninstall it.  <br />/opt/intel/Compiler/11.1/046/bin/[ia32 | intel64]/uninstall_cpro[c | f].sh<br /><br />substitute your version for "046" above if you have another version besides 11.1.046<br /><br /><br /><b>0) First determine whether you have installed a 32bit or 64bit version of OpenSUSE.  Do this with the uname -a command:</b><br /><br />uname -m<br /><br />which will return:<br /> x86_64   if you have a 64bit installation<br /> i686  if you have a 32bit installation<br /><br />Based on whether you have a 32bit or 64bit installation, choose one of the 2 procedures below.<br /><br /><br /><br /><br /><b>1)  i686 32bit Installation</b><br /><br /><b>a) login as root or super user.</b> <br />If you do not have the root password or priviledge, check if you have SUDO priviledges.  <br />If you do not have either root/admin or SUDO priviledges STOP.  You will be unable to install the Intel compilers on this installation until you are able to add system-wide packages as a root or admin user.<br />If you use SUDO to gain access, open a root window with this command:<br /> sudo bash<br /><br /><b>b) Add Base Development and C/C++ Development</b><br />start Yast2 in interactive mode.  From the root window:   yast2<br />When the graphical admin tool Yast2 opens, there is a button (lower right) for "Software Manager".<br />Click Software Manager button to open the Software Manager tool.  <br />On this Software Manager window, find the "Filter" pull-down.  Set Filter to "Patterns" to display groups of packages in the left-hand list of package groups.  Scroll down in this list to find the group named "Development".<br />Under the "Development" group, select the following package sets to install:<br /> "Base Development"<br /> "C/C++ Development"<br /><br />in addition, if you are installing the Intel C++ compiler and wish to use Eclipse integration, also install the "Integrated Development Environments"/"Eclipse" package set.<br /><br />Once these package sets are select, select "Install" to install the developer packages on your system.<br /><br /><b>c) Install 32bit gcc and g++ 3.3 and make the default</b><br />From the terminal window, as root:<br /><br />zypper install gcc33-32bit<br />zypper install libstdc++33-32bit<br /><br />Try the installation of the Intel Compiler at this point.  If this does not work, consider doing the following:<br /> rm /usr/bin/gcc<br /> ln -s /usr/bin/gcc-3.3 /usr/bin/gcc<br /><br />You may now proceed with an installation of the Intel Compilers.<br /><br /><br /><b>2) x86_64 64bit OS Installation</b><br /><br /><b>a) login as root or super user.</b> <br /> If you do not have the root password or priviledge, check if you have SUDO priviledges.  <br /> If you do not have either root/admin or SUDO priviledges STOP.  You will be unable to install the Intel compilers on this installation until you are able to add system-wide packages as a root or admin user.<br /> If you use SUDO to gain access, open a root window with this command:<br /> sudo bash<br /> <br /> <b>b) Add Base Development and C/C++ Development</b><br /> start Yast2 in interactive mode.  From the root window:   yast2<br /> When the graphical admin tool Yast2 opens, there is a button (lower right) for "Software Manager".<br /> Click Software Manager button to open the Software Manager tool.  <br /> On this Software Manager window, find the "Filter" pull-down.  Set Filter to "Patterns" to display groups of packages in the left-hand list of package groups.  Scroll down in this list to find the group named "Development".<br /> Under the "Development" group, select the following package sets to install:<br /> "Base Development"<br /> "C/C++ Development"<br /> <br /> in addition, if you are installing the Intel C++ compiler and wish to use Eclipse integration, also install the "Integrated Development Environments"/"Eclipse" package set.<br /> <br /> Once these package sets are select, select "Install" to install the developer packages on your system.<br /> <br /> <b>c) Install gcc and g++ 3.3 </b><br /> From the terminal window, as root:<br /> <br /> zypper install gcc33<br /> zypper install libstdc++33<br />zypper install libstdc++33-32bit<br /><br />At this point you are ready to install the 64bit versions of the Intel Compiler.  But before you do, read below:<br /><br /><b>d) Determine if you want or need to develop 32bit applications</b><br />Up to this point you have everything you need to install the 64bit Intel compilers and develop 64bit applications.  If this is all you need, locate the Intel compiler tarball named *_intel64.tgz, for example, l_cprof_p_11.1.046_intel64.tgz and install.  <br />IF you want to be able to create 32bit applications AND 64bit applications:<br /><br />zypper install gcc33-32bit<br /> <br /> <br /> You may now proceed with an installation of the Intel Compilers.  Use the combined IA-32 and Intel64 package, for example l_cprof_p_11.1.046.tgz.<br /><br /><br />Finishing up:  Usage<br /><br />Once the compilers are installed, it is necessary to source the ifortvars.sh or ifortvars.csh file to properly set the user environment to use the Intel compilers.  This (these) commands can be placed in a user's ~/.bashrc or other system login file (fortran 11.1.046 example shown below, bash user):<br /><br />64bit compiler selection:<br /> source /opt/intel/Compiler/11.1/046/bin/ifortvars.sh intel64<br /><br />32bit compiler selection:<br /> source /opt/intel/Compiler/11.1/046/bin/ifortvars.sh  ia32 <br /><br />C/C++ users: substitute "iccvars" for "ifortvars" above.<br /><br />Other versions: substitute your actual minor version for "046" above.  <br />Also, if you are a CSH or TCSH user, use ifortvars.csh or iccvars.csh as appropriate.<br /><br /><br /><b>It is hoped this guide proves helpful for installing the Intel Compilers Professional Edition on an OpenSUSE installation.  Please add comments to this article if you have suggestions or tips to improve this guide.<br /></b><br /><br /></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/installing-intel-compilers-on-opensuse</link>
      <pubDate>Wed, 22 Jul 2009 09:36:56 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/installing-intel-compilers-on-opensuse#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/installing-intel-compilers-on-opensuse</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® Fortran Compiler for Linux* Knowledge Base</category>
    </item>
    <item>
      <title>How to Compile for Intel® AVX</title>
      <description><![CDATA[ <div id="art_pre_template">Intel® AVX (Intel® Advanced Vector Extensions) is a 256 bit instruction set extension to Intel® SSE (Intel® Streaming SIMD Extensions) that was first announced in 2008. Further information about Intel AVX is available at <a href="http://software.intel.com/en-us/avx/">http://software.intel.com/en-us/avx/</a> .<br /><br />The Intel C/C++ and Fortran Compilers, version 11.1, support the building of applications for Intel AVX. On Windows*, use the command line switch /QxAVX. On Linux*, use –xavx. The switches /QaxAVX (Windows) and –axavx (Linux) may be used to build applications that will take advantage of AVX instructions on Intel systems that support these, but will use only SSE instructions on other systems.<br /><br />Both C/C++ and Fortran compilers support automatic vectorization of floating-point loops using AVX instructions. The C/C++ compiler also supports AVX-based intrinsics (via the header file immintrin.h) and inline assembly. Intel AVX allows the vectorization of a wider variety of floating point loops than Intel SSE, with a greater potential performance gain due to the greater width of the SIMD registers. The vectorizer is enabled automatically by the switches listed above. To see which loops have been vectorized, use the switch /Qvec-report1 (windows) or –vec-report1 (Linux).<br /><br />Pending availability of processors supporting Intel AVX, the Intel® Software Development Emulator (Intel® SDE) is available for testing programs built for Intel AVX. See <a href="http://software.intel.com/en-us/articles/intel-software-development-emulator/">http://software.intel.com/en-us/articles/intel-software-development-emulator/</a> .<br />Further general information about the Intel Compilers for C/C++ and Fortran is available at <a href="http://software.intel.com/en-us/intel-compilers/">http://software.intel.com/en-us/intel-compilers/</a> . Further information about compiler support for Intel AVX may be found in the Intel C++ Compiler User and Reference Guides, for example in the section 'Intrinsics for Advanced Vector Extensions', accessible online at <a href="http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/compiler_c/index.htm">http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/compiler_c/index.htm</a> .</div> ]]></description>
      <link>http://software.intel.com/en-us/articles/how-to-compile-for-intel-avx</link>
      <pubDate>Thu, 16 Jul 2009 16:34:04 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/how-to-compile-for-intel-avx#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/how-to-compile-for-intel-avx</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Windows* Knowledge Base</category>
      <category>Intel® Fortran Compiler for Linux* Knowledge Base</category>
      <category>Intel® Visual Fortran Compiler for Windows* Knowledge Base</category>
    </item>
  </channel></rss>