I don’t have the ICC around here, but I think that’s anyway not the problem, which compiler is faster on what kind of problem. Both of them have pretty smart optimizations built in and both have cases where they totally fail to do something smart.
Additionally to that, Intel intentionally messes with AMD processors. I won’t trust any corporation product, that does not have your best interest in mind but their best interest.
It was like that 2005: Does Intel’s compiler cripple AMD performance?
It was like that 2010: Agner`s CPU blog
It is still going on: Will Intel be forced to remove the “cripple AMD” function from their compiler? • /r/programming
So. Please think about that.
And now my two cents to this issue. GCC is not only a very good compiler, it is also valuable free software. Software that you can install anywhere, where you have no dependency on some will-fare of a big corporation. You just “buy” an honest tool.
And you are not victim of some big corporate fuckery.
This is not a real choice, if you ask me. And if you are coding something that needs to be optimized on the edge, you better take a human doing that instead betting on a compiler, that messes up on Assembly level anyway. Really they do.
They are quite stunning for mindless little machines, those compilers, but they know nothing about code. They just follow some rules, rules that you can learn and apply yourself in just one well invested morning about general coding practices for optimization.
And I want my code to compile anywhere and be portable to other platforms, I want my compiler to be transparent for me, so that I can take a look into it, to see why it messes up and if I can patch that in a way.
All this you can’t do with the ICC. Fuck the one or two cases when ICC is actually faster than GCC, most of the time it will not be. I have seen GCCs code and it’s not bad for a mindless machine. I trust that thing. Linux is made with that.
It runs on Linux, on Intel, on Arm, on Atmel processors. It is the one and big reliable compiler that works everywhere and gives predictable results. And not some corporation fuckery that intentionally messes up my AMD processor.
Really? Pay money to get fucked? Lose your independence and freedom for one or two simple cases of “optimization” that are so doctored, no sane coder that I know would write code like that in the first place? No coder I know would put his bet on that wager that the compiler will make it all right in the end? Like Steiner?
I do not bet. If I want to bet I go to the horses.
I want clean code. And clean means reliable products, no corp fuckery, no licence bullshit and I want to be free to use my tools anywhere on all platforms I need it and under all circumstances. If I want a diva that has a nice frill on a feature, I’d go to the opera.
But I don’t install it in my toolbox.
If I’m a carpenter I want a good hammer. A hammer working on every kind of nail, not just the ones that comes from the same manufacturer like the hammer. Or a hammer that has a licence on it, that if you dare to change it or use an other grip or an other head they will sue the shit out of you for that? Show me the carpenter that wouldn’t be rolling on the floor, laughing? Who are we coders, that we allow corporations to come to us with things like that and we still accept that and buy their crap? Really, that’s crap. That’s the lowest of the lowest standard that I can imagine, no other craft accepts conditions that we face and that many of us still find “acceptable”. I do not find it even funny, that they try to do that, I feel deeply insulted and if you do not, that would be for me something to think about. Who am I and who are they? And where do I stand? Where do I want to go?
The ICC is widely criticized over 10 years now. It is not the industry standard. It won’t work well on Linux anyway. Just kick it.
Use GCC.
But that’s just my two cents. And that is my decision. I once worked with non-free tools that promised the blue from the sky for me. It was expensive and painful to get rid of that shit in my projects and to free myself from that.
I am free since then and I won’t give up my freedom for no money of the world.
And you are serious? You want to pay them to take your freedom away? If you think, that’s a smart idea, I humbly beg to differ on that. R U mad, bro?
If there ever has been a valid and powerful argument against proprietary corporate closed source tools and how they exploit their power and misuse it against us, and the public benefit, freedom, and transparence of open source tools, it would be the case GCC vs ICC.
And this is a point not only important for personal use, not only for small companies but also for every global player megacorp out there. You can’t let someone, that has been proven to misuse his power over at least 15 years and that is not changing his policy about this abuse of trust of their clients let dictate how the programs you create work on certain hardware or work not.
Why does Google forbid any Windows system run in their company? Because they know that they are misusing their power. Because I’m quite sure, there already have been breaches and interest conflicts. And the same can and will happen on compiler level. It is even worse there.
There have been stories about misuse of “features” inside of compilers, proven horror stories about real sabotage that can be done by this kind of software, so to use this tool on the base that the manufacturer already has shown, that he is capable to do so, is ongoing with this policy and most likely what we know of that is only the tip of the iceberg, you can’t let such a corporation control the future of your company or your products.
It is not just a question of trust. But I like to have open source, so I can see that I even don’t need to trust anyone about promises of success or failure, but that I can personally at every time can take a look at that - and change it, if I need to.
You might want to read about the Ken Thompson Hack before you decide to use a closed source single company controlled compiler. And this is not the only case of compiler-level breach of security and trust. This is very critical technology and it has happened already several times and with the ongoing AMD hack, Intel has proven that they are totally capable to do that and willing to actually launch such attacks.
Well, they are caught red handed. They do as if that doesn’t matter. Since fifteen years. What can I say? Consequences?
You simply can’t use closed source software there. Well, you can, but someone has to warn you, that this is deadly.
One thing it buys you is a particular balance between performance and convenience.
In my line of work, a computer is primarily a device to work out numbers in a reasonable amount of time. We can think about what the machine looks like, how it feels to use it, how elegantly designed its software is, and all those things. At the end of the day, I'd really just like my numbers thank you, and if I have to write some programs to obtain them, then that is what I will do.
This evening, I was after the Singular value decomposition of a 2400 by 2400 matrix, and I'll be wanting quite a few of them in days to come. The tools at my disposal are a quadcore i7-2600 processor, ICC, GCC, the Ubuntu Linux package repository, and general Internet access. Since computing the SVD is a LAPACK library call, I've slapped together a 300-line program that just reads my input data (it's in a foofy nonstandard format), calls LAPACK for the answer, and organizes the results in some files.
The ICC package comes with Intel's Math Kernel Library, which I was in the middle of using, so it was easy to obtain a timing from the function call. It takes about 11.6 seconds on my system.
The program is just a little chunk of linear algebra, so in the interest of making a quick comparison, I took out GNU Scientific Library and OpenBLAS, and spent a handful of minutes on modifications to conform with the GSL programming interface. The decomposition call I'm interested in ran on a single core out of my 4 available ones, and took 183.8 seconds.
It seemed unreasonable to compare a threaded library with a combination of sequential ones, so I also installed liblapack and ATLAS from the repositories, and twiddled the calling conventions in the program again. This got me a timing of 101.1 seconds. The CPU load graph shows that only parts of the computation were run in parallel, but it's what came out of the prepackaged libraries without any tweaking or surgery. At least it was better than the GSL test.
Combining these observations and my hourly salary, we can derive that ICC will break even (and effectively have paid for itself) in just short of 900 function calls like this.
Could I get by with free and open source tools?
Sure. ATLAS does better when you compile it specifically for the target architecture, and I could try PLASMA, which might give me comparable performance. Didn't find a prebuilt package for it, don't want to spend 4 hours on configuring and rebuilding it every time it’s updated.
Would my program benefit from free and open source tools?
Sure, it wouldn't require ICC to build out-of-the-box that way. I'm not planning to package and release anything, though - my code is trivial, and besides, I just need the output.
For me, ICC is worth buying for the scenarios when it (and its companion libraries) present the shortest, painless time to solution. Comparable results can technically be obtained by other means, but that takes additional time and effort.
I’ll switch when it doesn't help me do my job, but for the moment it’s effective, and not prohibitively expensive.