Intel® C++ Compiler 16.0 User and Reference Guide
In most cases, IPO generates a single true object file for the link-time compilation. This behavior is not optimal for very large programs, perhaps even making it impossible to use [Q]ipo compiler option on the application.
The compiler provides two methods to avoid this problem. The first method is an automatic size-based heuristic, which causes the compiler to generate multiple true object files for large link-time compilations. The second method is to manually instruct the compiler to perform multi-object IPO.
Use the [Q]ipo N compiler option and pass an integer value in the place of N.
Use the [Q]ipo-separate compiler option.
The number of true object files generated by the link-time compilation is invisible to you unless the [Q]ipo-c or [Q]ipo-S compiler option is used.
Regardless of the method used, it is best to use the compiler defaults first and examine the results. If the defaults do not provide the desired results then experiment with generating more object files.
You can use the [Q]ipo-jobs compiler option to control the number of commands, or jobs, executed during parallel builds.
If you specify [Q]ipo0, which is the same as not specifying a value, the compiler uses heuristics to determine whether to create one or more object files based on the expected size of the application. The compiler generates one object file for small applications, and two or more object files for large applications. If you specify any value greater than 0, the compiler generates that number of object files, unless the value you pass a value that exceeds the number of source files. In that case, the compiler creates one object file for each source file then stops generating object files.
The following example commands demonstrate how to use [Q]ipo2 option to compile large programs.
Operating System |
Example Command |
---|---|
Windows* |
icl /Qipo2 /c a.cpp b.cpp |
Linux* |
icpc -ipo2 -c a.cpp b.cpp |
OS X* |
icpc -ipo2 -c a.cpp b.cpp //with EDG compiler icl++ -ipo2 -c a.cpp b.cpp //with CLANG compiler |
In executing the above commands, the compiler generates object files using an OS-dependent naming convention. On Linux* and OS X*, the example command results in object files named ipo_out.o, ipo_out1.o, and ipo_out2.o. On Windows*, the file names follow the same convention; however, the file extensions will be .obj.
Link the resulting object files as shown in Using IPO or Linking Tools and Options.
Using [Q]ipo-separate allows you to force the compiler to generate the maximum number of true object files that the compiler will support during multiple object compilation. The maximum number of true object files is the equal to the number of mock object files passed on the link line.
For example, you can pass example commands similar to the following:
Operating System |
Example Command |
---|---|
Windows* |
|
Linux* |
icpc -ipo-separate -ipo-c a.o b.o c.o |
OS X* |
icpc -ipo-separate -ipo-c a.o b.o c.o //with EDG compiler icl++ -ipo-separate -ipo-c a.o b.o c.o //with CLANG compiler |
The compiler generates multiple object files that use the same naming convention discussed above.
Link the resulting object files as shown in Using IPO or Linking Tools and Options.