User`s guide
Compiler Overview [7]
The compilation processes for these modes differ in the following ways:
Whole-program compilation
This is the preferred method for compiling applications. In
whole-program compilation, the compilation phase is made up of
several sub-phases. The compiler first parses (partially compiles)
each source file. During this phase, the compiler gathers information
about every module in the program and saves it to the
program
library. The next phase is the translation phase. During this phase,
the program is translated and optimized. The compiler optimizes
each function in the program using information from within that
function's module or other modules, including linked libraries,
that the compiler gathered earlier. Finally, in the linking phase,
the compiler links separate modules into a program executable.
Information about all modules is stored, and passed between phases,
in the program library.
Separate-module compilation
The compiler creates a separate object file for each source file and
optimizes the functions within each source file using information
about functions within that file. Then, the separate modules are
linked to create a program executable.
Whole-program compilation generally produces more highly optimized code than
separate-module compilation. You can compile a program using one mode or the
other, or a combination of the two.
The following diagram shows the object files that the compiler creates when
compiling the same arnoldi.cc and blas.cc files in different modes.
S–2479–20 77