Compiler Usage Guidelines for 64-Bit Operating Systems on AMD64 ...
Compiler Usage Guidelines for 64-Bit Operating Systems on AMD64 ...
Compiler Usage Guidelines for 64-Bit Operating Systems on AMD64 ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<str<strong>on</strong>g>Compiler</str<strong>on</strong>g> <str<strong>on</strong>g>Usage</str<strong>on</strong>g> <str<strong>on</strong>g>Guidelines</str<strong>on</strong>g> <str<strong>on</strong>g>for</str<strong>on</strong>g> AMD<str<strong>on</strong>g>64</str<strong>on</strong>g> Plat<str<strong>on</strong>g>for</str<strong>on</strong>g>ms<br />
32035 Rev. 3.22 November 2007<br />
-fno-rtti. This switch disables generati<strong>on</strong> of in<str<strong>on</strong>g>for</str<strong>on</strong>g>mati<strong>on</strong> about every class with virtual functi<strong>on</strong>s <str<strong>on</strong>g>for</str<strong>on</strong>g><br />
use by the C++ runtime type identificati<strong>on</strong> features (dynamic_cast and typeid). If the user does not<br />
use those parts of the language, some space can be c<strong>on</strong>served by using this switch.<br />
Users can obtain more details <strong>on</strong> these switches by trying info gcc <strong>on</strong> their Linux systems.<br />
3.9 Intel <str<strong>on</strong>g>Compiler</str<strong>on</strong>g>s (32-<str<strong>on</strong>g>Bit</str<strong>on</strong>g>) <str<strong>on</strong>g>for</str<strong>on</strong>g> Linux®<br />
The 32-bit Intel compilers can be installed and run <strong>on</strong> 32-bit and <str<strong>on</strong>g>64</str<strong>on</strong>g>-bit Linux <strong>on</strong> AMD Athl<strong>on</strong> <str<strong>on</strong>g>64</str<strong>on</strong>g>,<br />
AMD Opter<strong>on</strong> and AMD Family 10h processors. On <str<strong>on</strong>g>64</str<strong>on</strong>g>-bit Linux, the 32-bit binaries will run in<br />
compatibility mode. To be able to do this, <strong>on</strong>e has to tell the system linker <strong>on</strong> <str<strong>on</strong>g>64</str<strong>on</strong>g>-bit Linux to link with<br />
32-bit libraries, and to generate 32-bit executable. This can be d<strong>on</strong>e with the following command.<br />
PROMPT$ icc -Wl,-m,elf_i386 <br />
3.9.1 Invocati<strong>on</strong> Commands<br />
The following commands invoke specific compilers:<br />
icpc invokes the Intel C++ compiler <str<strong>on</strong>g>for</str<strong>on</strong>g> versi<strong>on</strong> 10.0.<br />
icc invokes the Intel C/C++ compilers <str<strong>on</strong>g>for</str<strong>on</strong>g> versi<strong>on</strong> 10.0.<br />
i<str<strong>on</strong>g>for</str<strong>on</strong>g>t invokes the Intel Fortran versi<strong>on</strong>s 10.0 compiler.<br />
3.9.2 Generic Per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance Switches<br />
These flags are recommended <str<strong>on</strong>g>for</str<strong>on</strong>g> Intel 10.0 compiler: -xW -ipo -O3 -static.<br />
The -xW switch instructs the compiler to optimize <str<strong>on</strong>g>for</str<strong>on</strong>g> a Pentium ® 4 processor (including SSE2<br />
instructi<strong>on</strong>s).<br />
The -ipo switch enables inter-procedural (across source files) analysis.<br />
The -O3 switch optimizes <str<strong>on</strong>g>for</str<strong>on</strong>g> speed, including several aggressive optimizati<strong>on</strong>s.<br />
3.9.3 Other Switches<br />
In additi<strong>on</strong> to the switches menti<strong>on</strong>ed in the following list of switches may also improve the<br />
per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance of the program. It is worth experimenting with these switches.<br />
Profile Guided Optimizati<strong>on</strong>. Intel compilers allow profile guided optimizati<strong>on</strong>. Use the<br />
following steps <str<strong>on</strong>g>for</str<strong>on</strong>g> profile guided optimizati<strong>on</strong> with Intel compilers.<br />
1. Compile the program with the -prof_gen switch. The -ipo or -ip switch is ignored by the compiler<br />
if used with -prof_gen.<br />
2. Run the executable produced in Step 1. Running this executable generates several files with<br />
profile in<str<strong>on</strong>g>for</str<strong>on</strong>g>mati<strong>on</strong> (*.dyn and *.dpi).<br />
34 Per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance-Centric <str<strong>on</strong>g>Compiler</str<strong>on</strong>g> Switches Chapter 3