icc creates MUCH larger binaries compared to g++

icc creates MUCH larger binaries compared to g++

Hello everybody,
While trying out icc on a c++ project the resulting binaries/
libraries are almost 2-3 times the size of those created using
g++. No such problems with C only.
A check on other c++ libraries such as Qt gives similiar results.
e.g. libqt-mt 3.1.1 with g++ is ~ 6M; with icc ~ 15M.
The binaries also consume upto 1.5 times the RAM; making icc
unusable for large projects.

nm -D | awk '{ print $(NF-1) " " $NF }' | sort -u | wc -l
shows that the number of symbols is also 2-3 times (almost
all of them with "W", manual says weak symbols not specifically
tagged as being weak).
Are others experiencing similiar issues. Thanks in advance.


3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

With Intel compiler many of the (standard) libraries are
linked statically which increases the executable size.
You can use -i_dynamic option to link it dynamically.

Also for your application please check whether static or shared libs are being built with Intel compiler.
It is possible that with gcc; shared libs are being built whereas with Intel compiler, may be due to some configuration issue, static libs are being built.

You can use ldd to get the list of shared libraries required by your application.


Libraries are linked dynamically using -i_dynamic (which
anyway makes a difference of few hundred kb); shared libraries
are being built with both gcc and icc and ldd shows similiar
output except for libcprts+libcxa+libunwind with icc and
libstdc++ for g++. So that is not the issue. Also this shows
up only with c++ containing a number of classes. The problem
is also not unique as similiar behaviour can be seen with other
large c++ applications e.g. Qt (as mentioned).
Has anyone built Qt with different result.

Also optimization and no optimization (-O0) or -ip/-ipo with or
without makes a difference of few hundred kb only.


Leave a Comment

Please sign in to add a comment. Not a member? Join today