Slashdot Mirror


Intel C/C++ Compiler 8.0 Released

Peorth writes "Intel has released version 8.0 of their Intel C/C++ compiler for both Windows and Linux. This release has been rumored for a long time to contain 100% GCC source and binary compatibility. It seems great strides have been made in advancement of that goal, as well as of its performance, but it may have a long way to go yet. Has anyone had experiences with it yet, either good or bad?"

43 of 161 comments (clear)

  1. so, any source distributions able to use this? by gl4ss · · Score: 2, Interesting

    yes this is for you gentoo folk, does it work as just drop in replaced? benefits?

    -

    --
    world was created 5 seconds before this post as it is.
    1. Re:so, any source distributions able to use this? by ispeters · · Score: 2, Informative

      I've not tried it, but there is a USE flag to use icc instead of gcc if you have it, so it's supposed to be drop-in-and-tweak-a-flag. As for benefits, who knows? I know my gentoo box feels snappier than the same box running Mandrake or RedHat, but I have a sneaking suspicion that it's only snappier 'cause it's running fewer deamons--I doubt that source-based distros really get you much more performance, but I have no numbers to back up either side of the argument--so if compiling from source with gcc doesn't give you any benefits, I doubt using icc would be any better.

    2. Re:so, any source distributions able to use this? by cakoose · · Score: 4, Insightful
      so if compiling from source with gcc doesn't give you any benefits, I doubt using icc would be any better

      That's a strange conclusion. The Gentoo comparision is a comparison of two -march settings on GCC. ICC is a whole different compiler.

  2. Because... by DAldredge · · Score: 3, Informative

    Because in some/most cases it makes faster code and saving 10% execution time is worth the sub 900 USD price of the Intel C compiler.

    1. Re:Because... by ciaran_o_riordan · · Score: 2, Funny

      And as an added bonus, if you give a copy to a friend, you are a criminal! cool. or something.

  3. Re:Linux is their benchmark then by njchick · · Score: 4, Informative
    The Linux kernel specifically requires gcc because it uses gcc extensions. But it should be possible to recompile the usermode code with the Intel's compiler. Even glibc may be worth trying (if you bought the compiler).

    The really interesting part is that the Intel's compiler supports Itanium. It's very hard to optimize for Itanium because of its very long instruction codes. Those who run CPU-intensive tasks on Itanium may be interested in the Intel's compiler.

  4. kernel by portscan · · Score: 5, Interesting

    My first thought was, "does this mean it can finally compile the Linux kernel?" But the website says "with a few kernel modifications, [icc] can build the kernel." Since gcc can compile it without modifications, doesn't this mean they are not 100% compatible? Also, there is no link to these patches anywhere, just this article on icc 7. Do you have to figure out the problems and fix them yourself?

    Obviously there is other software to compile besides the Linux kernel, but since the icc is so tuned to the Intel hardware, and Linux interacts so directly with the hardware, people believe that icc would give great benefits to the kernel. At the very least, nothing can claim 100% gcc compatibility unless it can compile Linux unmodified.

    1. Re:kernel by jarek · · Score: 5, Insightful

      To tell the truth, not even all gcc versions are compatible with the specific version of gcc that is currently supposed to compile the kernel. Gcc compatibility is a moving target and kernel developers do not switch to the latest gcc version as soon as it appears. Examples of this are kgcc vs gcc in some distributions. Unless icc becomes the official compiler for the linux kernel, I doubt it will ever compile the kernel in a predictable way (what ever predictable means in this case). /jarek

  5. Here's my experience: by ciaran_o_riordan · · Score: 2, Funny

    > Has anyone had experiences with it yet, either good or bad?

    I went to the website and was told that I wasn't allowed to have a copy unless I paid them money and promised to prevent others from copying my copy.

    They've also denied my request for a copy of the source code. Appearently, I'm not allowed to know what my copy is doing when it's compiling my code.

    There were many other restrictions. Overall, a pretty bad experience :-(

    1. Re:Here's my experience: by ciaran_o_riordan · · Score: 3, Informative

      I'm not allowed to know what my copy is doing

      An AC above pointed out that Intel are part of the Trusted Computing group. This all reminds me of Ken Thompsons compiler trojan. (where he hacked a c compiler to add a backdoor whenever it is compiling "login".)

      So, what might icc add to the security functions of glibc? to gnupg, sshd, lsh?

      In a way, the idea of using a proprietary compiler is very similar to that of proprietary voting software.

    2. Re:Here's my experience: by RML · · Score: 2, Informative

      i seem to remember that even non-open-source programs can still be run through a decompiler (albeit not necessarily legally, thanks to the shrink-wrap license.)

      Sadly, there don't seem to be any good free (either speech or beer) general-purpose decompilers. There are several for Java, but Java is easier to decompile because programs carry extra information for verification purposes.

      and sheesh, some C people can read assembly code just as easily as if it -were- C. it's practically the same thing.

      Depends. C may be messed up but it's not nearly as messed up as, say, x86 assembly. And the compiler will reorder blocks, functions, and data, so things that were nearby in the source can be far away in the binary.

      --
      Human/Ranger/Zangband
    3. Re:Here's my experience: by Peorth · · Score: 2, Informative

      Actually, just to note, there is (as there has been since 7.0 or so) a non-commercial version of the Linux compiler. You're not "allowed" to compile commercial stuff with it, but $0 is still cheaper than paying for 8.0 if you don't go for that sort of thing or just want to see how well it'll work with your libraries. (not to sound like an Intel saleswoman, gah)

  6. Re:Linux is their benchmark then by RML · · Score: 4, Informative

    The Linux kernel specifically requires gcc because it uses gcc extensions. But it should be possible to recompile the usermode code with the Intel's compiler. Even glibc may be worth trying (if you bought the compiler).

    The Intel compiler has supported compiling the kernel with it for a few versions now, I believe. It may require a few kernel patches, but I think some of them have been accepted into the kernel tree. Intel has a web page about it.

    --
    Human/Ranger/Zangband
  7. What's the big deal? by RML · · Score: 3, Informative
    I'm looking at the feature summary and I don't understand the big deal.
    • ICC supports two-pass compilation. So does GCC.
    • ICC supports data prefetching. So does GCC.
    • ICC can do code coverage testing. So can GCC.
    • ICC can do interprocedural optimizations. Released GCC versions can't, but work is in progress.
    • ICC can do automatic vectorization, GCC can't. Advantage ICC.
    • ICC supports something called "processor dispatch". I'm not even sure what that is.
    • ICC supports a number of optimizations that might be interesting if you happen to have an Itanium 2 sitting around.
    • ICC supports parallel programming, GCC doesn't (not very well anyways). Advantage ICC.
    • ICC's debugger supports "GDB syntax and a subset of GDB commands". Why not just use GDB?

    Overall, it's probably not worth using unless you really need a compiler that generates fast code.
    --
    Human/Ranger/Zangband
    1. Re:What's the big deal? by stevesliva · · Score: 5, Funny
      Overall, it's probably not worth using unless you really need a compiler that generates fast code.
      Yeah! Who needs fast code anyways?? Real C coders use only "#pragma I'll do it my goddamn self!" statements and asm{} blocks! Real men don't need any stinkin' optimizing compilers other than their own beautiful minds.
      --
      Who do you get to be an expert to tell you something's not obvious? The least insightful person you can find? -J Roberts
    2. Re:What's the big deal? by Screaming+Lunatic · · Score: 4, Insightful
      Others have mentioned performance. But the more compilers that you put your source through, the more robust your code will become. Different compilers emit different warnings. Different compilers adhere to different parts of the standard. Putting your code through different compilers makes your code easier to port to other platforms.

      At work we use both MSVC 7.0 and ICC 7.0. We'll probably also use MSVC 7.1 for our next product cycle. And maybe Comeau or GCC in the future. At home I use GCC and ICC.

    3. Re:What's the big deal? by Anonymous Coward · · Score: 2, Funny

      Overall, it's probably not worth using unless you really need a compiler that generates fast code.

      Yeah, totally. I mean ... the whole idea of compilers generating fast code is over-hyped anyway. :)

  8. $900? by rudy_wayne · · Score: 2, Informative

    According to the website the compiler for Windows is $399

  9. Re:Linux is their benchmark then by larry+bagina · · Score: 4, Informative
    I see no other reason to make the compiler binary-compatible with GCC.

    Actually, the gcc 3.0 series was changed to use Intel's C++ ABI, so gcc did the changing, not icc. Of course, icc did add support for some of gcc's extensions.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  10. Non commercial license is free by Anonymous Coward · · Score: 4, Interesting

    I don't know if this applies to the newest version, but info about a non-commercial license is at:
    http://www.intel.com/software/products/compil ers/c lin/noncom.htm

    I compile using both gcc 3.2 and icc 7.0. I do this because different compilers emit different warnings and this has helped me to improve my software's quality.

    The fortran and c/c++ are both available, as long as you don't try to create a commercial product with it.

    1. Re:Non commercial license is free by ufnoise · · Score: 2, Informative

      Corrected link here

  11. Real Timings by menscher · · Score: 3, Interesting
    Since this is Slashdot, this will quickly turn into a stupid bashing of Intel in favor of gcc, since everyone likes Free stuff and hates corporations. And everyone will talk out of their asses about how the Intel compilers couldn't possibly be faster than gcc. So, I figured I'd throw out some real numbers:
    icc -static (Intel 5.2 compiler on RH7.2 box)
    199.490u 0.000s 3:19.87 99.8% 0+0k 0+0io 48pf+0w

    icc -static RH8.0-2.2.93 (Intel 7.0 compiler)
    236.860u 0.010s 3:56.96 99.9% 0+0k 0+0io 53pf+0w

    icc -static RH8.0-2.3.2 (Intel 7.0 compiler)
    253.980u 0.050s 4:15.03 99.6% 0+0k 0+0io 53pf+0w
    245.030u 0.020s 4:05.26 99.9% 0+0k 0+0io 53pf+0w

    icc -static RH8.0-2.2.93 (Intel 7.0 compiler)
    503.060u 0.770s 8:23.99 99.9% 0+0k 0+0io 58pf+0w

    icc -static RH8.0-2.3.2 (Intel 7.0 compiler)
    521.420u 0.020s 8:41.83 99.9% 0+0k 0+0io 58pf+0w

    icc -static -O0 (Intel 5.2 compiler on RH7.2 box)
    521.670u 0.000s 8:42.19 99.9% 0+0k 0+0io 53pf+0w

    gcc -O3 -static (on RH9 box)
    693.380u 0.010s 11:33.48 99.9% 0+0k 0+0io 46pf+0w

    gcc -O3 -static RH8.0-2.3.2
    728.680u 0.020s 12:09.57 99.8% 0+0k 0+0io 46pf+0w

    gcc -O3 -static (RH 7.2 box)
    731.560u 0.070s 12:12.17 99.9% 0+0k 0+0io 41pf+0w

    superior gcc -static (RH 9 box)
    856.170u 0.710s 14:18.18 99.8% 0+0k 0+0io 52pf+0w
    The notations indicate the compile options. All binaries were then run on the same machine (dual Xeon running RH9) to gather timing information.

    Now, you can take whatever you want outta that, but my view is that having your programs run three times faster just might be useful.

    Disclaimer: these results are for a specific program (dealing with computational astrophysics). Obviously your application may see other speedups.

    1. Re:Real Timings by menscher · · Score: 2, Informative
      I should have mentioned: the slow timings with icc (entries 4,5,6 in the table above) were done with -O0 (optimization turned off).

      And ignore the word "superior" in the last entry. That's just an internal note that I forgot to remove... has nothing to do with the timing test.

      And for those who were wondering... the various tests comparing RH8 libraries (2.2.93 vs 2.3.2) were done because the 7.0 version of the Intel compiler did not support RedHat 9 (so we were forced to copy libraries over from a RedHat 8.0 box). I'm really looking forward to getting Intel's 8.0 compilers so we can stop doing that ugly hack!

      Ok, I think that covers just about everything I left out. Now back to your regularly-scheduled programming....

    2. Re:Real Timings by RML · · Score: 4, Informative

      Since this is Slashdot, this will quickly turn into a stupid bashing of Intel in favor of gcc, since everyone likes Free stuff and hates corporations.

      "Free stuff" and "corporations" are not mutually exclusive. Most of the work done on gcc is by people who are paid to work on it.

      And everyone will talk out of their asses about how the Intel compilers couldn't possibly be faster than gcc.

      There are still many interesting optimizations that gcc doesn't implement. A lot of work is being done on adding them to the tree-ssa branch, which hopefully will be merged into mainline gcc for 3.5.

      So, I figured I'd throw out some real numbers:

      It sounds like you're doing floating-point intensive number crunching code, which quite honestly is where icc should give the greatest benefit over gcc. On integer workloads they should be much closer. Number crunching gets a big boost from vectorization, and icc does automatic vectorization. GCC doesn't (though work is underway), and it won't use vector instructions at all unless you supply -mmmx, -msse, -msse2, and/or an -march option that specifies an appropriate CPU type. You can still get the advantage of vectorization if you're willing to code it explicitly.

      --
      Human/Ranger/Zangband
    3. Re:Real Timings by Elwood+P+Dowd · · Score: 3, Interesting

      This might sound like a stupid question, but are you showing us executable running times or compilation times?

      --

      There are no trails. There are no trees out here.
    4. Re:Real Timings by menscher · · Score: 3, Interesting
      This might sound like a stupid question, but are you showing us executable running times or compilation times?

      Execute times. Sorry if that wasn't clear. The program was fairly small, so compile times were considered insignificant.

  12. processor dispatch by DAldredge · · Score: 5, Informative

    Processor dispatch allows the compiler to generate multiple optimized code paths and dynamicaly select which optimized version of the routine to use based on the processor that the program is running on. This allows a single executiple to run with SSE/SSE2 support on the P4 and still run on processors that do not support SSE/SS2.

    I do not know what happens when the app is ran on AMD processors that support SSE/SSE2.

  13. Re:Question by AtrN · · Score: 4, Insightful
    Actually, yes I do. A little while ago I was doing some micro-optimizations (i.e. not algorithmic), using gcc 3.3 and icc v7 on FreeBSD and testing the results on a number of processors available to me: Athlon XP, PIII and PIV Xeons.

    With my problem/code the Intel compiler generated code ran faster on the Athlon XP than gcc 3.3's code using its XP switches and other "go fast" options. Using whole program optimization resulted in a program running considerably faster than the gcc 3.3 generated binary. icc is also stricter in some ways regarding syntax and C++ gets to use the EDG parser (if its still using it, can't see why not).

    The various posts here from people going "why bother" show a great deal of naivety. There are good reasons you want to use multiple compilers other than just the fact that icc can generate better code than gcc (in many circumstances, other tests may show the opposite result, YMMV). For starters its going to pick up a different set of errors. Now gcc is pretty good at producing useful warnings, a whole bunch better than Visual C++ for instance, but it isn't perfect, adding icc into your toolkit helps you find problems in your code. A more important reason however is to avoid the mono-culture introduced with everyone using gcc. Years ago we called it "all the worlds a VAX", then it became "all the worlds a Sun", now its "all the world's Linux (with gcc)". A bit of variation (in implementation, not interface) is a good thing.

  14. Awfully tenuous argument by 0x0d0a · · Score: 3, Insightful

    An AC above pointed out that Intel are part of the Trusted Computing group. This all reminds me of Ken Thompsons compiler trojan. (where he hacked a c compiler to add a backdoor whenever it is compiling "login".)

    So, what might icc add to the security functions of glibc? to gnupg, sshd, lsh?


    You're reaching pretty far with this argument. Intel is a damned large company with a lot of groups working on things and a lot of different opinions and people. They don't have to have a secret, nasty, ulterior motive, even if one group is working on something you don't like.

    You want to be paranoid about Intel? Give up -- they control the CPU. They could trojan you much more easily via the proecessor -- no reason to dick around with the compiler.

    Plus, look at the Trusted Computing Group membership list. Do you distrust all products from all of these companies?

    Let's see:

    * ARM is on there. You better avoid any embedded devices. They might be trojaned. Or using any devices in your system (drives, add-in cards) that have ARMs onboard.

    * ATI and NVidia are on there. Video cards are clearly out -- there are numerous standards that will let video cards push code to the processor, plus cards tend to have pretty much unstopped access to memory.

    * Fujitsu is on there. You want a trojan, a hard disk controller is a damned sweet place to put it.

    * Philips is on there. I hope you don't rely on CDs for anything. Who knows what they put in their reference CD drive controller code?

    * RSA is in there. A damned large number of companies license their prewritten libraries (and binary copies of the thing, as well). I hope you've never run Netscape Navigator 4.x, because if you did, RSA could be controlling your system, modifying binaries, etc.

    * Phoenix is on there. Boy, I hope you don't trust your BIOS for anything. You *are* using LinuxBIOS on a *completely* open-spec'd motherboard, right?

    Point is, trying to distrust huge companies because one small component of the company does something you dislike is simply a futile task. Maybe one day you can use all open-source and viewable software, but it isn't going to be in the next decade -- keep in mind all that controller hardware with unbounded privileges to all the goodies on your computer.

    Don't get me wrong. I like open source. I write open source. However, being irrationally fanatical about it is both stupid and counterproductive, and doesn't do diddly for the open source movement.

  15. Re:Why is this not modded up FUNNY? by irc.goatse.cx+troll · · Score: 2, Insightful

    Do you like paying $400 for a couple msecs? Hell, add it up over your programs lifespan and you might get a week or two if you're lucky.

    --
    Pain lasts, kid. Its how you know you're alive. Sometimes I think this growing up thing is just pain management-TheMaxx
  16. Definitely going to try out this one by sperling · · Score: 4, Informative

    We've tested Intel's c++ compiler for linux at work, and it's cut the full distributed rebuild time of our gameserver software from about 9 mins to 3 mins. That alone is more than enough reason to switch IMO.
    Performance-wise, it seems to have a slight edge over gcc, but this is subjective as I haven't really measured anything yet. Apart from the performance issues, I've found icc to be way more informative in its warnings and remarks than gcc. Unless you strictly believe in the GPL or are open-source only, I see no reason not to at least give it a try, it's a damned good piece of software.

    --
    The next great MMORPG.
  17. Re: Supporting various hardware by some+guy+I+know · · Score: 2, Funny
    The really interesting part is that the Intel's compiler supports Itanium.
    Yes, but does it support the Opteron?
    --
    Those who sacrifice security to condemn liberty deserve to repeat history or something. - Benjamin Santayana
  18. Re:lol by makapuf · · Score: 2, Funny

    It's ... a duck !

  19. But Have They Fixed The Bugs?! by Steve+Cox · · Score: 2, Informative

    I used the Windows version of the Intel compiler at work for quite a while, and it does produce some exceptionally fast code (and sometimes takes an exceptionally long time doing it).

    The problem? Since version 6 came out any software we compiled with it exhibited crashes that did not occur when we used another compiler on the same code.

    In the end we had to stop using it. Its a shame really because it was an excellent product (the only gripe being their Premier/Quad support website which was crap).

    Steve.

    1. Re:But Have They Fixed The Bugs?! by p3d0 · · Score: 2, Insightful

      You probably know this already, but the problem you describe could be because your code is not strictly ANSI-compliant (ie. it makes use of undefined behaviour). So it may not necessarily be the compiler's fault.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    2. Re:But Have They Fixed The Bugs?! by jjc2222 · · Score: 2, Insightful

      Have you verified that you're actually seeing compiler bugs? It's quite possible that using a different compiler exposes bugs in the code itself - bugs that just happened to be treated differently with your original compiler. It may also be an issue of standards compliance. Either way, it seems that it would be worthwhile for you to explore _why_ you get the crashes you do. It may be enlightening.

  20. Patches for compiling linux kernel by rleeuk · · Score: 3, Informative
  21. Re:Linux is their benchmark then by njchick · · Score: 3, Informative

    Because the extensions are good not just for speed. They improve code readability and make it easier to spot programming errors early. Also, they provide required functionality that is not standardized. Avoiding gcc extensions would mean rewriting some code in assembler for all architectures.

  22. 10-20% increases using 7.1 by blackcoot · · Score: 2, Interesting

    i haven't played with 8.0 yet, but using 7.1 i managed to get substantial (>20% overall) speedups. of course, this was with ipo turned on for almost everything which generated several megabytes worth of files per source file. i'm looking at playing with their fortran compiler, partially because it's a good excuse for me to play with fortran and partly because i'm fairly certain that it will be able squeeze some extra speed out of key algorithms. that said, even if the executables' speeds weren't substantially different, icc has some other nice features, built in openmp stuff, etc. and, of course, it's always good to have a second compiler's opinions on things.

  23. Re:Intel, great.. what about AMD ? by kermit6306 · · Score: 2, Informative

    They won't since there's no compiler team at AMD. There are AMD engineers that work on the GCC project. That's as close as you're going to get.
    I think ICC yields slightly better performance on AMD anyway.

  24. AMD picked it as the best by morcheeba · · Score: 2, Interesting

    AMD used version 7.0 to compile it's entries for SpecInt performance, and I'm guessing that they didn't just pick it because they thought it had a cute name.

    Compiler:
    Intel C++ 7.0 build 20021021Z
    Microsoft Visual Studio .NET 7.0.9466 (libraries)
    MicroQuill Smartheap Library 6.0

  25. Re:Optimize or architect for performance? by Haeleth · · Score: 2, Insightful
    The question I want to ask: why would you intentionally write source code whose object code can be significantly improved by optimizations?

    Let's consider a very basic example:
    {
    int i, j[1000];
    for (i = 0; i < 1000; i++)
    j[i] = foo();
    }
    If you read old C textbooks, they'll actually tell you to write the above code as something like
    /* Fill an array with the results of 1000 calls to foo() */
    {
    int *i, j[1000], *endptr;
    i = &j;
    endptr = i + 1000;
    while (i < endptr)
    *i++ = foo();
    }
    Why? Because this saves the program from having to calculate &j + i * sizeof(int) every iteration of the loop.

    Now, a modern optimising compiler is probably going to automatically detect that i is only used to index j, and will therefore automatically generate code equivalent to the second example from the first example.

    Do you see what I mean? Comments are no substitute for readable code. If an optimising compiler can make readable code run as fast as unreadable "optimised" code, then that is a thing worth having.
  26. Vectorization is probably the key by r6144 · · Score: 2, Interesting
    For numeric C code, automatic vectorization will often double or quadruple (if you use SSE) performance with automatic (or manual) vectorization, as some other post has said. Other factors, such as inter-procedural optimization, gcc's lavish use of stacks and imperfect SSE register allocation, helps very little.

    In one of my programs, icc7 actually produced slower code than gcc (at -march=pentium4, maximum optimization) because the most time-consuming loop was not automatically vectorized for some reason. The generated code for this loop (by both gcc and icc) are actually using x87 floating-point instructions (sse instructions are used in most other parts). gcc with -ffast-math generates reasonable code, while the icc-generated code have very long dependency chains, and is thus slower. The code in question is the sum of 9 products, so I think icc should be allowed to change the order of summation (anyway it defaults to non-strict floating-point), but it didn't do so automaticaly. Then I removed the dependency chain by hand by adding up partial results, and speed instantly doubled with icc (I didn't try gcc). Then I vectorized the code manually by using SSE intrinsics --- another 4x speedup (of course this would help gcc too, but I didn't try, either).

    The moral of the story is that it is still unwise to trust the compiler too much to optimize your code. If most of the time is spent on very little code, some manual vectorization and formula rearrangement really pays off, whatever compiler is used.