# [HOWTO] Intel C++ Compiler and per-package CFLAGS

## mattst88

I've rewritten Gentoo-Wiki's HOWTO on using the Intel C++ Compiler.

http://gentoo-wiki.com/HOWTO_Intel_C_Compiler

The old guide was terribly written and horribly messy.

It also made Portage compile with icc unless you explicitly told it to use gcc. This is bad. Far too many packages don't work with icc to use this behavior. My guide makes Portage compile only specified packages with icc and all others with gcc which will save a few headaches in the long run. It also will give your system the ability to use per-package CFLAGS for gcc and icc!

Need feedback on the guide. Suggestions are welcome.

----------

## Etal

Thanks, that looks interesting.

Is the change in performance noticeable, though? For example, if I bzip an archive or encode a video in x264, how much faster would it be than if I use gcc 4.1 on a Core2 processor?

----------

## mattst88

```
decompression linux-2.6.23.tar.bz2

 CC    CFLAGS                     time 1  time 2  time 3  time avg

 icc   "-O2 -xT -parallel -gcc"   20.970  20.917  21.037 20.975

 icc   "-O2 -xT -gcc"             21.384  22.115  21.346 21.615

 icc   "-O3 -xT -parallel -gcc"   22.298  21.682  22.643 22.208

 icc   "-O3 -xT -gcc"             21.543  21.465  21.938 21.649

 icc   "-fast -xT -parallel -gcc" 21.583  21.818  21.584 21.662

 icc   "-fast -xT -gcc"           21.645  21.383  22.042 21.690

 gcc   "-O2 -march=nocona"        21.221  21.620  21.376 21.406

 gcc   "-O3 -march=nocona"        21.076  21.170  20.956 21.067

 gcc   "-Os -march=nocona"        21.712  21.492  21.848 21.684
```

As far as bzip2 decompression is concerned, "icc -xT -parallel -gcc" beats "gcc -O3 -march=nocona" 20.975 seconds to 21.067. Hardly at all in other words.

```
compression linux-2.6.23.tar.bz2

 CC  CFLAGS                     time 1 time 2 time 3 time avg

 icc "-O2 -xT -parallel -gcc"   48.751 48.191 48.592 48.511

 icc "-O2 -xT -gcc"             47.452 48.208 47.969 47.876

 icc "-O3 -xT -parallel -gcc"   48.633 48.822 47.827 48.427

 icc "-O3 -xT -gcc"             46.851 48.087 48.295 47.744

 icc "-fast -xT -parallel -gcc" 49.289 49.789 49.199 49.426

 icc "-fast -xT -gcc"           49.200 49.467 49.441 49.369

 gcc "-O2 -march=nocona"        51.830 53.395 52.037 52.421

 gcc "-O3 -march=nocona"        52.073 53.426 52.331 52.610

 gcc "-Os -march=nocona"        50.256 51.365 51.464 51.028
```

In the case of compression, "icc -O3 -xT -gcc" beats "gcc -Os -march=nocona" 47.744 to 51.028 seconds. This is a significant difference.

In this thread a user states that xvid is 10-15% faster on an Athlon XP (this is without SSE2,3 optimizations)

Also see:

PHP gcc/icc benchmarks

----------

## easy target

 *AM088 wrote:*   

> Thanks, that looks interesting.
> 
> Is the change in performance noticeable, though? For example, if I bzip an archive or encode a video in x264, how much faster would it be than if I use gcc 4.1 on a Core2 processor?

 

 This  article says something about icc and gcc.

----------

## deno

Here faac fails with error:

```
icc -O2 -xP -gcc -o .libs/faac main.o input.o  ../libfaac/.libs/libfaac.so -lm /usr/lib/libmp4v2.so -ldl

ld: .libs/faac: hidden symbol `__svml_sin2' in /opt/intel/cc/10.1.012/lib/libsvml.a(svml_dsin2.o) is referenced by DSO

ld: final link failed: Nonrepresentable section on output

make[2]: *** [faac] Error 1

make[2]: Leaving directory `/var/tmp/portage/media-libs/faac-1.26-r1/work/faac/frontend'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/media-libs/faac-1.26-r1/work/faac'

make: *** [all] Error 2
```

Any suggestions on how could i solve this?

edit:

same(?) happens witg libtheora. error:

```
ld: .libs/decoder_example: hidden symbol `__svml_cosf4' in /opt/intel/cc/10.1.012/lib/libsvml.a(svml_scos4.o) is referenced by DSO

ld: final link failed: Nonrepresentable section on output

make[2]: *** [decoder_example] Error 1

ld: .libs/chaining_example: hidden symbol `__svml_cosf4' in /opt/intel/cc/10.1.012/lib/libsvml.a(svml_scos4.o) is referenced by DSO

ld: final link failed: Nonrepresentable section on output

make[2]: *** [chaining_example] Error 1

make[2]: Leaving directory `/var/tmp/portage/media-libs/libvorbis-1.2.0/work/libvorbis-1.2.0/examples'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/media-libs/libvorbis-1.2.0/work/libvorbis-1.2.0'

make: *** [all] Error 2
```

----------

## paluszak

I have just compiled x11-themes/qtcurve, x11-themes/gtk-engines-curve and app-mobilephone/obex-data-server, they all seem to work fine. Is there a place where we could make a list of packages that compile fine with ICC?

Another thing is that it pays to read the ICC docs, there are some optimization options that could be considered, for instance, my flags on Pentium4 look like this:

```
-march=pentium4 -xW -O2 -ip -gcc
```

It seems that -ipo could give a huge boost cause it enables multi-file optimizations, but, unfortunately, it's not really compatible with the build system of most Linux packages as it causes the compiler not to generate standard object files during compilation phase.

----------

## deno

I have just compiled firefox, but it wont run. I get:

```
No running windows found

/usr/libexec/mozilla-launcher: line 119:  2513 Segmentation fault      $(type -P aoss) "$mozbin" $xulparams "$@"

firefox-bin exited with non-zero status (139)
```

btw I am just compiling e17 packages. for now only thing i can say is that a lot of them compiles fine. enterminus runs, and it is slow as always  :Smile: .

----------

## deno

my specs: core due t 2250, icc version 10.1

e17 (everything below) and all modules build fine

dev-libs/eet 

dev-db/edb 

x11-libs/evas 

x11-libs/ecore 

dev-libs/efreet 

dev-libs/embryo 

media-libs/edje 

media-libs/emotion 

media-libs/imlib2 

media-libs/epeg 

media-libs/epsilon 

x11-libs/ewl 

x11-libs/e_dbus 

x11-wm/e  

x11-libs/esmart 

x11-misc/entrance 

x11-terms/enterminus 

app-misc/entropy

from other apps i compiled those also build and run fine:

x11-terms/xterm

x11-plugins/itask-ng

dev-libs/nss

dev-libs/nspr

app-text/hunspell

xfce-base/thunar

app-editors/vim-core

app-editors/gvim

 all these are ~x86 at the moment.

edit:

I am writing this with firefox beta 3  :Smile:  compiled with -xP -Os -gcc-version=420 -ipo -fomit-frame-pointer -parallel.Last edited by deno on Thu Feb 21, 2008 10:34 pm; edited 1 time in total

----------

## deno

@paluszak

From icc man page:

 *Quote:*   

>  -xW  --  Can  generate  SSE2  and  SSE instructions, and it can optimize for Intel(R) Pentium(R) 4 processors and
> 
>                  Intel(R) Xeon(R) processors with SSE2. This is the default on Linux systems using Intel(R) 64 architecture.  This
> 
>                  option is the same as specifying -march=pentium4.

 

Since -xW is the same thing as as -march=pentium4 I don't see the point in setting both flags.Last edited by deno on Wed Feb 20, 2008 9:39 am; edited 1 time in total

----------

## paluszak

 *deno wrote:*   

> @paluszak
> 
> From icc man page:
> 
>  *Quote:*    -xW  --  Can  generate  SSE2  and  SSE instructions, and it can optimize for Intel(R) Pentium(R) 4 processors and
> ...

 

Oops, that's all about reading the docs. Anyway, it seems that using -ipo or -ip if -ipo fails gives a huge boost. I generally try to compile packages with -ipo, and if it fails I switch back to -ip.

----------

## mattst88

 *deno wrote:*   

> Here faac fails with error:
> 
> ```
> icc -O2 -xP -gcc -o .libs/faac main.o input.o  ../libfaac/.libs/libfaac.so -lm /usr/lib/libmp4v2.so -ldl
> 
> ...

 

What are your CFLAGS? Both of these packages compile cleanly with "-O3 -ipo -xT -gcc" on my AMD64 system.

----------

## scronkey

Good effort on your clean and well written HOWTO.

I installed icc a little while ago, not using portage though. I've just been experimenting with it but I was wondering if the set up described in your article could still be used, without me re-installing the compiler through portage.

From the looks of it I'd say it would work but I'm not sure whether the /etc/portage/bashrc file and the ICCCFLAGS would still be adhered to by portage. I really like the clean separation of what is compiled with what and I want to get Python compiled with icc but considering how central Python is to Gentoo I don't want to go in blindly (Been there before. You're not really a Gentoo until you've borked your Python install!).

Any tips or caveats you're aware of? Is the /etc/portage/bashrc used for other parts of portage or is it something you've implemented?

----------

## deno

@|mattst88|

Thanks for your replay. Have just compiled libtheora, but faac still fails. I have experimented with flags and it always fails. I have tried: -xP -O2 -gcc-version=420 -fomit-frame-pointer -ipo

-xP -O2 -gcc-version=420

-xP -O3 -gcc-version=420 -fomit-frame-pointer -ipo

-xP -O3 -gcc-version=420

-xP -Os -gcc-version=420 -fomit-frame-pointer -ipo

-xP -Os -gcc-version=420

edit:

faac compiles with 'media-libs/faac -mtune=pentium4 -O2 -gcc-version=420'. the same is a must here for libvorbis.Last edited by deno on Thu Feb 21, 2008 7:50 pm; edited 1 time in total

----------

## deno

splashutils now fails (with gcc-4.2.3, probably because of freetype been compiled with icc) error: *Quote:*   

> gcc -march=prescott -O2 -pipe -fomit-frame-pointer -I/usr/include/freetype2 -L/usr/lib -o fbtruetype -L/usr/lib fbtruetype.o messages.o console.o ttf.o luxisri.o -lfreetype -lm
> 
> gcc -march=prescott -O2 -pipe -fomit-frame-pointer -I/usr/include/freetype2 -L/usr/lib -static -o fbtruetype.static -L/usr/lib fbtruetype.o messages.o console.o ttf.o luxisri.o /usr/lib/libfreetype.a /usr/lib/libz.a -lm
> 
> ttf.o: In function `Find_Glyph':
> ...

 

now even if recompile freetype with gcc i get this error compiling splashutils: 

 *Quote:*   

> Making all in src
> 
>   CREATE  fbsplash.h
> 
> Making all in .
> ...

 

...what is here strange to me is that i see intel mentioned again... could ccache have something to do with it?

----------

## mattst88

deno,

I experienced this also. My solution was to compile libpng with gcc. Alternatively, compile freetype, libpng, and splashutils with gcc, and following, recompile libpng and freetype with icc. That's a bit of a headache though.

----------

## kaethorn

Hello everyone and thanks for the HOWTO. I've followed the steps mentioned and it seems to work fine for app-arch/bzip2, but that's about it. As soon as I try any package which includes limits.h, compilation fails:

```

>>> Emerging (1 of 1) app-arch/cpio-2.9-r1 to /

[snip]

if icc -c99 -DHAVE_CONFIG_H -I. -I. -I..      -MT argp-parse.o -MD -MP -MF ".deps/argp-parse.Tpo" -c -o argp-parse.o argp-parse.c; \

   then mv -f ".deps/argp-parse.Tpo" ".deps/argp-parse.Po"; else rm -f ".deps/argp-parse.Tpo"; exit 1; fi

icc: command line remark #10010: option '-c99' is deprecated and will be removed in a future release. See '-help deprecated'

icc: command line remark #10010: option '-c99' is deprecated and will be removed in a future release. See '-help deprecated'

/usr/include/gentoo-multilib/amd64/limits.h(125): catastrophic error: could not open source file "limits.h"

  # include_next <limits.h>

                           ^

compilation aborted for argp-eexst.c (code 4)

/usr/include/gentoo-multilib/amd64/limits.h(125): catastrophic error: could not open source file "limits.h"

  # include_next <limits.h>

                           ^

compilation aborted for argp-help.c (code 4)

make[3]: *** [argp-eexst.o] Error 1

make[3]: *** Waiting for unfinished jobs....

make[3]: *** [argp-help.o] Error 1

/usr/include/gentoo-multilib/amd64/limits.h(125): catastrophic error: could not open source file "limits.h"

  # include_next <limits.h>

                           ^

compilation aborted for argp-parse.c (code 4)

make[3]: *** [argp-parse.o] Error 1

make[3]: Leaving directory `/var/tmp/portage/app-arch/cpio-2.9-r1/work/cpio-2.9/lib'

make[2]: *** [all] Error 2

make[2]: Leaving directory `/var/tmp/portage/app-arch/cpio-2.9-r1/work/cpio-2.9/lib'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/app-arch/cpio-2.9-r1/work/cpio-2.9'

make: *** [all] Error 2

```

It seems as if the headers from sys-libs/glibc are used instead of the ones found in /opt/intel/cce/10.1.012/include/. I've tried compiling with different combination of flags, such as '-O2 -xT -gcc' which all yield the same result. I'm using amd64.

Any hint/help[/quote] would be greatly appreciated!

----------

## mattst88

I experienced this problem for the first time today on my laptop. I can compile the same ebuild on my server with no problems.

I'll investigate and see if I can find a solution.

----------

## kaethorn

OK, I found out how to get around the error. I've recently compiled gcc-4.3 (4.3.0-pre20080302 to be precise) from the dirtyepic overlay and set it as the default compiler. Setting it back to 4.2.3 did the trick:

```

gcc-config x86_64-pc-linux-gnu-4.2.3

```

But there's another issue I noticed regarding your /etc/portage/bashrc. It seems to break compilation of app-crypt/gnupg (using gcc), most similar to what this post reports. Temporarily replacing the icc bashrc with the original one seems to take care of the problem.

----------

## mattst88

This is odd.

My laptop cannot compile php which includes limits.h with icc. I'm using gcc-4.2.3 (no multislot), icc-10.1.012. No other versions of either compiler are installed.

My server can compile php with icc. Here, I'm using gcc-4.1.2 (no multislot), and icc-10.1.012. No other versions of either compiler are installed.

What could be going on?

----------

## mattst88

It appears to me that AMD64 systems are effected by the limits.h mess. My Core 2 Duo laptop, my AMD64 Sempron desktop, and your AMD64 box exhibit this behaviour while my 32-bit x86 server does not.

----------

## richardpku

Add '-fno-builtin' to CFLAGS and they will compile.

Probably it's a bug of ICC. I have also encountered packages that don't compile unless ipo is disabled.

 *deno wrote:*   

> Here faac fails with error:
> 
> ```
> icc -O2 -xP -gcc -o .libs/faac main.o input.o  ../libfaac/.libs/libfaac.so -lm /usr/lib/libmp4v2.so -ldl
> 
> ...

 

----------

## deno

You meant ICCCFLAGS, thanks for reply, I'll try it.

----------

## AzraelNewtype

I'm having a particularly bizarre problem with icc since installing using the wiki.  Occasionally, programs not listed in /etc/portage/package.icc are getting compiled with icc, sometimes only certain lines of the make process.  What's worse though is that it isn't picking up the ICCCFLAGS with the change of compiler, so these compilations break as soon as the switch happens.  The last one I noticed it with is subversion, but the error is a little burried so I'll show the output of samba instead:

```

icc -pthread -fno-strict-aliasing -O2 -march=native -fomit-frame-pointer -pipe -D_SAMBA_BUILD_=3 -fPIC -I/usr/include/python2.5 -c -I/usr/include/python2.5 -c python/py_spoolss.c -o build/temp.linux-i686-2.5/python/py_spoolss.o -O2 -march=native -fomit-frame-pointer -pipe -D_SAMBA_BUILD_=3 -DHAVE_CONFIG_H -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DLDAP_DEPRECATED -O2 -march=native -fomit-frame-pointer -pipe -D_SAMBA_BUILD_=3 -I/var/tmp/portage/net-fs/samba-3.0.30/work/samba-3.0.30/source/iniparser/src -Iinclude -I./include -I. -I. -I./lib/replace -I./lib/talloc -I./tdb/include -I./libaddns -I./librpc -DHAVE_CONFIG_H -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DLDAP_DEPRECATED -I/var/tmp/portage/net-fs/samba-3.0.30/work/samba-3.0.30/source/lib -D_SAMBA_BUILD_=3

icc: command line error: invalid argument for option '-m'

error: command 'icc' failed with exit status 1

make: *** [python_ext] Error 1

```

And just to confirm:

```

$ grep CFLA /etc/make.conf 

CFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"

CXXFLAGS="${CFLAGS}"

ICCCFLAGS="-O2 -xT -ip -gcc"

ICCCXXFLAGS="${ICCCFLAGS}"

```

Clearly this is mixing and matching for no reason I can readily discern.  Has anyone else encountered this?

----------

## deno

Yup. It's because of python. I have recompiled it with gcc and subversion compiled then.

----------

## mattst88

 *richardpku wrote:*   

> Add '-fno-builtin' to CFLAGS and they will compile.

 

Thank you very much for finding this. I'll add it to the wiki.

Edit: upon testing with php-5.2.6-r1, this does not appear to work.

----------

## Desperadoss

 *|mattst88| wrote:*   

> I've rewritten Gentoo-Wiki's HOWTO on using the Intel C++ Compiler.
> 
> http://gentoo-wiki.com/HOWTO_Intel_C_Compiler
> 
> The old guide was terribly written and horribly messy.
> ...

 

Really Thanx !

----------

## mattst88

To fix the limits.h bug, update to icc-10.1.017. I've already filed a version bump request in bugzilla.

----------

## drakhain

 *|mattst88| wrote:*   

> To fix the limits.h bug, update to icc-10.1.017. I've already filed a version bump request in bugzilla.

 

Hello,

I've installed Gentoo 64 on my XPS M1710 with icc 10.1.17 and i'm still having problem with that limits.h. Since i'm not able to compile blender from the portage tree ( the method explained with bashrc and package.icc/gcc didn't worked for me, meaning that whatever is in those files it is being compiled with icc all the time) i've downloaded the source from blender.org.

Can someone help me compiling blender 2.46 with Icc please?

----------

## mattst88

 *drakhain wrote:*   

>  *|mattst88| wrote:*   To fix the limits.h bug, update to icc-10.1.017. I've already filed a version bump request in bugzilla. 
> 
> Hello,
> 
> I've installed Gentoo 64 on my XPS M1710 with icc 10.1.17 and i'm still having problem with that limits.h. Since i'm not able to compile blender from the portage tree ( the method explained with bashrc and package.icc/gcc didn't worked for me, meaning that whatever is in those files it is being compiled with icc all the time) i've downloaded the source from blender.org.
> ...

 

It looks to me like Blender's build system is hardcoded to use gcc.

It cannot be compiled by icc using this guide alone.

----------

## mattst88

Well, crap. By updating to 10.1.017, it fixed the php build on my AMD64 system, but not on my Thinkpad Core2 Duo..  :Confused: 

----------

## drakhain

Yes by default blender is build with gcc. to enable the built to be done with icc i just edited the nan_complile file under the blender2.blabla/source directory. After that i compile it with the make command. I tried to use scons after editing it's files but i had to hardcode icc in it too (even if it has some compiler detection in Sconstruct i wasn't able to use it by doing things like: OCC=icc).

----------

## drakhain

So?, there is no workaround for using icc without being bored by a "can't open limits.h" or "limits.h trying to call himself"?

----------

## mattst88

I haven't found it yet if there is an existing fix.

The icc-10.1.017 readme says php now compiles on AMD64.

icc-10.1.015 will not compile php on either my desktop or my laptop due to the limits.h error.

icc-10.1.017 will compile php on my desktop, but still fails on my laptop due to the limits.h error.

Bizarre.

----------

## drakhain

Ok :s, but is it possible that includes from gcc and include from icc are interfering when icc is parsing the sources?

----------

## mattst88

 *drakhain wrote:*   

> Ok :s, but is it possible that includes from gcc and include from icc are interfering when icc is parsing the sources?

 

It is possible, but I think it is some kind of icc bug.

----------

## brian33x51

Yup I'll verify this is still a problem (10.0.017 x86_64).  I can't compile since one of the headers in one of the libraries I depend on includes this file.

----------

## DDMask

So I did my own dumb benchmark thing, and bzipping a 2GB file on a Pentium-M (Celeron) went from 21 mins to 16.5 minutes with icc, so I'm feeling it's worthwhile for me to recompile a few more items in order to get this clunky laptop running faster. However my Core2Duo running at 2.6Ghz showed a lesser improvement by going from a bzip2 compression time of 30s on a different file to 26s.

Would any of you smarty-pants be willing to throw together a script which could modify /etc/portage/package.gcc based on failures during emerge? Maybe in the meantime a more comprehensive blacklist could be created on the wiki with not just programs that could bork a system, but also packages that will fail with icc 100% of the time. 

The 2% or so gained in speed by using Gentoo is nice I guess, but a gain of >10% is substantial, even if it only applies to some programs.

----------

## mattst88

 *DDMask wrote:*   

> So I did my own dumb benchmark thing, and bzipping a 2GB file on a Pentium-M (Celeron) went from 21 mins to 16.5 minutes with icc, so I'm feeling it's worthwhile for me to recompile a few more items in order to get this clunky laptop running faster. However my Core2Duo running at 2.6Ghz showed a lesser improvement by going from a bzip2 compression time of 30s on a different file to 26s.

 

21 minutes to 16.5 is a speed improvement of 21%. 30 seconds to 26 seconds is still a speed improvement of 13%. Not bad at all. Did you compile bzip2 with -xT -ip -O3 or similar on the Core 2 Duo?

----------

## DDMask

 *|mattst88| wrote:*   

> Did you compile bzip2 with -xT -ip -O3 or similar on the Core 2 Duo?

 

I just used ICCCFLAGS="-O2 -xT -ip -gcc" maybe -O3 would be a better choice.

EDIT: I'm bored so here's my C2D with bzip2 compiled with -O2 -xT -ip -gcc:

real	3m11.639s

user	2m56.118s

sys	0m3.346s

with -O3 -xT -ipo -gcc:

real	3m0.241s

user	2m55.174s

sys	0m2.933s

with gcc, -march=nocona -02 -pipe

real	9m20.463s

user	9m17.525s

sys	0m2.969s

Ummm... that ain't right. 3 tries with gcc and they were all the same. I guess I screwed something up somewhere. Oh well, I'll just go back to an icc build.

----------

## Gregoire

Is someone using icc and bashrcng ?

----------

## jdoe

is there a way to use icc on a per package basis with paludis?

----------

## a.b.

 *jdoe wrote:*   

> is there a way to use icc on a per package basis with paludis?

 

I's amazing. I just have finished a bashrc for paludis and now I see your post   :Very Happy: 

I've uploaded it together with some example config files here: http://ihatenicks.bplaced.net/paludis-bashrc/ Read the config files and the comments in the script for instructions.

I haven't done much testing yet, feedback is welcome.

----------

## Gregoire

Great, I'll emerge paludis this afternoon and I will try this new bashrc  :Smile: 

In the meantime, I am for a few days under x11-base/xorg-server-1.4.2 compiled without debug (which fails with gcc) working great compiled with ICCCFLAGS="-O2 -xT -gcc -mtune=core2".

Also media-video/ffmpeg-20089999 from berkano overlay compil and run very well with  -O3 -xT -gcc -mtune=core2.

Sofar I can't compil mplayer because of my system having freetype-1 and freetype-2 : https://forums.gentoo.org/viewtopic-t-508174-postdays-0-postorder-asc-start-475.html

Great !!!

Thank for all work that have been done  :Smile: 

----------

## steveb

I don't know when I installed ICC and used the unofficial Gentoo wiki to copy the script from there and use it. Anyway... after some time I started to modify the script from there. One bit there, another bit there. This is what I use now:

```
##

## Set which compiler to favorize

##

primary_compiler="gcc"

secondary_compiler="icc"

###########################################################

##

## DO NOT CONFIGURE ANYTHING BELOW THIS LINE

##

###########################################################

##

## Try to exit as fast as needed

##

[ -z "${CATEGORY}" -o -z "${PN}" ] && return 0

[ "${primary_compiler}" == "gcc" -a -z "${secondary_compiler}" ] && secondary_compiler="icc"

[ "${primary_compiler}" == "icc" -a -z "${secondary_compiler}" ] && secondary_compiler="gcc"

[ "${secondary_compiler}" != "" -a ! -r "${ROOT}"/etc/portage/package.${secondary_compiler} ] && secondary_compiler=""

[ "${secondary_compiler}" == "" -a ! -r "${ROOT}"/etc/portage/package.${primary_compiler} ] && return 0

handled_by_primary=0

handled_by_secondary=0

##

## Function for exporting CFLAGS

##

export_CFLAGS() {

  local compiler="gcc"

  [ "${@}" == "icc" ] && compiler="icc"

  if [ -r "${ROOT}"/etc/portage/package.${compiler}-cflags ]

  then

    while read target cflags

    do

      if [ "${target}" == "${CATEGORY}/${PN}" ]

      then

        export CFLAGS="${cflags}"

        break

      fi

    done < "${ROOT}"/etc/portage/package.${compiler}-cflags

  fi

}

##

## Function for exporting CXXFLAGS

##

export_CXXFLAGS() {

  local compiler="gcc"

  [ "${@}" == "icc" ] && compiler="icc"

  if [ -r "${ROOT}"/etc/portage/package.${compiler}-cxxflags ]

  then

    while read target cxxflags

    do

      if [ "${target}" == "${CATEGORY}/${PN}" ]

      then

        export CXXFLAGS="${cxxflags}"

        break

      fi

    done < "${ROOT}"/etc/portage/package.${compiler}-cxxflags

  fi

}

##

## Function for exporting LDFLAGS

##

export_LDFLAGS() {

  local compiler="gcc"

  [ "${@}" == "icc" ] && compiler="icc"

  if [ -r "${ROOT}"/etc/portage/package.${compiler}-ldflags ]

  then

    while read target ldflags

    do

      if [ "${target}" == "${CATEGORY}/${PN}" ]

      then

        export LDFLAGS="${ldflags}"

        break

      fi

    done < "${ROOT}"/etc/portage/package.${compiler}-ldflags

  fi

}

##

## Check if primary compiler will handle the package

##

if [ -r "${ROOT}"/etc/portage/package.${primary_compiler} ]

then

  while read -a target

  do

    if [ "${target}" == "${CATEGORY}/${PN}" ]

    then

      handled_by_primary=1

      if [ "${primary_compiler}" == "icc" ]

      then

        export OCC="icc"

        export OCXX="icpc"

        #export F77="ifort"

        #export FC="ifort"

        export CFLAGS=${ICCCFLAGS}

        export CXXFLAGS=${ICCCXXFLAGS}

        export LDFLAGS=${ICCLDFLAGS}

      fi

      export_CFLAGS ${primary_compiler}

      export CXXFLAGS="${CFLAGS}"

      export_CXXFLAGS ${primary_compiler}

      export_LDFLAGS ${primary_compiler}

      break

    fi

  done < "${ROOT}"/etc/portage/package.${primary_compiler}

fi

##

## Check if secondary compiler should handle the package

##

if [ "${handled_by_primary}" == "0" -a "${secondary_compiler}" != "" -a -r "${ROOT}"/etc/portage/package.${secondary_compiler} ]

then

  while read -a target

  do

    if [ "${target}" == "${CATEGORY}/${PN}" ]

    then

      handled_by_secondary=1

      if [ "${secondary_compiler}" == "icc" ]

      then

        export OCC="icc"

        export OCXX="icpc"

        #export F77="ifort"

        #export FC="ifort"

        export CFLAGS=${ICCCFLAGS}

        export CXXFLAGS=${ICCCXXFLAGS}

        export LDFLAGS=${ICCLDFLAGS}

      fi

      export_CFLAGS ${secondary_compiler}

      export CXXFLAGS="${CFLAGS}"

      export_CXXFLAGS ${secondary_compiler}

      export_LDFLAGS ${secondary_compiler}

      break

    fi

  done < "${ROOT}"/etc/portage/package.${secondary_compiler}

fi

##

## System compiler will handle the package

##

[ "${handled_by_primary}" == "0" -a "${handled_by_secondary}" == "0" ] && return 0

##

## workaround gcc detection function in toolchain-funcs.eclass

##

if [ "${OCC}" != "" ]

then

  export CC_FOR_BUILD="${OCC}"

fi
```

I have another one but that one is not 100% finished and working the way I would like it to work. Anyway... maybe some one will find this one more flexible then the one in the unofficial Gentoo wiki? It works +/- the same way as the one in the unofficial Gentoo wiki except that it allows you as well to use different flags for the C++ compiler (/etc/portage/package.{gcc,icc}-cxxflags) and if needed LDFLAGS (/etc/portage/package.{gcc,icc}-ldflags). The CFLAGS can be specified in /etc/portage/package.{gcc,icc}-cflags. If no C++ flags are specified, then the script will use the one specified for the C compiler. Some stuff looks freaky but I tried to avoid running into problems by using external programs like sed, awk, grep, etc...

// SteveB

----------

## tranquilcool

 *steveb wrote:*   

> I don't know when I installed ICC and used the unofficial Gentoo wiki to copy the script from there and use it. Anyway... after some time I started to modify the script from there. One bit there, another bit there. This is what I use now:
> 
> ```
> ##
> 
> ...

 

what is this script? is it bashrc to put in /etc/portage?

i don't understand where you put or how you use this script.

----------

## steveb

 *tranquilcool wrote:*   

> what is this script? is it bashrc to put in /etc/portage?

 Yes. It is a bashrc for Portage.

 *tranquilcool wrote:*   

> i don't understand where you put or how you use this script.

 Read the unofficial Gentoo wiki article Intel C++ Compiler how to use it.

// SteveB

----------

## a.b.

 *Gregoire wrote:*   

> Great, I'll emerge paludis this afternoon and I will try this new bashrc 

 

It should actually work with portage as well, though it's kinda untested and portage complains about the fact I've used sed. 

 *Quote:*   

> Thank for all work that have been done 

 

My pleasure.  :Smile: Last edited by a.b. on Thu Sep 04, 2008 11:57 pm; edited 2 times in total

----------

## steveb

 *a.b. wrote:*   

> ... and portage complains about the fact I've used sed.

 That's the reason I tried to avoid external programs in my bashrc above.

// SteveB

----------

## a.b.

The fact portage complains about the usage of external programs in the bashrc seems like a bug to me. Ebuilds aren't supposed to use anything other than bash code but I see no actual reason to restrict that in a configuration file.

----------

## steveb

 *a.b. wrote:*   

> The fact portage complains about the usage of external programs in the bashrc seems like a bug to me. Ebuilds aren't supposed to use anything other than bash code but I see no actual reason to restrict that in a configuration file.

 Wrong. If you ever have build Gentoo for an embedded system, then you will see that bash is not the number one choice for an shell. So stuff like:

```
function debug(){

  if [[ -n "$debug" && "$debug" == "1" ]]; then

    echo "$(date +%T) $1" >> /tmp/pbshrc-test

  fi

}
```

Will not work. What is the reason you use "[[" ... "]]"? Would it not be better and more portable to use (untested but I think it should work):

```
function debug(){

  if [ -n "${debug}" -a "${debug}" == "1" ]; then

    echo "$(date +%T) ${1}" >> /tmp/pbshrc-test

  fi

}
```

And stuff like this:

```
  while read atom data; do

    data="$(echo $data | sed -e 's/#.*//')"   #Strip comments

      if matchatom "$atom"; then

        if [ $append -eq 0 ]; then       

          ret="$data"

        else

          ret="$ret $data"

        fi

      fi

  done < $1
```

Could be replaced by this (untested but I think it should work. It should be even faster since calling the replace (in your code it is a call to GNU sed) is only done when needed):

```
  while read atom data; do

      if matchatom "${atom}"; then

        if [ ${append} -eq 0 ]; then       

          ret="${data%%#*}"

        else

          ret="${ret} ${data%%#*}"

        fi

      fi

  done < ${1}
```

// SteveB

----------

## a.b.

 *steveb wrote:*   

>  *a.b. wrote:*   The fact portage complains about the usage of external programs in the bashrc seems like a bug to me. Ebuilds aren't supposed to use anything other than bash code but I see no actual reason to restrict that in a configuration file. Wrong. If you ever have build Gentoo for an embedded system, then you will see that bash is not the number one choice for an shell. [...]
> 
> 

 

Honestly, I haven't even thought about the possibility that a bashrc might be sourced by anything other than bash so I didn't think about that while writing.

And in at least one place, I could replace use bash's '=~' operator to replace an ugly "cat | grep" construct which I find much worse. 

 *Quote:*   

> 
> 
> And stuff like this:
> 
> ```
> ...

 

If I had knew that possibility exists, I'd have used it (And I'm going to use it as of know, of course). Does that kind of expression have a name I can google for?

----------

## steveb

 *a.b. wrote:*   

> Does that kind of expression have a name I can google for?

 To be honest: I don't know how this is called.

// SteveB

----------

## Gregoire

About the "Could not open source file limits.h" problem :

I can't compil lots of package using icc if gcc-config is set to x86_64-pc-linux-gnu-4.3.1 : it fails with the limits.h error.

If I set it to x86_64-pc-linux-gnu-4.2.4 then it compils fine.

Any idea what could solve the compilation using the version 4.3.1 even if that's not the compiler being used ?

EDIT :

I can't compil packages depending on freetype, for example mplayer/xine :

```

if /bin/sh ../../libtool --tag=CC --mode=compile /opt/intel/cce/10.1.018/bin/icc -DHAVE_CONFIG_H -I. -I. -I../../include -I../.. -I../../include -I../../include -I../../src -I../../src/xine-engine -I../../src/xine-engine -I../../src/xine-utils  -I../../src/input -I../../src/input  -I../../lib -I../../lib -I../../contrib/libxdg-basedir  -DXINE_LIBRARY_COMPILE -DNDEBUG -D_REENTRANT -DXINE_COMPILE   -O3  -ffast-math -fexpensive-optimizations  -I/usr/include -I/usr/include/freetype2     -fvisibility=hidden   -pipe  -Wall -Wformat=2 -Wno-format-zero-length -Wmissing-format-attribute -Werror-implicit-function-declaration -Wstrict-aliasing=2 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wpointer-arith -g -O3 -gcc -xT -mtune=core2 -MT spu.lo -MD -MP -MF ".deps/spu.Tpo" -c -o spu.lo spu.c; \

        then mv -f ".deps/spu.Tpo" ".deps/spu.Plo"; else rm -f ".deps/spu.Tpo"; exit 1; fi

libtool: compile:  /opt/intel/cce/10.1.018/bin/icc -DHAVE_CONFIG_H -I. -I. -I../../include -I../.. -I../../include -I../../include -I../../src -I../../src/xine-engine -I../../src/xine-engine -I../../src/xine-utils -I../../src/input -I../../src/input -I../../lib -I../../lib -I../../contrib/libxdg-basedir -DXINE_LIBRARY_COMPILE -DNDEBUG -D_REENTRANT -DXINE_COMPILE -O3 -ffast-math -fexpensive-optimizations -I/usr/include -I/usr/include/freetype2 -fvisibility=hidden -pipe -Wall -Wformat=2 -Wno-format-zero-length -Wmissing-format-attribute -Werror-implicit-function-declaration -Wstrict-aliasing=2 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wpointer-arith -g -O3 -gcc -xT -mtune=core2 -MT spu.lo -MD -MP -MF .deps/spu.Tpo -c spu.c  -fPIC -DPIC -o .libs/spu.o

icc: command line warning #10006: ignoring unknown option '-ffast-math'

icc: command line warning #10006: ignoring unknown option '-fexpensive-optimizations'

icc: command line warning #10156: ignoring option '-W'; no argument required

icc: command line warning #10156: ignoring option '-W'; no argument required

icc: command line warning #10156: ignoring option '-W'; no argument required

icc: command line warning #10156: ignoring option '-W'; no argument required

icc: command line warning #10156: ignoring option '-W'; no argument required

icc: command line warning #10156: ignoring option '-W'; no argument required

/usr/include/freetype/freetype.h(27): catastrophic error: #error directive: "This is freetype.h of FreeType 1!"

  #error "This is freetype.h of FreeType 1!"

```

I can't remove freetype-1 because it's needed for texlive.

I used this script to compil xine :

```

#!/bin/bash

source /etc/make.conf

export CC="icc"

export CXX="cpc"

export CFLAGS="-O3 -xT -gcc -mtune=core2"

export CXXFLAGS="-O3 -xT -gcc -mtune=core2"

p=/data/linux/dvb/patches/xine/xine-lib.patch

MAKE='sudo nice -n 4 make -j3'

OPTIONS="show update dry-run apply undry-run  unapply compile log exit"

select opt in $OPTIONS; do

        if [ "$opt" = "show" ]; then

                vi $p

        elif [ "$opt" = "update" ]; then

                hg pull -u http://hg.debian.org/hg/xine-lib/xine-lib-1.2/

        elif [ "$opt" = "dry-run" ]; then

                patch --dry-run -p1 < $p

        elif [ "$opt" = "apply" ]; then

                patch -p1 < $p

        elif [ "$opt" = "undry-run" ]; then

                patch --dry-run -p1 -R < $p

        elif [ "$opt" = "unapply" ]; then

                patch -p1 -R < $p

        elif [ "$opt" = "compile" ]; then

                sudo ./autogen.sh --disable-dxr3 --enable-opengl --enable-v4l \

                --enable-glu --enable-dvb --prefix=/usr CC="/opt/intel/cce/10.1.018/bin/icc" \

                CFLAGS="-O3 -gcc -xT -mtune=core2" --build=x86_64-linux-gnu \

                --with-alsa --with-external-ffmpeg --with-fontconfig \

                --with-freetype --with-x --with-xv-path=/usr/X11R6/lib \

                --x-includes=/usr/include && $MAKE && $MAKE install && \

                sudo rm -fr /usr/lib/xine && $MAKE install && $MAKE distclean

        elif [ "$opt" = "log" ]; then

                hg log|less

        elif [ "$opt" = "exit" ]; then

                exit

        else   

                echo bad option

        fi

done

```

Should I change anything ?

Thanks.

----------

## tranquilcool

 *a.b. wrote:*   

>  *jdoe wrote:*   is there a way to use icc on a per package basis with paludis? 
> 
> I's amazing. I just have finished a bashrc for paludis and now I see your post  
> 
> I've uploaded it together with some example config files here: http://ihatenicks.bplaced.net/paludis-bashrc/ Read the config files and the comments in the script for instructions.
> ...

 

doesn't work for me.

anything i compile with paludis/icc errors with;

configure: error: C compiler cannot create executables

----------

## a.b.

With which CFLAGS did that happen? I had that problem after adding "-idirafter /usr/include/linux", it seems to work if I put it in icc.cfg.

----------

## tranquilcool

 *a.b. wrote:*   

> With which CFLAGS did that happen? I had that problem after adding "-idirafter /usr/include/linux", it seems to work if I put it in icc.cfg.

 

iccflags;

*/*      -O3 -xP -ip  -gcc

cflags;

*/*      -mtune=prescott -march=prescott -O2 -mfpmath=sse -msse3 -ftracer -funit-at-a-time -fomit-frame-pointer -frename-registers -ftree-vectorize -pipe

with emerge ruby compiles fine with the same iccflags.

----------

## a.b.

Please add temporary

```
die "$CC | $CXX | $CFLAGS | $CXXFLAGS | $LDFLAGS"
```

At the end of bashrc and post the error message.

Also check if you have version 0.2, you can see which version you have at the top of the script. If not, get it (bplaced seems to be down, direct link)

----------

## tranquilcool

 *a.b. wrote:*   

> Please add temporary
> 
> ```
> die "$CC | $CXX | $CFLAGS | $CXXFLAGS | $LDFLAGS"
> ```
> ...

 

snip end of bashrc;

# Set LDFLAGS

if test -z "$LDFLAGS"; then

        LDFLAGS="$(append=1 parseconfig $etc/ldflags.conf)" || die "error setting LDFLAGS"

fi

die "$CC | $CXX | $CFLAGS | $CXXFLAGS | $LDFLAGS"

errors;

Directory '/usr/portage/distfiles' owned by group 'portage', not 'paludisbuild', so cannot enable userpriv                                                                          

!!! ERROR in dev-lang/ruby-1.8.6_p287-r1:

!!! In /usr/libexec/paludis/ebuild.bash at line 107

!!! icc | icpc | -O2 -march=i686 -pipe | -O2 -march=i686 -pipe | -Wl,-O1

!!! Call stack:

!!!    * source (/etc/paludis/bashrc:107)

!!!    * main (/usr/libexec/paludis/ebuild.bash:212)

diefunc: making ebuild PID 13898 exit with error

die trap: exiting with error.

 am using version 0.2

----------

## a.b.

It fails to set any CFLAGS and tries to use the defaults, that's probably why icc fails. The question is why.

Create a debug log with.:

```
export debug=1

paludis -i ruby
```

Then post/paste all *.conf files that belong to bashrc as well as /tmp/pbshrc-test.

----------

## tranquilcool

 *a.b. wrote:*   

> It fails to set any CFLAGS and tries to use the defaults, that's probably why icc fails. The question is why.
> 
> Create a debug log with.:
> 
> ```
> ...

 

 cat work/ruby-1.8.6-p287/config.log                  

This file contains any messages produced by compilers while                             

running configure, to aid debugging if configure makes a mistake.                       

It was created by configure, which was

generated by GNU Autoconf 2.61.  Invocation command line was

  $ ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --program-suffix=18 --enable-shared --enable-socks --disable-install-doc --disable-pthread --enable-ipv6 --disable-debug --with-dbm --with-gdbm --with-openssl --without-tk --with-sitedir=/usr/lib/ruby/site_ruby --build=i686-pc-linux-gnu                                                            

## --------- ##

## Platform. ##

## --------- ##

hostname = xxxx

uname -m = i686

uname -r = 2.6.27-rc5-zen3

uname -s = Linux          

uname -v = #1 SMP PREEMPT Tue Sep 9 17:46:51 CEST 2008

/usr/bin/uname -p = Intel(R) Pentium(R) 4 CPU 3.20GHz

/bin/uname -X     = unknown                          

/bin/arch              = unknown

/usr/bin/arch -k       = unknown

/usr/convex/getsysinfo = unknown

/usr/bin/hostinfo      = unknown

/bin/machine           = unknown

/usr/bin/oslevel       = unknown

/bin/universe          = unknown

PATH: /usr/libexec/paludis/utils

PATH: /sbin                     

PATH: /bin                      

PATH: /usr/sbin                 

PATH: /usr/bin                  

PATH: /bin                      

PATH: /sbin                     

PATH: /usr/bin                  

PATH: /usr/sbin                 

## ----------- ##

## Core tests. ##

## ----------- ##

configure:1892: checking build system type

configure:1910: result: i686-pc-linux-gnu 

configure:1932: checking host system type 

configure:1947: result: i686-pc-linux-gnu 

configure:1969: checking target system type

configure:1984: result: i686-pc-linux-gnu  

configure:2205: checking for i686-pc-linux-gnu-gcc

configure:2232: result: icc                       

configure:2510: checking for C compiler version   

configure:2517: icc --version >&5                 

./configure: line 2518: icc: command not found    

configure:2520: $? = 127                          

configure:2527: icc -v >&5                        

./configure: line 2528: icc: command not found    

configure:2530: $? = 127                          

configure:2537: icc -V >&5                        

./configure: line 2538: icc: command not found    

configure:2540: $? = 127                          

configure:2563: checking for C compiler default output file name

configure:2590: icc -O2 -march=i686 -pipe -fno-strict-aliasing  -Wl,-O1 conftest.c  >&5

./configure: line 2591: icc: command not found                                         

configure:2593: $? = 127                                                               

configure:2631: result:                                                                

configure: failed program was:                                                         

| /* confdefs.h.  */                                                                   

| #define PACKAGE_NAME ""                                                              

| #define PACKAGE_TARNAME ""                                                           

| #define PACKAGE_VERSION ""                                                           

| #define PACKAGE_STRING ""                                                            

| #define PACKAGE_BUGREPORT ""                                                         

| #define USE_BUILTIN_FRAME_ADDRESS 1                                                  

| /* end confdefs.h.  */                                                               

|                                                                                      

| int                                                                                  

| main ()                                                                              

| {                                                                                    

|                                                                                      

|   ;                                                                                  

|   return 0;                                                                          

| }                                                                                    

configure:2638: error: C compiler cannot create executables                            

See `config.log' for more details.                                                     

## ---------------- ##

## Cache variables. ##

## ---------------- ##

ac_cv_build=i686-pc-linux-gnu

ac_cv_env_CC_set=set         

ac_cv_env_CC_value=icc       

ac_cv_env_CFLAGS_set=set     

ac_cv_env_CFLAGS_value='-O2 -march=i686 -pipe -fno-strict-aliasing'

ac_cv_env_CPPFLAGS_set=set                                         

ac_cv_env_CPPFLAGS_value=                                          

ac_cv_env_CPP_set=                                                 

ac_cv_env_CPP_value=                                               

ac_cv_env_LDFLAGS_set=set                                          

ac_cv_env_LDFLAGS_value=-Wl,-O1                                    

ac_cv_env_LIBS_set=                                                

ac_cv_env_LIBS_value=                                              

ac_cv_env_YACC_set=                                                

ac_cv_env_YACC_value=                                              

ac_cv_env_YFLAGS_set=                                              

ac_cv_env_YFLAGS_value=                                            

ac_cv_env_build_alias_set=set                                      

ac_cv_env_build_alias_value=i686-pc-linux-gnu                      

ac_cv_env_host_alias_set=set                                       

ac_cv_env_host_alias_value=i686-pc-linux-gnu                       

ac_cv_env_target_alias_set=                                        

ac_cv_env_target_alias_value=                                      

ac_cv_host=i686-pc-linux-gnu                                       

ac_cv_prog_CC=icc                                                  

ac_cv_target=i686-pc-linux-gnu                                     

## ----------------- ##

## Output variables. ##

## ----------------- ##

ALLOCA=''

AR=''    

ARCHFILE=''

ARCH_FLAG=''

AS=''       

ASFLAGS=''  

CC='icc'    

CCDLFLAGS=''

CFLAGS='-O2 -march=i686 -pipe -fno-strict-aliasing'

COMMON_HEADERS=''                                  

COMMON_LIBS=''                                     

COMMON_MACROS=''                                   

CP=''                                              

CPP=''                                             

CPPFLAGS=''                                        

CPPOUTFILE=''                                      

DEFS=''                                            

DLDFLAGS=''                                        

DLDLIBS=''                                         

DLEXT2=''                                          

DLEXT=''                                           

DLLWRAP=''                                         

ECHO_C=''                                          

ECHO_N='-n'                                        

ECHO_T=''                                          

EGREP=''                                           

ENABLE_SHARED=''                                   

EXEEXT=''                                          

EXPORT_PREFIX=''                                   

EXTOUT=''                                          

EXTSTATIC=''                                       

GNU_LD=''                                          

GREP=''                                            

INSTALL_DATA=''                                    

INSTALL_PROGRAM=''                                 

INSTALL_SCRIPT=''                                  

LDFLAGS='-Wl,-O1'                                  

LDSHARED=''                                        

LIBEXT=''                                          

LIBOBJS=''                                         

LIBPATHENV=''                                      

LIBPATHFLAG=''                                     

LIBRUBY=''                                         

LIBRUBYARG=''                                      

LIBRUBYARG_SHARED=''                               

LIBRUBYARG_STATIC=''                               

LIBRUBY_A=''                                       

LIBRUBY_ALIASES=''                                 

LIBRUBY_DLDFLAGS=''                                

LIBRUBY_LDSHARED=''                                

LIBRUBY_SO=''                                      

LIBS=''                                            

LINK_SO=''                                         

LN_S=''                                            

LTLIBOBJS=''                                       

MAINLIBS=''                                        

MAJOR='1'                                          

MAKEDIRS=''                                        

MAKEFILES=''                                       

MANTYPE=''                                         

MINIOBJS=''                                        

MINIRUBY=''                                        

MINOR='8'                                          

NM=''                                              

NROFF=''                                           

OBJDUMP=''                                         

OBJEXT=''                                          

OUTFLAG=''                                         

PACKAGE_BUGREPORT=''                               

PACKAGE_NAME=''                                    

PACKAGE_STRING=''                                  

PACKAGE_TARNAME=''                                 

PACKAGE_VERSION=''                                 

PATH_SEPARATOR=':'                                 

PREP=''                                            

RANLIB=''                                          

RDOCTARGET=''                                      

RM=''                                              

RPATHFLAG=''                                       

RUBYW_INSTALL_NAME=''                              

RUBY_INSTALL_NAME=''                               

RUBY_SO_NAME=''                                    

RUNRUBY=''                                         

SET_MAKE=''                                        

SHELL='/bin/sh'                                    

SOLIBS=''                                          

STATIC=''                                          

STRIP=''                                           

TEENY='6'                                          

TRY_LINK=''                                        

WINDRES=''                                         

XCFLAGS=''                                         

XLDFLAGS=''                                        

YACC=''                                            

YFLAGS=''                                          

ac_ct_CC=''                                        

arch=''                                            

bindir='${exec_prefix}/bin'                        

build='i686-pc-linux-gnu'                          

build_alias='i686-pc-linux-gnu'                    

build_cpu='i686'                                   

build_os='linux-gnu'                               

build_vendor='pc'                                  

configure_args=''                                  

datadir='/usr/share'                               

datarootdir='${prefix}/share'                      

docdir='${datarootdir}/doc/${PACKAGE}'             

dvidir='${docdir}'                                 

exec_prefix='NONE'                                 

host='i686-pc-linux-gnu'                           

host_alias='i686-pc-linux-gnu'                     

host_cpu='i686'                                    

host_os='linux-gnu'                                

host_vendor='pc'                                   

htmldir='${docdir}'                                

includedir='${prefix}/include'                     

infodir='/usr/share/info'                          

libdir='${exec_prefix}/lib'                        

libexecdir='${exec_prefix}/libexec'                

localedir='${datarootdir}/locale'                  

localstatedir='/var/lib'                           

mandir='/usr/share/man'                            

oldincludedir='/usr/include'                       

pdfdir='${docdir}'                                 

prefix='/usr'                                      

program_transform_name='s&$$&18&;s&^&&'            

psdir='${docdir}'

rubyw_install_name=''

sbindir='${exec_prefix}/sbin'

setup=''

sharedstatedir='${prefix}/com'

sitearch=''

sitedir=''

sysconfdir='/etc'

target='i686-pc-linux-gnu'

target_alias=''

target_cpu='i686'

target_os='linux'

target_vendor='pc'

## ----------- ##

## confdefs.h. ##

## ----------- ##

#define PACKAGE_NAME ""

#define PACKAGE_TARNAME ""

#define PACKAGE_VERSION ""

#define PACKAGE_STRING ""

#define PACKAGE_BUGREPORT ""

#define USE_BUILTIN_FRAME_ADDRESS 1

configure: exit 77

yes it uses defaul cflags.

----------

## a.b.

Thanks, but that's not what I asked for...

Anyway, I really must go to bed now so I can't help you before tomorrow.Last edited by a.b. on Thu Sep 11, 2008 10:03 pm; edited 1 time in total

----------

## tranquilcool

 *a.b. wrote:*   

> Thanks, but that's not what I asked for...

 

i know but you were kinda cryptic to me.

i don't know the all *.conf you are talking about , at least where they are located.

ok thanks.

----------

## a.b.

 *tranquilcool wrote:*   

>  *a.b. wrote:*   Thanks, but that's not what I asked for... 
> 
> i know but you were kinda cryptic to me.
> 
> i don't know the all *.conf you are talking about , at least where they are located.

 

I need:

- /etc/paludis/

          - cc.conf

          - iccflags.conf

          - iccxxflags.conf

          - gccflags.conf

          - gccxxflags.conf

- /tmp/pbshrc-test

----------

## tranquilcool

 *a.b. wrote:*   

>  *tranquilcool wrote:*    *a.b. wrote:*   Thanks, but that's not what I asked for... 
> 
> i know but you were kinda cryptic to me.
> 
> i don't know the all *.conf you are talking about , at least where they are located. 
> ...

 

iccflags.conf;

*/*      -O3 -xP -ip -w -gcc

cc.conf;

*/*             gcc     #Use gcc by default     

# These packages have been reported to work with ICC (Source: gentoo-wiki.com)

dev-lang/python         icc                                                   

dev-db/sqlite           icc                                                   

dev-libs/libxml2        icc                                                   

app-arch/tar            icc                                                   

app-arch/bzip2          icc                                                   

app-arch/gzip           icc                                                   

app-arch/unzip          icc                                                   

app-arch/cpio           icc                                                   

sys-power/powertop      icc                                                   

media-libs/x264-svn     icc                                                   

media-sound/lame        icc                                                   

media-libs/faac         icc                                                   

media-libs/giflib       icc                                                   

media-libs/speex        icc                                                   

media-libs/libtheora    icc                                                   

media-libs/xvid         icc                                                   

media-libs/libogg       icc                                                   

media-libs/libvorbis    icc                                                   

dev-libs/lzo            icc                                                   

net-irc/xchat           icc                                                   

media-libs/freetype     icc                                                   

dev-libs/glib           icc                                                   

x11-libs/gtk+           icc                                                   

media-libs/libpng       icc                                                   

dev-libs/libgpg-error   icc

media-gfx/gimp          icc

app-editors/nano        icc

virtual/postgresql-base icc

dev-lang/ruby           icc

# Critical packages should never be compiled with icc

app-shells/bash         gcc

sys-apps/sed            gcc

sys-devel/binutils      gcc

sys-devel/gcc           gcc

sys-libs/glibc          gcc

sys-libs/ncurses        gcc

sys-libs/libstdc++-v3   gcc

sys-libs/zlib           gcc

sys-process/procps      gcc

# Other packages that don't work with icc

kde-base/*:3.5          gcc

net-irc/konversation    gcc

dev-lang/lua            gcc

app-emulation/virtualbox-modules        gcc

app-emulation/qemu-softemu      gcc

media-sound/audacious           gcc

media-plugins/audacious-plugins gcc

media-sound/audacity    gcc

iccxxflags.conf;

*/*   -fvisibility=hidden -fvisibility-inlines-hidden

gccflags.conf;

*/*      -mtune=prescott -march=prescott -O2 -mfpmath=sse -msse3 -ftracer -funit-at-a-time -fomit-frame-pointer -frename-registers -ftree-vectorize -pipe

gccxxflags.conf;

# place extra gcc CXXFLAGS here, they'll be added to CFLAGS

/tmp/pbshrc-test;

00:10:45 Test: */*

00:10:45 Match 1: */*

00:10:45 Test:       

00:10:45 No Match    

00:10:45 Test: #     

00:10:45 No Match    

00:10:45 Test: dev-lang/python

00:10:45 No Match             

00:10:45 Test: dev-db/sqlite  

00:10:45 No Match             

00:10:45 Test: dev-libs/libxml2

00:10:45 No Match              

00:10:45 Test: app-arch/tar    

00:10:45 No Match              

00:10:45 Test: app-arch/bzip2  

00:10:45 No Match              

00:10:45 Test: app-arch/gzip   

00:10:45 No Match              

00:10:45 Test: app-arch/unzip  

00:10:45 No Match              

00:10:45 Test: app-arch/cpio   

00:10:45 No Match              

00:10:45 Test: sys-power/powertop

00:10:45 No Match                

00:10:45 Test: media-libs/x264-svn

00:10:45 No Match                 

00:10:45 Test: media-sound/lame   

00:10:45 No Match                 

00:10:45 Test: media-libs/faac    

00:10:45 No Match                 

00:10:45 Test: media-libs/giflib  

00:10:45 No Match                 

00:10:45 Test: media-libs/speex   

00:10:45 No Match                 

00:10:45 Test: media-libs/libtheora

00:10:45 No Match                  

00:10:45 Test: media-libs/xvid     

00:10:45 No Match                  

00:10:45 Test: media-libs/libogg   

00:10:45 No Match                  

00:10:45 Test: media-libs/libvorbis

00:10:45 No Match                  

00:10:45 Test: dev-libs/lzo        

00:10:45 No Match                  

00:10:45 Test: net-irc/xchat       

00:10:45 No Match                  

00:10:45 Test: media-libs/freetype 

00:10:45 No Match                  

00:10:45 Test: dev-libs/glib       

00:10:45 No Match                  

00:10:45 Test: x11-libs/gtk+       

00:10:45 No Match                  

00:10:45 Test: media-libs/libpng   

00:10:45 No Match                  

00:10:45 Test: dev-libs/libgpg-error

00:10:45 No Match                   

00:10:45 Test: media-gfx/gimp       

00:10:45 No Match                   

00:10:45 Test: app-editors/nano     

00:10:45 No Match                   

00:10:45 Test: virtual/postgresql-base

00:10:45 No Match                     

00:10:45 Test: dev-lang/ruby          

00:10:45 Match 1: dev-lang/ruby       

00:10:45 Test:                        

00:10:45 No Match                     

00:10:45 Test: #                      

00:10:45 No Match                     

00:10:45 Test: app-shells/bash        

00:10:45 No Match                     

00:10:45 Test: sys-apps/sed           

00:10:45 No Match                     

00:10:45 Test: sys-devel/binutils     

00:10:45 No Match                     

00:10:45 Test: sys-devel/gcc          

00:10:45 No Match                     

00:10:45 Test: sys-libs/glibc         

00:10:45 No Match                     

00:10:45 Test: sys-libs/ncurses       

00:10:45 No Match                     

00:10:45 Test: sys-libs/libstdc++-v3

00:10:45 No Match

00:10:45 Test: sys-libs/zlib

00:10:45 No Match

00:10:45 Test: sys-process/procps

00:10:45 No Match

00:10:45 Test:

00:10:45 No Match

00:10:45 Test: #

00:10:45 No Match

00:10:45 Test: kde-base/*:3.5

00:10:45 No Match

00:10:45 Test: net-irc/konversation

00:10:45 No Match

00:10:45 Test: dev-lang/lua

00:10:46 No Match

00:10:46 Test: app-emulation/virtualbox-modules

00:10:46 No Match

00:10:46 Test: app-emulation/qemu-softemu

00:10:46 No Match

00:10:46 Test: media-sound/audacious

00:10:46 No Match

00:10:46 Test: media-plugins/audacious-plugins

00:10:46 No Match

00:10:46 Test: media-sound/audacity

00:10:46 No Match

ldflags;

*/*     -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common -Wl,--warn-once

i'll let you go to sleep. thanks.

----------

## a.b.

There seem to be two issues. The more fatal one is

 *Quote:*   

> ./configure: line 2518: icc: command not found 

 

Obviously icc isn't in your path, at least it isn't while configure is running. Make sure it is in your normal shell, try env-update. As a workaround, you can put symlinks into /usr/local/bin.

The second problem was a bug, after updating to 0.2.0.1 it should work.

----------

## tranquilcool

 *a.b. wrote:*   

> There seem to be two issues. The more fatal one is
> 
>  *Quote:*   ./configure: line 2518: icc: command not found  
> 
> Obviously icc isn't in your path, at least it isn't while configure is running. Make sure it is in your normal shell, try env-update. As a workaround, you can put symlinks into /usr/local/bin.
> ...

 

yes it's a path problem.

env-update solves it.

thanks.

----------

## a.b.

Don't forget upgrading, otherwise your flags will be extremly sane   :Very Happy: 

----------

## tranquilcool

 *a.b. wrote:*   

> Don't forget upgrading, otherwise your flags will be extremly sane  

 

yes i did.

 i don't want too sane flags.

----------

## tranquilcool

what's the best possible way to solve the env-update issue, if i may ask, without making links?

i just don't like links all over the place.

thanks.

----------

## a.b.

Add /opt/intel/cc/<version>/bin to the path. Actually that should have been done by the ebuild.

----------

## tranquilcool

 *a.b. wrote:*   

> Add /opt/intel/cc/<version>/bin to the path. Actually that should have been done by the ebuild.

 

i have it in;

/etc/env.d/05icc

in  /etc/ld.so.conf

i have;

/opt/intel/cc/10.1.018/lib

isn't it the same thing?

EDIT:

i decided to have /root/.bashrc source /etc/profile to get full path with su.

----------

## a.b.

 *tranquilcool wrote:*   

> 
> 
> /opt/intel/cc/10.1.018/lib
> 
> isn't it the same thing?
> ...

 

Of course not, having */lib in PATH makes no sense.

----------

## tranquilcool

 *a.b. wrote:*   

>  *tranquilcool wrote:*   
> 
> /opt/intel/cc/10.1.018/lib
> 
> isn't it the same thing?
> ...

 

dunno. i wont put bin in /etc/ld.so.conf.

fact is i dont know why paludis finds gcc and not icc untill i do env-update.

that shouldn't be so.

----------

## a.b.

 *tranquilcool wrote:*   

>  *a.b. wrote:*    *tranquilcool wrote:*   
> 
> /opt/intel/cc/10.1.018/lib
> 
> isn't it the same thing?
> ...

 

Sorry, ld.so.conf shouldn't get bin of course.

----------

## jdoe

 *a.b. wrote:*   

>  *jdoe wrote:*   is there a way to use icc on a per package basis with paludis? 
> 
> I's amazing. I just have finished a bashrc for paludis and now I see your post  
> 
> I've uploaded it together with some example config files here: http://ihatenicks.bplaced.net/paludis-bashrc/ Read the config files and the comments in the script for instructions.
> ...

 

thanks for your work (and for the work of the others in the thread too  :Smile: ) 

I'll try you bashrc later.

[edit]: http://ihatenicks.bplaced.net/paludis-bashrc/ seems down  :Sad: 

[edit2]: now is up again  :Smile:  [/edit]

[edit3]: works like a charm. thanks  :Smile:  [/edit]

----------

## steveL

 *steveb wrote:*   

> Wrong. If you ever have build Gentoo for an embedded system, then you will see that bash is not the number one choice for an shell.

 

True, but all ebuilds are in bash, and eclasses in the tree are supposed to be able to rely on bash being available; forcing that to sh compatibility isn't the right way to get embedded builds imo, and only slows down the rest. A serious embedded developer doesn't build on the target ime. The only other use-case I've heard of that could possibly use it, is building for a PDA or a phone, and again I'd much rather see better desktop/host tools for that, than slowing ebuild/eclass devs down. If you really want portable sh, you don't even use [ *a.b. wrote:*   

> Honestly, I haven't even thought about the possibility that a bashrc might be sourced by anything other than bash so I didn't think about that while writing.
> 
> And in at least one place, I could replace use bash's '=~' operator to replace an ugly "cat | grep" construct which I find much worse.

 

That's called a useless use of cat; grep 'foo' file instead of cat file | grep 'foo'. (I am not looking at the original script, but cat | grep is always one of those ime, and you sound like a beginning shell-scripter; the url will be useful to you, if so.)

 *Quote:*   

> 
> 
> ```
> while read atom data; do
> 
> ...

 

It's called Parameter Expansion. This FAQ shows what you can do with it (the array stuff will not work in sh.)

BTW wrapping vars in unnecessary braces is a waste of time. You need to quote "$1" there however as it's a filename. You don't need to quote ret=${data%%#*} as word-splitting does not take place in assignments. You do with the second one as there is a space there. Note you can also use ret+=$foo in general (again the space there would necessitate quoting.)

You can also use if ((append)); then which would swap the meaning of the condition or if ((!append)); if you wanted to keep it as-is. (Assuming append is an integer string.)

http://wooledge.org/mywiki/BashGuide is the place to start if you want to know #bash.

edit: fixed [Last edited by steveL on Fri Sep 19, 2008 7:31 am; edited 1 time in total

----------

## steveb

 *steveL wrote:*   

> True, but all ebuilds are in bash, and eclasses in the tree are supposed to be able to rely on bash being available; forcing that to sh compatibility isn't the right way to get embedded builds imo, and only slows down the rest. A serious embedded developer doesn't build on the target ime. The only other use-case I've heard of that could possibly use it, is building for a PDA or a phone, and again I'd much rather see better desktop/host tools for that, than slowing ebuild/eclass devs down. If you really want portable sh, you don't even use

 Gentoo on BSD has some of the restrictions as well. So if you want a script to run on almost all of the Gentoo supported platforms, then go as portable as possible. I personally don't see a reason why not trying to support the others as well. And using the external commands in bashrc in Portage gives you errors/warnings. So why ignoring them?

// SteveB

----------

## steveL

 *steveb wrote:*   

>  *steveL wrote:*   True, but all ebuilds are in bash, and eclasses in the tree are supposed to be able to rely on bash being available; forcing that to sh compatibility isn't the right way to get embedded builds imo, and only slows down the rest. A serious embedded developer doesn't build on the target ime. The only other use-case I've heard of that could possibly use it, is building for a PDA or a phone, and again I'd much rather see better desktop/host tools for that, than slowing ebuild/eclass devs down. If you really want portable sh, you don't even use [ 
> 
> Gentoo on BSD has some of the restrictions as well. So if you want a script to run on almost all of the Gentoo supported platforms, then go as portable as possible.

 

If you can define the restrictions clearly and one of them isn't "no bash." Bash is portable in the same way GNU make is. It might not be that fast, but it's definitely fast enough (that script needs major optimisation, which we'll do for the next version, but it works fine as-is on my old desktop and screams on my laptop) and it might be bloated, but it's not that bloated. When you look at the range of tools that get pulled in to build all these packages from source, bash is really not a problem, imo. And binpkgs can simply be untarred into the root of the target.

 *Quote:*   

> I personally don't see a reason why not trying to support the others as well. And using the external commands in bashrc in Portage gives you errors/warnings. So why ignoring them?

 

Well to be totally honest, I've never really used bashrc, so I don't have any experience of that situation; I was just answering wrt the "no bash" debate. It's much easier to maintain and write clean bash[1], especially for things like libs, than it is to maintain and write truly portable sh. Plus you can do a lot more without having to resort to eval etc. Yes you can argue that it should all be wrapped in an EAPI, so what difference does it make if hardly any ebuild devs can work with it? I'd argue that just makes it even harder for people to get involved, and doesn't give any long-term benefit in terms of use-cases, while also making the scripts a pig to maintain, when we all know devs are overstretched as it is.

I do agree with you however wrt non-GNU userland and the options that are used there. Personally I think there's a strong case for sticking to POSIX options wrt command line utilities, and allowing aliases or variables for say sed -r vs sed -E I think it is on BSD. (ie where the ebuild dev explicitly asks for an ERE.)

[1] Note that I don't actually consider Gentoo in-house style to be clean bash. ${var} is simply yuck in the general case, and often leads beginners into thinking they don't need quotes, and gives zero benefit but needs more typing (with awkward shift'ing which is really annoying when you know it doesn't do anything. Well it is for me, anyhow.) As for == in a shell script outside (( or [[ -n "$foo" ]] .. ;)

----------

## steveb

SteveL! I did not wanted to attack you. In no way. I just said, that not everything is pure Bash in Gentoo. Look for example at Getnoo Bugzilla Bug 230690 and Getnoo Bugzilla Bug 235152. See that info about "let i++"? And it's such small things to which I am referring. Avoiding them does not cost much time and helps others as well. You are right about portability of pure Bash scripts. But that's not the whole game. I contributed some time ago a Bash script for a package and then some one complained that the Bash script does not work on his embedded Gentoo because he does not have Bash there. He could install Bash and things would be okay. But he has his reasons (which are from my viewpoint 100% valid for an embedded installation) and so I took the time to make the very small changes in order to get the script run under pure sh. It's not that much work. Especially if you are the creator of the original script, then changing it to be runnable under pure sh is as easy as 1-2-3.

But hey! Who am I? Nobody! No one needs to follow my advice. I just said that if a.b does not want Portage to bark about external used commands, then he should try to reduce the need for external commands. That's it. Nothing fancy.

// SteveB[/bug]

----------

## steveL

SteveB it's cool I don't feel under attack from you at all :-) Sorry for sounding defensive.

i=$(expr $i + 1) is just awful; if you want to replace let i++ in POSIX sh I'd do i=$(($i+1)) since it doesn't require a subshell, nor a call to an external.

And yeah, scripts for a package itself, as opposed to for building the package, should be sh-compatible unless they are, for instance, to support a GUI app. initscripts must not require BASH sh, for example. == outside Arithmetic context works in sh when it's linked to BASH, but not in standard POSIX, and is usually an indication that the author doesn't really grok shell scripting ime.

 *steveb wrote:*   

> I just said that if a.b does not want Portage to bark about external used commands, then he should try to reduce the need for external commands. That's it. Nothing fancy.

 

Yeah, I think that's why I became a bit defensive; I'd missed that bit of the conversation, and jumped in at the end about BASH vs SH. Sorry about that. (And I agree, of course.)

Ah found the link which best explains just how nasty truly portable sh gets. Reading that is very useful, I do recommend it, but I really do not want to be writing scripts like that in general, and if the package manager already needs python, or C++ and boost, you're way out of embedded space already (even C++ alone is not usually considered for embedded systems) and thus doing the standard "build on a host for a target" thing. Focussing on making that work properly is a much better use of developer time, imo.

(TBH even the thought of a shellscript interpreter for an embedded system seems wrong to me, but then I am old ;)

Another type of ebuild, eg a pbuild for python, could easily restrict the sh used since much more of the logic would be in python, and sh would only be called minimally, as in a Makefile, if at all. In that case, sticking to POSIX sh would be useful and would not impact on the maintainability or flexibility of the resultant builds or libs.

----------

## Thaidog

I do not have a "/etc/portage/bashrc" file in my system. Should I make one or is that something regarding an older system type?

----------

## mattst88

 *Thaidog wrote:*   

> I do not have a "/etc/portage/bashrc" file in my system. Should I make one or is that something regarding an older system type?

 

Yes, you should create it.

----------

## Thaidog

 *|mattst88| wrote:*   

>  *Thaidog wrote:*   I do not have a "/etc/portage/bashrc" file in my system. Should I make one or is that something regarding an older system type? 
> 
> Yes, you should create it.

 

Thanks! It's working now. Do you know if the kernel will automatically compile correctly with Icc or do I need to apply a patch to it?

----------

## Thaidog

Well now everything I try to compile is failing with the exception of python. I am trying the "safe" packages and most errors say "emake failed". firefox 3 died with no error message.

Edit: the flags are: ICCCFLAGS="-O2 -xW -tpp7 -gcc"

 I added -gcc and now some "safe" packages are comping but I screwed up nss for firefox and the 3.12 version is not making it:

Generating DSA Key Pair..../var/tmp/portage/dev-libs/nss-3.12/work/nss-3.12/mozilla/security/nss/cmd/shlibsign/./sign.sh: line 2: 20899 Segmentation fault      ${2}/shlibsign -v -i ${5}

make[2]: *** [../../../dist/Linux2.6_x86_icc_glibc_PTH_OPT.OBJ/lib/libsoftokn3.chk] Error 139

make[2]: Leaving directory `/var/tmp/portage/dev-libs/nss-3.12/work/nss-3.12/mozilla/security/nss/cmd/shlibsign'

make[1]: *** [libs] Error 2

make[1]: Leaving directory `/var/tmp/portage/dev-libs/nss-3.12/work/nss-3.12/mozilla/security/nss/cmd'

make: *** [libs] Error 2

"ERROR: dev-libs/nss-3.12 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 2400:  Called die

 * The specific snippet of code:

 *       emake -j1 BUILD_OPT=1 XCFLAGS="${CFLAGS}" CC="$(tc-getCC)" || die "nss make failed"

 *  The die message:

 *   nss make failed"

----------

## ZeLegolas

 *|mattst88| wrote:*   

> I've rewritten Gentoo-Wiki's HOWTO on using the Intel C++ Compiler.
> 
> http://gentoo-wiki.com/HOWTO_Intel_C_Compiler
> 
> The old guide was terribly written and horribly messy.
> ...

 

http://gentoo-wiki.com/HOWTO_Intel_C_Compiler is gone   :Sad: 

----------

## mattst88

 *ZeLegolas wrote:*   

>  *|mattst88| wrote:*   I've rewritten Gentoo-Wiki's HOWTO on using the Intel C++ Compiler.
> 
> http://gentoo-wiki.com/HOWTO_Intel_C_Compiler
> 
> The old guide was terribly written and horribly messy.
> ...

 

Yep. gentoo-wiki lost all its content.

I'm not planning to rewrite it any time soon.

This definitely shows the importance of off site backups. Mike Valstar: what the hell man? I know it wasn't your fault, but no backups?!

----------

## Thaidog

 *ZeLegolas wrote:*   

>  *|mattst88| wrote:*   I've rewritten Gentoo-Wiki's HOWTO on using the Intel C++ Compiler.
> 
> http://gentoo-wiki.com/HOWTO_Intel_C_Compiler
> 
> The old guide was terribly written and horribly messy.
> ...

 

Google has cached backups of most of the missing pages thank goodness:

http://74.125.95.104/search?q=cache:1hKTU9cEvksJ:www.fr.gentoo-wiki.com/Intel_C%252B%252B_Compiler+Gentoo+intel+compiler&hl=en&ct=clnk&cd=14&gl=ca

----------

## mattst88

If someone is interested in getting the cached version back into Gentoo Wiki, then be my guest.

----------

## ZeLegolas

 *Thaidog wrote:*   

> 
> 
> Google has cached backups of most of the missing pages thank goodness:
> 
> http://74.125.95.104/search?q=cache:1hKTU9cEvksJ:www.fr.gentoo-wiki.com/Intel_C%252B%252B_Compiler+Gentoo+intel+compiler&hl=en&ct=clnk&cd=14&gl=ca

 

Thanks  :Smile: 

When I execute emerge for icc i have this:

```
$ emerge -pv icc

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild  NS   ] sys-devel/gcc-3.3.6-r1 [4.3.2] USE="doc fortran (multilib) nls objc (-altivec) -bootstrap -boundschecking -build-gcj -gtk (-hardened) -ip28 -ip32r10k -libffi -multislot (-n32) (-n64) -nocxx -nopie -nossp -test -vanilla" 23,534 kB

[ebuild  N    ] virtual/libstdc++-3.3  0 kB

[ebuild  N    ] dev-lang/icc-10.1.018  39,769 kB

Total: 3 packages (2 new, 1 in new slot), Size of downloads: 63,303 kB
```

Do I have to install gcc 3 to emerge icc????

----------

## Thaidog

 *|mattst88| wrote:*   

> If someone is interested in getting the cached version back into Gentoo Wiki, then be my guest.

 

I don't mind adding that one back... just need to be pointed in the right direction on how to do it. Is the server back up yet?

----------

## juantxorena

 *ZeLegolas wrote:*   

> Do I have to install gcc 3 to emerge icc????

 

Nope, icc depends on virtual/libstdc++, which depends on sys-libs/libstdc++-v3, sys-libs/libstdc++-v3-bin OR sys-devel/gcc-3.3*. You should install sys-libs/libstdc++-v3 (with --oneshot flag), and then install icc as usual, it won't pull gcc anymore.

I had this problem some days ago and I don't understand why virtual/libstdc++ try to install gcc first. Somebody can enlighten me?

----------

## thedarave

Any timeline on when ICC 11.0 will hit the portage tree or should I just submit a bug with an ebuild for it?

As for the virtual/libstdc++-v3, that's probably due to when that ebuild was made. It probably should get revised on x86/amd64 to invert the order. There's still platforms that use gcc-3.3 as the default compilier (I think) which would be why the gcc-3.3 install would be the default. A little rewriting of the ebuild should fix that.

----------

## thedarave

Here's a toy for those that can understand what this is trying to do. If you don't understand what it's doing/does or how to work it, its probably not meant for you.

Yes, its a silly little item, but it fills a slight void I've encountered.

```

#!/bin/bash                            

clear                                  

export OPTLEVEL=2                      

export IPOLEVEL=2                      

export FPLEVEL=1                       

export PARALEVEL=1                     

export GCCVLEVEL=2                     

if [[ `cat /proc/cpuinfo | grep -c " sse4"` -ne 0 ]]

then export INSDFLAG=" -xS"                         

elif [[ `cat /proc/cpuinfo | grep -c " ssse3"` -ne 0 ]]

then export INSDFLAG=" -xT"                            

elif [[ `cat /proc/cpuinfo | grep -c " sse3"` -ne 0 ]] 

then export INSDFLAG=" -xP"                            

elif [[ `cat /proc/cpuinfo | grep -c " sse2"` -ne 0 ]] 

then export INSDFLAG=" -xW"                            

elif [[ `cat /proc/cpuinfo | grep -c " sse "` -ne 0 ]] 

then export INSDFLAG=" -xK"                            

else export INSDFLAG=" -axS"                           

fi                                                     

export INSLEVEL=1                                      

grep -v "$1 " /etc/portage/package.icc-cflags > /etc/portage/package.icc-cflags.temp

while [[ 0 -eq 0 ]]

do                 

   if [[ ${OPTLEVEL} -eq 2 ]]

   then                      

      export OPTFLAG="-O3"   

   elif [[ ${OPTLEVEL} -eq 1 ]]

   then                        

      export OPTFLAG="-O2"     

   else                        

      export OPTFLAG="-O1"     

   fi                          

   if [[ ${IPOLEVEL} -eq 2 ]]  

   then                        

      export IPOFLAG=" -ipo"   

   elif [[ ${IPOLEVEL} -eq 1 ]]

   then                        

      export IPOFLAG=" -ip"    

   else                        

      export IPOFLAG=""        

   fi                          

   if [[ ${FPLEVEL} -eq 1 ]]   

   then                        

      export FPFLAG=" -fomit-frame-pointer"

   else                                    

      export FPFLAG=""                     

   fi                                      

   if [[ $PARALEVEL -eq 1 ]]               

   then                                    

      export PARAFLAG=" -parallel"         

   else                                    

      export PARAFLAG=""                   

   fi                                      

   if [[ $INSLEVEL -eq 1 ]]                

   then                                    

      export INSFLAG="${INSDFLAG}"         

   else                                    

      export INSFLAG=""                    

   fi                                      

   if [[ $GCCVLEVEL -eq 2 ]]               

   then                                    

      export GCCVFLAG=""                   

   elif [[ $GCCVLEVEL -eq 1 ]]             

   then                                    

      export GCCVFLAG=" -gcc-version=420"  

   else                                    

      export GCCVFLAG=" -gcc-version=330"  

   fi                                      

   echo $1 ${OPTFLAG}${IPOFLAG}${FPFLAG}${INSFLAG}${PARAFLAG} -gcc${GCCVFLAG} > /etc/portage/package.icc-cflags                                                                       

   emerge -1 $1                                                                            

   if [[ $? -eq 0 ]]                                                                       

   then                                                                                    

      cat /etc/portage/package.icc-cflags /etc/portage/package.icc-cflags.temp | sort -u > /etc/portage/package.icc-cflags.new                                                        

      rm -f /etc/protage/package.icc-cflags /etc/portage/package.icc-flags.temp            

      mv /etc/portage/package.icc-cflags.new /etc/portage/package.icc-cflags               

      exit 0

   else

      if [[ ${IPOLEVEL} -gt 0 ]]

      then

         export IPOLEVEL=$(( ${IPOLEVEL} - 1 ))

      else

         export IPOLEVEL=2

         if [[ ${PARALEVEL} -gt 0 ]]

         then

            export PARALEVEL=$(( ${PARALEVEL} - 1 ))

         else

            export PARALEVEL=1

            if [[ ${FPLEVEL} -gt 0 ]]

            then

               export FPLEVEL=$(( ${FPLEVEL} - 1 ))

            else

               export FPLEVEL=1

               if [[ ${GCCVLEVEL} -gt 0 ]]

               then

                  export GCCVLEVEL=$(( ${GCCVLEVEL} - 1 ))

               else

                  export GCCVLEVEL=2

                  if [[ ${OPTLEVEL} -gt 0 ]]

                  then

                     export OPTLEVEL=$(( ${OPTLEVEL} - 1 ))

                  else

                     grep -vx $1 /etc/portage/package.icc | sort -u > /etc/portage/package.icc.temp

                     mv -f /etc/portage/package.icc.temp /etc/portage/package.icc

                     mv -f /etc/portage/package.icc-cflags.temp /etc/portage/package.icc-cflags

                     rm -rf /var/tmp/portage/$1*

                     exit 1

                  fi

               fi

            fi

         fi

      fi

   fi

done

```

Take it or leave it, but I'm not answering questions about it!   :Razz: 

----------

## tranquilcool

icc is trying to install outside sandbox.

anybody knows what's happening?

packages can only be installed with FEATURES="-sandbox" without

ACCESS DENIED errors.

----------

## mattst88

 *tranquilcool wrote:*   

> icc is trying to install outside sandbox.
> 
> anybody knows what's happening?
> 
> packages can only be installed with FEATURES="-sandbox" without
> ...

 

Yes, this is noted in bug 246516.

I think the best thing to do at this point is stick with icc 10.1.xxx.

At some point, I'll also get around to transplanting the guide onto my website so we don't lose it again.

----------

## Thaidog

If anyone wants to compile their kernel with ICC please check out my project:

www.linuxdna.com

http://www.linuxjournal.com/content/linuxdna-supercharges-linux-intel-cc-compiler

----------

## rufnut

 *Thaidog wrote:*   

> If anyone wants to compile their kernel with ICC please check out my project:

 

Thanks   :Very Happy: 

I thought you had given up for a while.

This ought to be interesting and may eventually be a good little kick for all those Atom based machines out there.

 :Cool: 

----------

## Thaidog

 *rufnut wrote:*   

>  *Thaidog wrote:*   If anyone wants to compile their kernel with ICC please check out my project: 
> 
> Thanks  
> 
> I thought you had given up for a while.
> ...

 

Down but never out   :Cool: 

----------

## tranquilcool

 *Thaidog wrote:*   

>  *rufnut wrote:*    *Thaidog wrote:*   If anyone wants to compile their kernel with ICC please check out my project: 
> 
> Thanks  
> 
> I thought you had given up for a while.
> ...

 

i have tried to compile the kernel in many ways but it fails

with the pid.o errors.

Mod edit: Answered here in the support thread (see next post). --timeBandit

----------

## timeBandit

This has somehow slipped under the radar, for about a hundred replies. To wit: *Guidelines for Tips & Tricks wrote:*   

> This is *not* a support forum.  Do not ask questions here.  The moderators and myself would like to stress this point, if you do ask a question, your post will be deleted.  Use the other forums to ask questions, if you are asking a question regarding a tip or trick, you are encouraged to include a link to the tip/trick you are referring to make it easier for other to help you.

 I've split off recent discussion (to provide some context) to a new thread for support on this HOWTO. If you have read this far and still have questions, please post them there.

----------

