Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7953 Discussions

Corrupted shared/static library generated when using multi-object IPO?

pldrouin
Beginner
281 Views
Hi,

I am using icpc 10.0 20070426 to create a shared library from a bunch of objects that have been compiled with the -ipo option. There are too many object files to use a single ipo file so icpc uses multi-object IPO automatically. It generates the shared library without throwing any error, but then when I try to link this library to produce an executable (using icpc -ipo again), it throws a bunch of errors about undefined references to functions. If I simply split my original object files in 2 subsets and that I generate 2 shared libraries (in this case icpc does not need to use multi-object IPO) which I both link to produce my executable the exact same way, everything works fine. Is that a known problem with icpc to sometimes generate corrupted shared libraries when using multi-object IPO? I get the exact same problem if I try linking to a single static library (generated using xiar cru). Everything works if I link to the IPO object files directly (always using icpc -ipo). I do not get any error in any case with g++/ar.

Thank you!
0 Kudos
2 Replies
JenniferJ
Moderator
281 Views
Quoting - pldrouin

I am using icpc 10.0 20070426 to create a shared library
This compiler version is very old. We do not support it any more.

Could you try the 11.0 to see if the problem still exist? If you get an eval - http://www3.intel.com/cd/software/products/asmo-na/eng/download/eval/219690.htm, it will be the latest 11.0.

Thanks,
Jennifer
0 Kudos
pldrouin
Beginner
281 Views
This compiler version is very old. We do not support it any more.

Could you try the 11.0 to see if the problem still exist? If you get an eval - http://www3.intel.com/cd/software/products/asmo-na/eng/download/eval/219690.htm, it will be the latest 11.0.

Thanks,
Jennifer

I was able to find the cause of the problem. The code I am compiling has some source files auto-generated by CERN ROOT ("Dictionary files") which contain mangled named for member functions. The object files corresponding to these source files cannot be separated from the other object files during multi-object optimization, so I carefully defined subsets of object files which I optimize separately using -ipo_c.
0 Kudos
Reply