Developer Guide and Reference

Contents

Other Considerations

There are some notable differences between the Intel® C++ Compiler and GCC*. Consider the following as you begin compiling your source code with the Intel® C++ Compiler.

Setting the Environment

The Intel® C++ Compiler relies on environment variables for the location of compiler binaries, libraries, man pages, and license files. In some cases these are different from the environment variables that GCC uses. Another difference is that these variables are not set by default after installing the Intel® C++ Compiler. The following environment variables need to be set prior to running the Intel® C++ Compiler:
  • PATH
    : Add the location of the compiler binaries to
    PATH
    .
  • LD_LIBRARY_PATH
    : Sets the location where the generated executable picks up the runtime libraries (*.so files).
  • MANPATH
    – add the location of the compiler man pages (
    icc
    and
    icpc
    ) to
    MANPATH
    .
  • INTEL_LICENSE_FILE
    – sets the location of the Intel® C++ Compiler license file.
To set these environment variables, run the
compilervars.sh
script.
Setting these environment variables with
compilervars.sh
does not impose a conflict with GCC. You should be able to use both compilers in the same shell.

Using Optimization

The Intel® C++ Compiler is an optimizing compiler that begins with the assumption that you want improved performance from your application when it is executed on Intel® architecture. Consequently, certain optimizations, such as option
O2
, are part of the default invocation of the Intel® C++ Compiler. Optimization is turned off in GCC by default, the equivalent of compiling with option
O0
. Other forms of the
O
<n>
option compare as follows:
Option
Intel® C++ Compiler
GCC