Intel C++ compiler

Lukas Hosek none.of at
Fri Jul 2 10:44:08 PDT 2004

In case anybody is intrested: I tested building some applications using 
the intel c/c++ compiler (icc) and it was an agreeable surprise.

Quite a lot of packages built out of the box and it seemed to me that 
the binaries started faster than prelinked binaries built by gcc - 
prelinking icc binaries actually slowed them down.

My system is a P4 Northwood 2GHz with LFS CVS 2004-06-22, with 
gcc3.4.0-release. I used C/CXXFLAGS -O2 -march=pentium4 (I also tried 
adding -ip (interprocedural optimizations) and -parallel (auto 
parallelization), but it seemed to produce defective binaries more often 
than not). I also added -cxxlib-gcc tpo the icc.cfg - it is supposed to 
ensure binary compatibility with c++ programs built using g++, and also 
produces smaller binaries.

For comparison
A "hello world" program built with gcc  ~ 2kB
with icc, without -cxxlib-gcc           ~34kB
with icc, witht   -cxxlib-gcc           ~ 7kB
with icc, witht   -cxxlib-gcc, stripped ~ 4kB

One thing I don't understand: isn't this option supposed to affect only 
c++ programs?

Here's a list of packages I tried to build:

packages that built smoothly:
gpm 1.20.1
lynx 2.8.4
mc 4.6.0
which 2.14
glib1 1.2.10
libpng 1.2.5
expat 1.95.7
freetype 2.1.7
fontconfig 2.2.2
libjpeg 6b
libmng 1.0.7
lcms 1.11
libtiff 3.6.1
glib2 2.4.2
pkgconfig 0.15.0
libogg 1.1
alsa-utils 1.0.5
audiofile 0.2.6
libmad 0.15.1b
tcpwrap 7.6
xdelta 1.1.3
xli 1.16
libxml2 2.6.10
libxslt 1.1.7
pcre 4..
libart-lgpl 2.3.16
vorbis-tools 1.0.1
gtk1 1.2.10
nasm 0.98.38
lame 3.96
and last, but not least, THE LINUX 2.6.6 KERNEL
  -required some patching, but nothing complicated
   not yet tested with networking, but xfree and alsa works
   (I tested it with Prodigy - Firestarter because i presumed it's a
    bigger "load" than other songs :))

packages that didn't succesfully build:
openssl 0.9.7c
alsa-lib 1.0.5
alsa-oss 1.0.5
esound 0.2.34
arts 1.2.3
  - there were some syntax issues in alsa-lib and they propagated to all
    programs that included its headers.
kdelibs 3.2.3
  - some link-time issues. When I decided to build it with gcc, it didn't
    work either, bacause some tests it runs during the build segfaulted.
    It turned out later to be a problem with Qt libs (also compiled using
    icc, but the strange thing is, programs like qtconfig of designer
    worked without any problems)
prelink 2004-05-20

(BTW Intel warns that icc has some problems with "the new NPTL-based 
pthreads library introduced in Red Hat Linux 9." The fact is the 
packages that built without problems were small ones and those that 
failed were big prjects which are more likely to use threads extensively.)

problematic packages:
qt 3.3.2
  - see kdelibs note
xfree86 4.4.0
  - had to disable building of xf86cfg, because icc didn't know what to
    do with "bool Bool;"
  - when I built it for the first time with -O3 -march=pentium4 -ip it
    worked, but some programs (xclock, qtconfig) segfaulted. I decided
    to rebuild it once more, with less aggresive optimizations
    (-O2 -march=pentium4) and this time the X server segfaulted
    immediately after start. If anybody knows of a working combination
    of optimization options, please let me know.
libvorbis 1.0.1
  - works ok, but had to disable building of examples
libelf 0.8.5
  - built succesfully, even passed all tests, but prelink, even
    when built using gcc, refused to link against it.
mpg123 0.59r
  - "make linux" works, but "make linux-alsa" and "make linux-esd"

I hope someone may find this useful.

Lukas Hosek

More information about the lfs-chat mailing list