正好,今天看到一篇linux下g++和Intel c++ compiler的评测文章(in english)。g++是GCC(Gnu Compiler Collection)中的c++ compiler,自然是gpl的free, intel cpp compiler在linux下有non-commercial license, 就是说,如果你的工作不以盈利为目的,它是免费的。自然,gcc的portability 更好,不过如果只是x86构架, intel的compiler也是一个不错的选择
原文:
http://www.coyotegulch.com/reviews/linux_compilers/原文的结论部分:
Quote:
Conclusions
So which compiler is better?
Like Einstein, I have to say the answer is relative. If you use systems based on the Pentium 4 architecture, Intel C++ is an excellent choice. If you need OpenMP, Intel is your only choice given GCC's lack of this feature. But, as I said before, Intel's compiler is not a drop-in replacement for GCC.
Compiling code is a complicated business, and it isn't humanly possible to write a perfect compiler that digests everything programmers throw at it. I do have some reports of code that compiles incorrectly with Intel C++; on the other hand, I have such reports and experiences with every compiler I've ever used, including GCC. While people complain that corporations are slow to fix bugs, the "pay up or do it yourself" attitude of many GCC developers can be equally frustrating. And not everyone is comfortable digging through bug databases looking for patches.
If anything, these tests show how free software rivals -- and sometimes exceeds -- the quality of its commercial counterparts. Perhaps GCC's greatest strength is its cross-platform portability; it is arguably the most ubiquitous piece of software in the world, running on everything from mainframes to embedded systems. For obvious reasons, Intel's compiler is specific and limited to their processors.
As for the religious war over free and proprietary software: I've written a few million lines of code over the decades, and only under GNU/Linux have I had source code for my compiler. Perusing the GCC source can be very educational -- but in the end, many developers don't have the time to do compiler hacking when they're trying to write code for customers. So long as GCC exists and is free, I don't see any problem with companies like Intel (and Borland) producing closed-source tools we can use to develop free projects.
Your mileage and religious fervor on this issue may, of course, vary. I'm just glad we have a choice when it comes to development tools.
"Choice" is the key word here -- choice is good, be it in democracy or software. Intel provides a useful alternative to GCC for development on ia32 systems. One compiler might have a great environment for developing GUI code; another compiler might generate fast code. GPL-like freedom may be important -- or not -- as individual circumstances dictate.
As always, I look forward to considered comments.
p.s., lain说的cygwin,是windows环境下的一个linux模拟层以及运行在这个模拟层上的linux core utilities,其中就有g++
[ 此贴被galilette在2004-09-19 11:57重新编辑 ]