Command Line for Creating an IPO Executable

The command line options to enable IPO for compilations targeted for IA-32, Intel® EM64T, 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*

ifort -ipo -c a.f b.f c.f

Windows*

ifort /Qipo /c a.f b.f c.f

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

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.

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

ifort -oapp a.o b.o c.o

Windows

ifort /exe:app 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 ifort 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

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

Windows

ifort /Qipo /Feapp a.f b.f c.f

The ifort 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 /exe (Windows) option. Multifile IPO is applied only to the source files that have an IR; otherwise, the object file passes to link stage.