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

Compilation very slow for templates

anita_sivakumar
Beginner
318 Views
Hi,

I am trying to compile an executable that uses template class.
The compilation is done using icpc default options (i.e. O2 level). If this is chosen, it takes around 45 mins and still does not finish compiling.
The compilation time is appreciable only when I use O0 level ( not even O1).
However, the same using g++, I am able to have same compilation time for O0, O1, O2 & O3 levels - there is no significant change in the time.
I am using 11.0 version for icpc.
Has anyone faced this issue? Any idea why the optimization is soo different for icpc & g++ ?

Thanks.
0 Kudos
1 Reply
JenniferJ
Moderator
318 Views

only when -ipo is used it will slow down a lot, but not so much with only -O2.

it's more likely a bug in the compiler. is it slow in compiling or linking? If it's in compiling, could you send the code?

you can use "Private" post to upload code if you'd like or file a ticket to Intel Premier Support https://premier.intel.com/

Thanks,
Jennifer

0 Kudos
Reply