Specifications
Chapter 3 Performance-Centric Compiler Switches 25
Compiler Usage Guidelines for AMD64 Platforms
32035 Rev. 3.22 November 2007
implementation may greatly improve the performance. For additional details on how to install this
library and use it, see http://developer.amd.com/assets/acml_userguide.pdf.
-fno-rtti. This switch disables generation of information about every class, with virtual functions, for
use by the C++ runtime type identification features (dynamic_cast and typeid). If the user does not
use those parts of the language, some space can be conserved by using this switch.
Generate 32-Bit Binaries with -m32. The user can also use 64-bit GCC compilers to generate
32-bit binaries by using the -m32 switch. This can improve performance if the program has lots of
variables of the type long and/or pointers. As these data-types are 32-bit in x86, this switch will
reduce the memory footprint of the program. Also, the user should use the recommended switches for
the 32-bit GCC compiler (section 3.8.4 on page 32) when -m32 is used.
Users can obtain more details on these switches by trying info gcc on their Linux systems.
3.3 Intel Compilers (64-Bit) for Linux
®
Intel provides 64-bit compilers for Linux that can be used for AMD64 systems. The current version
(as of Augus 2007) is 10.0. All options described in this section apply to this version.
3.3.1 Invocation Commands
The following commands invoke specific compilers:
• icpc invokes the C++ compiler.
• icc invokes the C compiler.
• ifort invokes the Fortran compiler.
3.3.2 Generic Performance Switches
The switches -xW -ipo -O3 -static are generally recommended.
3.3.3 Other Switches
In addition to the generic performance switches, it is worth experimenting with the following
switches.
Profile Guided Optimization. Intel compilers allow profile guided optimization. Use the
following steps for profile guided optimization with Intel compilers.
1. Compile the program with the -prof_gen switch. The -ipo or -ip switch is ignored by the compiler
if used with -prof_gen.
2. Run the executable produced in Step 1. Running this executable generates several files with pro-
file information (*.dyn and *.dpi).
3. Recompile the program with the -prof_use switch. It is recommended to also use the -ipo switch
in this stage.