GNU GCC is a very common compiler, but it seems like almost no one uses it for bigger projects like AAA games. To me, it's works just fine, never had a problem with it. But I wonder why all AAA games seem to use commercial compilers such as Intel Studio? Why does it matter? GNU GCC also optimizes the code for all systems rather then just Intel, so why do they bother with things such as Intel Studio?
-
\$\begingroup\$ GCC was a very common compiler before LLVM/Clang came around, or saying it with clang: "gcc? Did you mean clang?" ;) \$\endgroup\$– Maik SemderCommented May 15, 2013 at 6:47
-
\$\begingroup\$ What does clang do? Is it a compiler? If so is it better? O_o \$\endgroup\$– LiquidFelineCommented May 15, 2013 at 6:50
-
\$\begingroup\$ Clang is a c/c++ frontend for a compiler platform called llvm. Yes, its better in many ways. For starters it shows the exact error in a macro, not just the line where the macro was called. It makes stupid intelli sense look even more stupid, since it makes it easy to access the AST tree, no need for an extra parser. Partial code compilation, the list is long, take a look at it, its worth it :) \$\endgroup\$– Maik SemderCommented May 15, 2013 at 7:00
3 Answers
Intel's compiler is just a different compiler. GCC++ and VC++ produce production quality code, just as well as Intel's ICC does. The main difference lies in 4 key areas:
- a) Features supported (mostly differing on C++11 features)
- b) Executable size
- c) Runtime
- d) Compile time
When you're trying to squeeze every last bit of performance out of (mostly) Intel CPU's, AAA studios are willing to pay for that and some spring for ICC. See here for a great anecdotal story. Pay attention to his drawbacks section as well, where ICC is accused of running less-than-well on non-genuine Intel instruction set CPU's (e.g. AMD's).
Many non-PC platforms, including some consoles and handhelds, use a modified GCC as their primary/only compiler.
On the PC, most game dev houses just use Visual Studio's compiler. The choice of compiler typically has little impact on runtime speed compared to engine design and graphics, they all paid for Visual Studio anyway due to its feature set as an IDE, GCC is comparatively harder to install and get started with. and it doesn't do much to improve iteration time and productivity. There's just not a compelling enough of a reason to use GCC compared to the alternatives that everyone is already invested in.
-
\$\begingroup\$ It's not just that GCC is a little harder to get started with, but MinGW requires shipping with a DLL if your application is multithreaded -- GCC uses a different exception mechanism than SEH which makes the DLL necessary on Windows. \$\endgroup\$ Commented May 15, 2013 at 2:32
-
1\$\begingroup\$ To provide an example, Sony moved their PS3 primary compiler from their internal compiler to GCC because it was deemed better. And there's no shortage of AAA titles released on PS3. \$\endgroup\$– KaganarCommented May 20, 2013 at 15:34
-
\$\begingroup\$ The downside is that these platform-specific GCC's are usually severely out-of-date, usually pre-GPLv3 and hence pre-C++11 and also missing a lot of recent diagnostics and performance work. :/ This rejection of newer GCC by many vendors could be another reason a lot of game developers just avoid GCC if they can; they might have an unfair view of its state given experience with vendor toolchains. Look at the frequent Clang comparisons on Apple platforms where Clang 3.1 or so is compared with GCC 4.2. (I'm a Clang fan, but the comparisons are generally unfair.) \$\endgroup\$ Commented May 20, 2013 at 17:22
Yes, it can be used for AA games.
The reason almost every AAA games out there (if not all) use commercial compilers is the fact that commercial products usually have support and you can complain or get help 24/7 or just ASAP when dealing with any problem you might have and in the AAA industry, times means money. Big teams and companies, specially the latter, don't want to rely on the community when big money is at stake. It's better to invest in support by contract.
On the other hand, the engines rely on SDKs. If the SDK don't support a compiler, it means that you are on your own and it's not profitable to do the workaround.
Finally, optimization. If you know that a lot of players use Intel, the heck you want to deliver your game graciously for them.
-
1\$\begingroup\$ fyi our company with one billion turnaround every year is able toupport gcc and other gnu dev tools at premium level. \$\endgroup\$– lzapCommented Jun 8, 2013 at 15:50