-   Linux - Software (
-   -   best c++ Compiler with IDE (

learner9 08-08-2009 07:31 AM

best c++ Compiler with IDE
What is the best C++ Compiler with IDE?

johnsfine 08-08-2009 07:50 AM


Originally Posted by learner9 (Post 3635666)
What is the best C++ Compiler with IDE?

Almost everything in Linux is more layered than your question assumes.

There is one most popular C++ compiler in Linux (GCC) which holds such a large fraction of "market" for free C++ compilers that others aren't really worth considering.

There are many IDEs for Linux. Each of them can be used with GCC. I'm pretty sure most of them could be used with other compilers as well. So your selection of a C++ compiler and your selection of an IDE are pretty independent.

KDevelop is one of the popular choices for an IDE. I haven't tried any of the others enough to make a meaningful comparison.

Intel makes and sells a C++ compiler for Linux (and a similar one for Windows) that is probably better than GCC. Certainly with a simple set of command line switches and no special optimization attributes in the source code, the Intel compiler will generate significantly better object code. It is also bundled with a math library (exp, log, trig functions, etc.) that is significantly better than the GNU math library. So if price is not a factor in selecting "best" the Intel C++ compiler is probably best.

GCC gives very advanced programmers a lot more control of inlining and aliasing and code "temperature" and other factors that effect the performance of the final code, using command line switches to tweak optimization and using attributes within the source code to guide the optimizer.

The Intel compiler recognizes all those GCC switches and attributes, but generally ignores them and optimizes according to its built in rules regardless of what the programmer tries to tweak. With enough effort using optimization attributes, etc. you can often get GCC to generate better 64 bit code than there is any way to get the Intel C++ compiler to generate. I think in 32 bit Intel starts so far ahead that no tweaking could close the gap.

So Intel is clearly a better compiler (ignoring price) for ordinary programmers who don't have the skill nor time to tweak all those things. GCC might be better for those who really need to achieve best performance 64 bit code even at large extra effort.

Of course most people asking in this forum assume free, so GCC is the only C++ compiler worth considering and your choices are just on the IDE side.

Another detail, in case anyone really cares about the GCC/Intel comparison:

The Intel compiler itself is a 32 bit program even when generating 64 bit code. That makes it run a little faster (compilers internally use a lot of pointers and thus in 32 bit mode they have fewer cache misses and run faster). But 32 bit mode is limited in the complexity of code that it can compile and optimize. Large projects may have modules that are too complex for a 32 bit compiler to optimize or even too complex for it to compile at all.

GCC can be configured selecting 32 bit or 64 bit for the compiler itself independent of selecting 32 bit or 64 bit for the target programs. Typically one would use a 64 bit GCC to compile for 64 bit and that contributes to GCC compiling slower than Intel. You could build a 32 bit GCC that would run on a 64 bit Linux to compile 64 bit programs, but unless you built that 32 bit GCC itself with the Intel compiler, it would run slower because GCC isn't as good at generating 32 bit x86 as it is at x86_64. So the bottom line for 64 bit code is that GCC takes longer to compile but has higher limits on the complexity of code it can compile.

f14f21 08-08-2009 09:35 AM

thanx johnsfine
ur guidance about x64,x32,gcc was very helpful

learner9 08-10-2009 02:39 AM


mf93 08-10-2009 09:03 AM

wow John that was really helpful, I've been wondering about alternative linux compilers for a while...
anyway for learner- the IDE I like is Code::Blocks personally. It has built in support for other library extensions such as FLUID, OpenGL, GTK+, etc.

All times are GMT -5. The time now is 04:08 PM.