Creating a Library from IPO Objects

Normally, libraries are created using a library manager such as ar. Given a list of objects, the library manager will insert the objects into a named library to be used in subsequent link steps.

prompt>xiar cru user.a a.o b.o

The above command creates a library named user.a that contains the a.o and b.o objects.

If, however, the objects have been created using -ipo -c, then the objects will not contain a valid object but only the intermediate representation (IR) for that object file. For example:

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

will produce a.o and b.o that only contains IR to be used in a link time compilation. The library manager will not allow these to be inserted in a library.

In this case, you must use the Intel library tool xild -ar. This program will invoke the compiler on the IR saved in the object file and generate a valid object that can be inserted in a library.

prompt>xild -lib cru user.a a.o b.o

See Creating a Multifile IPO Executable Using xild.