# Compilation Phases

The Intel® C++ Compiler processes C/C++language source files. Compilation can be divided into these major phases:

- Preprocessing

- Semantic parsing

- Optimization

- Code generation

- Linking

The first four phases are performed by the compiler:

Example
    //# Linux* and macOS*
    icc or icpc
    //# Windows*
    icl.exe

By default, the compiler automatically invokes the linker to generate the final executable binary:

Example
    //# Linux and macOS*
    xild
    //# Windows
    xilink.exe

If you specify the c option at compilation time, the compiler will generate only object files. You will need to explicitly invoke linker in order to generate the executable.

If you are compiling for a 32-bit target, you may either set the environment variable, `INTEL_TARGET_ARCH_IA32`, or use the [Q]m32 option. If you used the c option you will need to pass the [Q]m32 option to the linker as well.

If you specify the E and P options when calling the compiler, the compiler will only generate the preprocessed file with an .i extension.

If you specify the [Q]ipo option to use multi-file interprocedural optimization (also called Whole Program Optimization), the optimization is done at link time. Similarly, when you specify option [Q]prof-gen to use Profile Guided Optimization, the optimization is done at link time.

In both cases, the Intel® C++ compiler will generate mock object files that only the linker (xilink.exe and xild) can understand. You can also use the compiler driver to perform the link step (icl.exe, icc and icpc).

Parent topic: Compilation

## See Also

Linking Tools and Options
c compiler option
ipo, Qipo compiler option
prof-gen, Qprof-gen compiler option
E compiler option
P compiler option