Link to home
Start Free TrialLog in
Avatar of Robert Silver
Robert SilverFlag for United States of America

asked on

Regarding C++ Compilers - Which is best and most economical for Optimization of code???

I was told that Intel C++ compiler is the best but it is trial ware at least for mobile devices and was told its $1,000USD after 30 days
I have used g++ said to also provide good optimization.  How do they compare?
Are there better free optimizing C++ compilers other than g++ ? Is part of what you are paying for in the $1,000USD the associated  shared libraries??
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

I don't know about the $1000 but a possibly bigger issue is linking with other libraries.  g++ is standard on Linux but Visual C++ is standard on Windows.  I don't think they are interchangeable.  

I think it depends on what you are doing.  A lot of major software uses both compilers so the results can be run on different systems.
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of phoffric
phoffric

Regarding Clang, last year's research by an intern resulted in his statement that for long builds, Clang is much faster than g++. It also produced more intelligible error messages (except for Boost errors). However, he could not get the Clang built executable to run nearly as fast as when using g++.
Dave said..
>> g++ is standard on Linux but Visual C++ is standard on Windows.  I don't think they are interchangeable.  

They are sometimes and sometimes not interchangeable. I can't generalize since I only know about my most recent project where we have a number of third party libraries. Most of the time in my own experience, I had no problem building a library with g++ or gcc and combining them into an Intel built executable.

But one guy did spend weeks trying to get a recent third party library to properly integrate due the mixture.
>> They are sometimes and sometimes not interchangeable.
If you are talking about whether you can share libraries between them, it all comes down to whether the ABI (Application Binary Interfaces) between the final object code is compatible. Different compilers/linker use, for example, different name mangling algorithms and that means most compilers are not ABI compatible unless they have a compatibility mode that can be enabled. This is just one example of how an ABI may not be compatible.