In certain situations you might need to generate real object files with -ipo. To force the compiler to produce real object files instead of "mock" ones with IPO, you must specify -ipo_obj in addition to -ipo.
Use of -ipo_obj is necessary under the following conditions:
The objects produced by the compilation phase
of -ipo will be placed in a static library without
the use of xiar. The compiler does not support
multifile IPO for static libraries, so all static libraries are passed
to the linker. Linking with a static library that contains "mock"
object files will result in linkage errors because the objects do not
contain real code or data. Specifying
-ipo_obj causes the compiler to generate object files that can
be used in static libraries.
Alternatively, if you create the static library using xiar, then the resulting static library will work as a normal library.
The objects produced by the compilation phase of -ipo might be linked without the -ipo option and without the use of xiar.
You want to generate an assembly listing for each source file (using -S) while compiling with -ipo. If you use -ipo with -S, but without -ipo_obj, the compiler issues a warning and an empty assembly file is produced for each compiled source file.
An IPO compilation consists of two parts: the compile phase and the link phase. In the compile phase, the compiler produces an intermediate language (IL) version of the users’ code. In the link phase, the compiler reads the IL and completes the compilation, producing a real object file or executable.
Generally, different compiler versions produce IL based on different definitions, and therefore the ILs from different compilations can be incompatible. Intel Fortran Compiler assigns a unique version number with each compiler’s IL definition. If a compiler attempts to read IL in a file with a version number other than its own, the compilation proceeds, but the IL is discarded and not used in the compilation. The compiler then issues a warning message about an incompatible IL detected and discarded.
The IL produced by the Intel compiler is stored in file with a suffix .il. Then the .il file is placed in the library. If this library is used in an IPO compilation invoked with the same compiler as produced the IL for the library, the compiler can extract the .il file from the library and use it to optimize the program. For example, it is possible to inline functions defined in the libraries into the users’ source code.