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

icc (ICC) 17.0.1 20161005 creates much larger and slow executable than gcc

sergei_v_
Beginner
600 Views

If I compile plain C code using icc 17.0.1, it creates executable (if stripped) of 105k size, while the gcc (6.3.0 and 4.8.5) creates 8k size executable.  The executable compiled with icc is also about 20% slower.  Also, for some reason icc unnecessarily links to libdl.so and libgcc_s.so libraries.

I was under impression icc was meant to produce better performing executables than gcc ..

Is there anything I can do here with icc to get a better-performing, smaller executable, than with gcc ?

0 Kudos
5 Replies
jimdempseyatthecove
Honored Contributor III
600 Views

What are your command lines?

Jim Dempsey

0 Kudos
sergei_v_
Beginner
600 Views

I tried different command-line switches, with the same result, as an example:

icc -s -Os -march=native -fno-exceptions -DNDEBUG -mtune=native -Wl,--gc-sections -Wl,--as-needed  -o  myprog   myprog.c

produces (after stripping)  105k  executable which takes about 8.6 seconds to execute

gcc -s -Os -march=native -fno-exceptions -DNDEBUG -mtune=native -Wl,--gc-sections -Wl,--as-needed  -o  myprog   myprog.c

produces 8k executable which takes 7.7 seconds to execute

This is all on i7-3770 3.4GHz CPU  8Gb RAM  GNU/Linux

0 Kudos
Vladimir_P_1234567890
600 Views

Usually icc links its runtime to the executable. You can try to use -shared-intel to reduce the file size.

--Vladimir

0 Kudos
jimdempseyatthecove
Honored Contributor III
600 Views

For icc try replacing -march=native with -xHost

native is not listed in the icc documentation under march (this may or may not be a documentation error).

Jim Dempsey

0 Kudos
sergei_v_
Beginner
600 Views

Hi, in response to comment #4:   it does not look like icc linked anything to icc runtime. Instead it unnecessarily linked to libdl.so and libgcc_s.so  which are part of glibc and gcc.

I'm curious, if I can download icc version 11 somewhere and try that one?

0 Kudos
Reply