Command Line for Creating an IPO Executable

The command line options to enable IPO for compilations targeted for both the IA-32 and ItaniumŪ architectures are identical.

To produce mock object files containing IR, compile your source files with -ipo (Linux*) or /Qipo (Windows*) as demonstrated below:

Platform

Example Command

Linux*

icpc -ipo -c a.cpp b.cpp c.cpp

Windows*

icl /Qipo /c a.cpp b.cpp c.cpp

The output of the above example command differs according to platform:

You must use -c (Linux) or /c (Windows) to stop compilation after generating .o (Linux) or .obj (Windows) files. The output files contain IntelŪ compiler intermediate representation (IR) corresponding to the compiled source files.

You can now optimize interprocedurally by linking with the IntelŪ compiler or with the Intel linkers: xild (Linux) or xilink (Windows). The following examples produce an executable named app:

Platform

Example Command

Linux

icpc -oapp a.o b.o c.o

Windows

icl /Feapp a.obj b.obj c.obj

This command invokes the compiler on the objects containing IR and creates a new list of objects to be linked. Alternately, you can use the xild (Linux) or xilink (Windows) tool instead of icpc (Linux) or icl (Windows) with the appropriate linker options.

The separate commands demonstrated above can be combined into a single command, as shown in the following examples:

Platform

Example Command

Linux

icpc -ipo -oapp a.f b.f c.f

Windows

icl /Qipo /Feapp a.cpp b.cpp c.cpp

The icl/icpc command, shown in the examples above, calls GCC ld (Linux only) or Microsoft* link.exe (Windows only) to link the specified object files and produce the executable application, which is specified by the -o (Linux) or /Fe (Windows) option. Multifile IPO is applied only to the source files that have an IR, otherwise the object file passes to link stage.