View previous topic :: View next topic |
Author |
Message |
kikawala n00b
Joined: 20 Aug 2002 Posts: 41 Location: Dallas, TX
|
Posted: Mon Mar 24, 2003 5:12 pm Post subject: Re: Using gcc-config to configure icc |
|
|
habakke wrote: | Does anyone know which ebuilds supports icc?
|
Code: | for FILE in `find /usr/portage/ -name "*.ebuild"`;do cat $FILE|grep "use icc" >/dev/null &&echo $FILE;done |
|
|
Back to top |
|
|
rajl Apprentice
Joined: 25 Sep 2002 Posts: 287
|
Posted: Mon Mar 24, 2003 8:50 pm Post subject: |
|
|
the only ebuild that supports icc currently is for povray, a 3-d ray tracing program. _________________ -Rajl
-----------------------------------------------------------
It's easy to be brave once you consider the alternatives. |
|
Back to top |
|
|
UnuMondo n00b
Joined: 18 Oct 2002 Posts: 72 Location: Madrido, Hispanio
|
Posted: Fri Mar 28, 2003 1:49 pm Post subject: |
|
|
I've been having a hard time compiling abiword with icc. Is there anything I have to tweak other than ?
UnuMondo |
|
Back to top |
|
|
Gnufsh Guru
Joined: 28 Dec 2002 Posts: 400 Location: Portland, OR
|
Posted: Mon Apr 07, 2003 4:57 pm Post subject: |
|
|
Where can I find docs about flags to use with ICC? On an athlon-xp? |
|
Back to top |
|
|
avenj Retired Dev
Joined: 11 Oct 2002 Posts: 495 Location: New Hampshire
|
Posted: Mon Apr 07, 2003 5:16 pm Post subject: |
|
|
Gnufsh wrote: | Where can I find docs about flags to use with ICC? On an athlon-xp? |
ICC basically only optimizes for Pentiums. |
|
Back to top |
|
|
rajl Apprentice
Joined: 25 Sep 2002 Posts: 287
|
Posted: Mon Apr 07, 2003 9:09 pm Post subject: |
|
|
type man icc to see all the flags icc uses. however, it is made by intel for intel chips, so your athlon is out of luck. If you're looking for other compiler alternatives, try tenDRA compiler. It was developed by DERA, the U.K.'s version of DARPA here in the U.S., but has been BSD licensed, with continued development being done by an open source group at stanford university. For more information, go to http://www.tendra.org there isn't an ebuild for it, so you'll have to manually install it yourself. _________________ -Rajl
-----------------------------------------------------------
It's easy to be brave once you consider the alternatives. |
|
Back to top |
|
|
() l33t
Joined: 25 Nov 2002 Posts: 610
|
Posted: Mon Apr 07, 2003 9:50 pm Post subject: |
|
|
Isn't the Athlon XP relatively similar to the piii architecture wise though? One would think it should benefit from the same optimizations. |
|
Back to top |
|
|
rajl Apprentice
Joined: 25 Sep 2002 Posts: 287
|
Posted: Tue Apr 08, 2003 12:01 am Post subject: |
|
|
athlon xp uses the x86 instruction set, and produces similar output as an intel chip, but there are significant architechtural differences. Example, 3dnow vs sse and sse2. ICC takes advantage of mmx, mmx2, sse and sse2 to the fullest, which is why it so much faster than gcc. Basically it turns every math operation it can into a an sse vector, and then dumps it onto the sse unit to do fast vector math. Since athlons don't have the same sse and mmx units as the pentiums, the code can be (though isn't necessarily) imcompatible. _________________ -Rajl
-----------------------------------------------------------
It's easy to be brave once you consider the alternatives. |
|
Back to top |
|
|
KBAKEP n00b
Joined: 07 Dec 2002 Posts: 58 Location: Russia
|
|
Back to top |
|
|
() l33t
Joined: 25 Nov 2002 Posts: 610
|
Posted: Wed Apr 09, 2003 5:18 pm Post subject: |
|
|
One would think that Athlon XP should handle the same SSE code as Pentium though, since it supports the SSE instruction set? I mean, if someone handcoded SSE for a game for instance, it should work with XP.
I wouldnt use 3DNow as an example of major architectural differences either, with XP supporting SSE, SSE2 optimization with ICC can be turned off. From what I remember Athlon is pretty similar to piii architecture wise, but with a beefed up FPU among other things. |
|
Back to top |
|
|
zealot n00b
Joined: 13 Apr 2003 Posts: 1
|
Posted: Sun Apr 13, 2003 5:10 am Post subject: |
|
|
I believe icc, should work fine with Athlon chips... you just might not be able to use certain flags (like don't allow SSE2 code). AMD usually uses the Intel compilers for their SPEC submissions (www.spec.org). Even though the optimizations in the compiler are targetted specifically for Intel processors, many of them benefit modern processors in general.
For example, keeping memory accesses (function calls, reading variables, etc.) aligned to a 4 byte boundary helps modern processors, because if the memory is unaligned they have to shift the data that gets returned, which on many designs takes extra time. I believe this applies to the Athlon, P3, and P4... the P4 just has a higher penalty for unaligned accesses, so it will benenfit more from this optimization.
Anyway, I'm interested in trying out ICC on my gentoo 1.4 box... any new suggestions/tips? Is it better to use the version in emerge, or should I just download the latest version from Intel's site? Any faqs/updates on how to get emerge packages to try to compile with ICC?
Thanks. |
|
Back to top |
|
|
Cheesefoam Tux's lil' helper
Joined: 02 Jan 2003 Posts: 89
|
Posted: Thu Apr 17, 2003 2:54 pm Post subject: |
|
|
FYI, I just managed to get MPQC (a quantum chemistry package) to compile with ICC. I used "-O3 -xW -ipo -tpp7" to optimize for the P4, and got it compiled no problem.
Makes a HUGE difference for computational chemistry.
Thanks for the tips. I'll post other things I get to work if anyone is interested.
Last edited by Cheesefoam on Thu Apr 17, 2003 4:36 pm; edited 1 time in total |
|
Back to top |
|
|
avenj Retired Dev
Joined: 11 Oct 2002 Posts: 495 Location: New Hampshire
|
Posted: Thu Apr 17, 2003 3:02 pm Post subject: |
|
|
I'd love to hear about packages that're known to compile with ICC. In fact, after we get ICC functionality implemented in (g)cc-config, I may start keeping a list of what's known to compile fine with ICC. |
|
Back to top |
|
|
() l33t
Joined: 25 Nov 2002 Posts: 610
|
Posted: Thu Apr 17, 2003 3:11 pm Post subject: |
|
|
I modified the abiword ebuild to use icc once and it worked fine (with moderate optimizations), I think Qt has support for icc, but haven't tried myself yet. |
|
Back to top |
|
|
Cheesefoam Tux's lil' helper
Joined: 02 Jan 2003 Posts: 89
|
Posted: Thu Apr 17, 2003 4:15 pm Post subject: |
|
|
I'll let you know as I figure out packages that work. I'm running some test computations under ghemical with mpqc to really bog down the system and stress test it - seems to be doing just fine.
Should packages that work just be posted here, or should bug reports / feature requests be made? |
|
Back to top |
|
|
Cheesefoam Tux's lil' helper
Joined: 02 Jan 2003 Posts: 89
|
Posted: Thu Apr 17, 2003 4:45 pm Post subject: |
|
|
Got XMMs 1.27-r19 to compile. You'll need to leave out "-ip" or "-ipo" flags, though... They b0rk the compile. Otherwise, it goes very well.
Now to try and get xine-lib to compile. |
|
Back to top |
|
|
avenj Retired Dev
Joined: 11 Oct 2002 Posts: 495 Location: New Hampshire
|
Posted: Thu Apr 17, 2003 5:08 pm Post subject: |
|
|
Here is fine for me - I'd rather not clutter up Bugzilla much more than it already is.... |
|
Back to top |
|
|
Cheesefoam Tux's lil' helper
Joined: 02 Jan 2003 Posts: 89
|
Posted: Thu Apr 17, 2003 5:46 pm Post subject: |
|
|
I should point out that this is a list only of things that *compile* - they may not work, as such. For example, I know that the XMMS compile is not properly generating libxmms.so. Anyone got any ideas on that? Packages that I *know* work are marked "**"
Some additions:
Known to compile "out of the box"
zlib-1.1.4-r1
libdvdcss-1.2.6
libfame-0.9.0
alsa-xmms-1.27-r19
eog-2.2.1
**mpqc-2.1.2
xmms-1.27-r19
bzip2-1.0.2-r2
gzip-1.3.3-r1
tar-1.13.25-r3
jpeg-6b-r3
libpng-1.2.5-r4
libogg-1.0
libvorbis-1.0-r2
libmikmod-3.1.10
libsdl-1.2.5-r1
mpg123-0.59r-r2
alsa-oss-0.9.1
openquicktime-1.0-r1
Do not compile
mpeg-lib-1.3.1-r1
xine-lib-1_beta10
gimp-1.2.3
xine-ui-0.9.20
tiff-3.5.7-r1
giflib-4.1.0-r3
imlib-1.9.14
lame-3.93.1-r1
libmpeg2-0.3.1
jpeg-mmx-1.1.2-r1
xvid-0.9.1
Configuration Problems
mozilla-1.2.1-r5
unzip-5.5.0-r1
gtk-perl-0.7008-r9
zip-2.3-r1
PDL-2.3.2-r2
libmpeg3-1.5-r1
quicktime4linux-1.5.5-r1
Mozilla (I know, I know... but I had to try), zip, and xine-lib so far don't work. I'll update this post as I find more packages that work "out of the box" and require no special abuse. Mozilla is interesting because it dies at one point saying that it can't find a compiler, but it's already compiled some stuff up to that point. I didn't take time to really mess with it, though.
Gtk-perl seems to want to stick with gcc only... It doesn't pull up the compiler from the envirment variables - always seems to override with gcc. PDL is the same way. This seems to be the most common problem with the "Configuration Problem" emerges.
Seems that also Intel has made the -tpp7 option default for the compiler, so there's really no need to specify it anymore - it automatically optimizes for the P4.
Last edited by Cheesefoam on Thu Apr 17, 2003 7:46 pm; edited 16 times in total |
|
Back to top |
|
|
iamarug Apprentice
Joined: 09 Feb 2003 Posts: 220
|
Posted: Thu Apr 17, 2003 5:59 pm Post subject: |
|
|
at one point I was able to compile electric with icc but not an ebuild. Will try that tonight and report back with any results.
Here is my questions though:
since c++ is not compatible between ICC and GCC, if I were to build a package like qt with ICC, would that create problems for applications compiled with GCC that use the qt libs? I think this would stop many people from compiling main system packages with ICC if it is the case. |
|
Back to top |
|
|
Cheesefoam Tux's lil' helper
Joined: 02 Jan 2003 Posts: 89
|
Posted: Thu Apr 17, 2003 6:02 pm Post subject: |
|
|
BTW, does anyone know how to make emerge compile fortran with ifc instead of g77? I have a couple of packages built with g77 that'd I'd like to redo in ifc.
Iamarug, from what I understand about linking, the real problem lies in the fact that you cannot link libraries which have been compiled with different versions of compilers. An example is if you try to compile avifile. It will give you an error about not being able to link to the Qt libraries because they were built with a different compiler version. |
|
Back to top |
|
|
fishhead Apprentice
Joined: 07 Mar 2003 Posts: 162 Location: Pasadena, CA
|
Posted: Thu Apr 24, 2003 6:54 am Post subject: |
|
|
I encoutered an interesting problem building some packages (tar.gz from the providers, not from the ebuilds, but not that it realy matters....). I used icc version 7.1, build 20030307Z. I was trying to build them on a dual Athlon MP with the CFLAGS: "-ip -O3 -xMiK -unroll -openmp -parallel". Each time I tried to run a program, it segfaulted. I traced the instructions and found that the code at fault was always the function "intel_cpu_dispatch_fail". Appearently it didn't like my Athlons, which should be able to run P3 (-xMiK) code just fine. I disassembled the code and found that it was:
080758f0 <__intel_cpu_dispatch_fail>:
80758f0: c7 05 00 00 00 00 01 movl $0x1,0x0
80758f7: 00 00 00
80758fa: c3 ret
80758fb: 90 nop
Which I believe tries to move the value 1 to a location unlikley to be in the program's address space ... I think. Anyway, on removing this code, the program ran just fine, as it should. The way I fixed it was by running:
cat <program_name> | sed -e 's/\xc7\x05\x00\x00\x00\x00\x01\x00\x00\x00\xc3\x90/\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\xc3\x90/g' > <program_name_2>
Which replaces the mov instruction with nops, preventing the problem.
This fix has two problems:
1) I will assume that if the processor won't be able to run this code, this routine might be called, but replacing it may erroniously cause the code to continue executing.
2) If the hex sequence c7 05 00 00 00 00 01 00 00 00 c3 90 occours in the data secton of the program, it will be changed - which could cause any number of problems. However, since the chances of this are ~1 in 7.9 x 10^28 this will hopefuly not be a problem.
Perhaps some more people with Athlon MPs / XPs could try this and see if it works ... It appears that this won't always break .... just sometimes. |
|
Back to top |
|
|
() l33t
Joined: 25 Nov 2002 Posts: 610
|
Posted: Thu Apr 24, 2003 3:05 pm Post subject: |
|
|
If I remember correctly, Intel C++ 7 is meant to be object compatible with GCC, so that you can link link Qt compiled with ICC with apps compiled with GCC etc. Ie. compatible ABI. This is similar to the Windows version, which should be interchangeable with the .NET compiler. |
|
Back to top |
|
|
Twist Guru
Joined: 03 Jan 2003 Posts: 414 Location: San Diego
|
Posted: Thu Apr 24, 2003 7:30 pm Post subject: |
|
|
Quote: | For example, I know that the XMMS compile is not properly generating libxmms.so. Anyone got any ideas on that? |
Short path to almost always getting this to work: switch to GCC as a compiler, ./configure you package, manually search and replace the "gcc <cflags>" with icc <cflags>.
Most of the shared object failures are ./configure scripts that dump out because they are either overly fond of gcc syntax or have older (broken) libtools embedded. Doing the above is ugly but usually works in these cases. For instance, this makes freetype a one stop compile - unpackage, configure with gcc, replace gcc compile lines with icc, voila.
As you've already noted -ipo seems to break all kinds of things, I stopped using it.
-Twist |
|
Back to top |
|
|
() l33t
Joined: 25 Nov 2002 Posts: 610
|
Posted: Thu Apr 24, 2003 8:41 pm Post subject: |
|
|
[quote="Twist"] Quote: |
As you've already noted -ipo seems to break all kinds of things, I stopped using it.
|
If I recall correctly there's a switch to create regular object files with -ipo turned on, perhaps this would help? |
|
Back to top |
|
|
Cheesefoam Tux's lil' helper
Joined: 02 Jan 2003 Posts: 89
|
Posted: Fri Apr 25, 2003 1:19 pm Post subject: |
|
|
That's the "-ipo_obj" flag. I've used it in a couple of cases, and it does seem to help, though for the life of me I still can't get libraries built properly through ebuilds or get ifc to be used in ebuilds. I was able to get ifc to work in one ebuild by manually changing the ebuild, but that's not exactly a good way to go, since I b0rked many other things when I tried to emerge.
I would love to see a second variable for the make.conf file, something like ICFLAGS & ICXXFLAGS, where you can set flags for icc & ifc.
Is there a variable similar to CC/CXX which is used for specifying the fortran compiler? I noticed a FC variable in one of the ebuilds, but it seemed to be local in scope, which is too bad.
Since I've been unable to get ebuilds to make libraries properly yet, I've been trying to get ifc to work, mainly on octave, scilab, ghemical, and mpqc. In all cases, it is tenuous at best just to get the compiler used. I've tried making a set of symlinks to ifc as g77 in a separate directory, then exporting that directory into the path ahead of the regular gcc path, but that doesn't work. Anyone have any ideas? |
|
Back to top |
|
|
|