Linking libraries built using ICC with an application created using GCC

I have a set of static libraries like lib1.a , lib2.a and lib3.a that have been compiled using ICC (Intel C / C ++ Compiler). I used ICC with -ipo -c to compile to create .o files , and then XIAR (Intel Archiver) to create .a libraries.

I want to provide these three libraries to a client that does not have ICC, and therefore will use GCC to compile and link my application with these libraries. Will acceleration be achieved (expected from optimizing cross files due to libs built with the -ipo option )if she links these libraries using GCC?

This Intel GCC Compatibility Page reads as follows:

Optimize connection times using the -ffat-lto-objects compiler option for gcc compatibility. This means that ld and ar can be used to link and archive object files, but by doing so you will lose cross-file optimizations.

I am using icc version 13.1.0 (compatible with gcc version 4.6.0) with gcc version 4.6.3 on Ubuntu 12.04.2.

Any help would be appreciated.

+4
source share
2 answers

If you use -ipo, the optimization will actually be done at the link stage.

During compilation (icc -c -ipo), the Intel compiler saves only additional information in the object files. This additional information is used at the link stage to perform actual inter-procedure optimization (ipo).

Thus, in order to take advantage of the IPO, you need to use the Intel compiler at the build stage and .

+2
source

xiar, , , IPO . .a, -ipo.

, , -ipo, , .

, .a, -ipo ( , -ipo), . "" -ipo .

+1

All Articles