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

Help: -ipo option reports: warning #11010: file format not recognized for lib.a

panzhu
Beginner
408 Views
Hi:
I'm now trying to build a C/C++ project using ICC (version 11.0) on Centos5.2 x86_64 platform. When I specify
option "-ipo" or "-fast" to the ICC compiler, the warning in title jumped out and the linking failed saying some
symbols that are defined inside the library are undefined reference. The project can build successfully
using ICC _without_ that option but I want to get some performance with those options.

I use "nm" to check that the object file inside that library created with that option but find nothing, like this:

--------------------------------
$nm build/ICC32-Linux-x86/object/pmsgi.o
w __ildata_included
$file build/ICC32-Linux-x86/object/pmsgi.o
ELF 64-bit LSB relocatable, AMD x86-64, version 1 (GNU/Linux), not stripped
--------------------------------

But things change a lot on the object file without that option, like this.

--------------------------------
$nm build/ICC32-Linux-x86/object/pmsgi.o

0000000000000000 r _2__STRING.0.0
000000000000000c r _2__STRING.1.0
0000000000000010 T _Z19pmsgi_set_file_nameP8_IO_FILE
U _ZN9msgSystem11setFileNameEP8_IO_FILE
U _ZN9msgSystem12initMsgMutexEv
U _ZN9msgSystem20print_severity_timesEv
U _ZN9msgSystem6setMaxEii
U _ZN9msgSystem7initialEv
U _ZN9msgSystem8printMsgEiP13__va_list_tag
U __gxx_personality_v0
---------------------------------

So seems that option remove all of the symbols, right? I get quite confused here.

The ICC command I use is in the "intel64" directory, I also try the "ia32" but get a
worse outcome. My CPU info is here and I have two Quad cpus each has 4 cores.

----------------------------------------
$cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel Xeon CPU E5430 @ 2.66GHz
stepping : 6
cpu MHz : 2660.004
cache size : 6144 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm
bogomips : 5323.75
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
.............................
.............................
.............................
-------------------------------------------------------

Can any expert give a hand here? Thank in advance.

Regards
0 Kudos
4 Replies
JenniferJ
Moderator
408 Views
When -ipo is used, the .o file containsintermediate data instead of object data and only icc can understand it.
So try using icc or icpcfor linking. (icc for C code; icpcfor C++ code)

Jennifer
0 Kudos
panzhu
Beginner
408 Views
When -ipo is used, the .o file containsintermediate data instead of object data and only icc can understand it.
So try using icc or icpcfor linking. (icc for C code; icpcfor C++ code)

Jennifer

Hi Jennifer:

Thanks for your reply. I can confirm that the whole project is compiled and linked with icc and icpc,
no other compiler or linker. The warning mentioned is reported from icpc when linking the binary and
the library is also built by icc/icpc.

Regards.
0 Kudos
Brandon_H_Intel
Employee
408 Views
Quoting - panzhu

Hi Jennifer:

Thanks for your reply. I can confirm that the whole project is compiled and linked with icc and icpc,
no other compiler or linker. The warning mentioned is reported from icpc when linking the binary and
the library is also built by icc/icpc.

Regards.

If you're creating static libraries, make sure you're using the Intel-provided utility "xiar" to do the archiving and not the standard GNU "ar" if you're using IPO.
0 Kudos
panzhu
Beginner
408 Views

If you're creating static libraries, make sure you're using the Intel-provided utility "xiar" to do the archiving and not the standard GNU "ar" if you're using IPO.

Thank you Brandon, the warning disappeared when I replace "ar" with "xiar".

Regards.
0 Kudos
Reply