First of, I'm back. Yay!!! and I notice some changes on the site. Ok let's move on.
I've been using mingw with code::blocks for a while and sometimes I feel like it compiles too slow compared to Visual C++. So yesterday I tried downloading free compilers. Do you know what I found? Digital Mars and OpenWatcom, but these two are not any better. I downloaded Borland 5.5 and waaallaa!! super fast compilation. The problem is, its standard library is not updated.
So my question is; "What is your compiler of choice?" also you might want to share some compilation techniques.
PS: Obviously I'm on windows platform but you can share some thoughts on linux stuff.
I have to ask: what is too slow? Code::Blocks is an IDE, not a compiler. Visual C++ is both an IDE and a compiler. Same with Borland. Is the IDE too slow or the compiler?
I'm a Linux guy, but dabble with Windows on occasion. I like Visual C++ and Eclipse/Cygwin/GCC. Both work about the same for me, though I have to admit to being more comfortable with Eclipse, since that's my IDE of choice on Linux. The Windows-isms I'm forced into with Visual C++ makes it an uncomfortable fit.
First off, I'm fairly new here, so I don't know you, but welcome back anyway!
Next, I sometimes use Borland 5.5, which I really love using with the Scintilla Text Editor because it is fast, simple and small, but I mainly use Code::Blocks with the MinGW compiler. I have no Idea why I switched, all I know is that I did and I love it.
One question I have for you, which versions are you using (of Code::Blocks and MinGW)?
hmm, i never had any slow compilations with MinGW. Then again by the time I started using it, I knew a guy who modified it to have a parallel compilation within a single project. I'd give it to you guys but he hasn't kept up with the latest version of MinGW or GCC in general. It's about 3-4 years out dated by now.
I have to ask: what is too slow? Code::Blocks is an IDE, not a compiler. Visual C++ is both an IDE and a compiler. Same with Borland. Is the IDE too slow or the compiler?
Mingw compiler is too slow. Borland 5.5 commmand line tool so freaking fast in compiling and linking but not updated.
Danny Toledo wrote:
One question I have for you, which versions are you using (of Code::Blocks and MinGW)?
I use the latest code::blocks nightly build. March 6, 2011 7040 build version
MingW's windows port of gcc suite (4.5.0) and MS's C/++ compiler that comes with VC++ Express 2010, those are the latest and (according to wiki) obeys most of C/++ standards
-tried to download Borland 5.5, but too lazy to register, but I remembered old Borland products (Turbo C 1/2/3/4) being very good and fast (according to review articles I read a long time ago),
- as for their (actually Embarcadero's) modern products I think the RAD Studio IDE is as fast (or as slow) as Visual Studio 2008/10, and incredibly complex -not good for a beginner/casual coder
- I still use older MS product (Visual Studio 6) but have to put up with the warnings from Windows 7 :P -really fast but really old/ancient/archaic
p/s any proof/comparison you'd care to throw here? the ones I got from google was dated before 2005, not really convincing :-/
Hey again! (You should check out the new game I'm making! I know you liked the old one [I decided to revamp the engine])
On to your question. I have been using mingw with windows and gcc with ubuntu. Code::blocks on both. I love the IDE, except for a few things I wish I could change. But I haven't had any noticeable speed decreases between compilers.
I'll be sure to upload as soon as I find the disk I saved it on :O I haven't used it before he stopped updating sooo I'll look.
UPDATE: I went through my entire cd collection and couldn't find the disk. I still talk to the guy from time to time so I can ask him if he still has the source.
Hey again! (You should check out the new game I'm making! I know you liked the old one [I decided to revamp the engine])
Sure why, where can I find it?
Back on the topic, well Mingw is good except when I compile many source files. From my observation, compilation is not really that bad. The really slow process is the linking process of object files. If anyone of you here tried to compile wxWidgets application or something like that maybe you'd notice or maybe it's just me.
@blackcoder41: the old engine had a couple pretty interesting problems, it wasn't expandable, and it wasn't smooth. Soooo I redid it. Now it works *much* better.
Hold on I'll upload an updated version, it's about that time anyways.
edit: upload will have to wait until tomorrow, sorry. To tide you over, here's a screenshot:
I tend to use the GCC and Embarcadero (Borland) compilers, as I cannot get VS to install on my computer. (Apparently I'm one of the few for which it never will work... so I cannot use MSVC++.)
I use GNU GCC all the time and it's never slow on me. A little of subject here, but, do compilers use a bit of every execution core of the CPU? Basically, are compilers multi-threaded?
I use GNU GCC exclusively. It's free and it does well. If I'm on a Windows box, I setup a Linux VM and use it anyway. (I don't do any native Windows development.) I'm open to other options but this has been fulfilling my needs so far.
As for compilation times, there are a few tricks to save time. I'll briefly mention these:
1. Don't include headers that you don't need (yet). For example, if you only use a pointer or reference to a class, you can just forward declare it. Read up on #include <iosfwd> .
2. Make sure you are using a build system with the correct dependencies. There are many options for managing builds (make, imake, jam, ant, etc.). Some can determine dependencies for you but that takes time, as well...
3. There are design patterns/idioms that can greatly reduce coupling and result in changes not requiring full recompilation. This often [always?] involves an extra level of indirection so it isn't "free". Check out the Pimpl idiom and the bridge pattern for examples.
4. Components can often be built in parallel, if you have the resources to do so. Check out distmake.
@moorecm: Improving build times is a worthy exercise but is not the same as comparing the compilation speed of one compiler over another. If one compiler is faster than the other, improving the code is may or may not change the differential between the compile times.
I build with Sun Studio and with GCC on Solaris. GCC is much slower than the Sun compiler, but it also supports so many more features of the C++ language and, in execution speed, GCC walks all over the Sun compiler because Sun's STL is so bad. So the trade-off for me is: faster compiles vs. faster execution and more language features.
On Linux, the Clang C++ compiler is a lot faster than GCC. I don't have enough experience with it, and therefore do not trust it enough, to make it my regular compiler. But I have to say that I really like this compiler. (And it is available on Windows IIRC.)
My choice for compilers is limited to those supported by Boost. I would not recommend Borland, Digital Mars or Watcom because these are not tested/supported by the Boost developers. Their user base is just too small. There was work by Borland users to get fixes into Boost up until about 2008 but that work appears to have stopped.
Modern "Borland" (Embarcadero) C++ compilers are standards-compilant. They even use the Dinkumware STL by default, which, BTW, is superior to most of the crap GCC uses.
If you are failing to build/use Boost on a pre-standard C++ compiler (like Borland 5.5), then you deserve to get bitten. Use a modern compiler, even if Borland AKA Embarcadero makes it.