| Free Compilers |
About GCC (last update 6-3-2009)
Many of the free C compilers listed here are ports of
GCC, which is the standard compiler
that comes with all Linux distributions. GCC used to stand for the GNU
C Compiler, but it now stands for the GNU Compiler Collection since
it has grown to include front-ends for C, C++, Objective C, Fortran 95,
Java, and Ada, as well as other
front-ends.
GCC is highly portable, very robust, and was
started over 20 years ago by the Free
Software Foundation (FSF). In fact, Richard Stallman, the founder
of the FSF, published his thoughts on
on
the FSF after 20 years in 2004.
GCC has been called "the most important piece of software in the world" by
Arthur Griffith, author of
GCC:
The Complete Reference.
As of this writing, GCC is at version
4.4.0, but the standard GCC included with
MinGW is still
just 3.4.5
(though you
can get an alpha release of gcc 4.3 at the sourceforge MinGW download site.).
GCC 4.X
GCC version 4.X
(first released 4-20-05, is a major overhaul of GCC.
It includes
Fortran 95 support,
faster
x87 math intrinsics from Uros Bizjak,
autovectorization, and most significantly,
a new, more all-encompassing way to represent the language being compiled
called Static Single
Assignment (SSA), which was merged into the main GCC development line
on May 13, 2003. This method converts each high-level language into
a common generic
language tree
which can then use a common optimizer across all languages.
C-Net has put up a good preview article on GCC 4.0.
By the way, for you Fortran fans, GCC compiles
Fortran 77 and 95 (as of 4.X) directly to native assembler code now
(it has for some time)--not to C code.
BENCHMARKS
GNU maintains a GCC benchmark page which has links to several independent benchmarks of GCC.
Also see my Win32 Compiler Comparison
or Scott Robert Ladd's GCC 4.0 Review for some more dated benchmark results.
You can also get a gauge on how well GCC does by looking through
SPEC benchmarks and checking the scores and the compilers used in each case (click on the "CPU 2006 Search Form" link near the bottom of the page).
Embarcadero (was Borland) (last update 5-31-2009)
Embarcadero
is the latest owner of the original Borland C++ compiler
as of July 2008
They still offer version 5.5 (released in August of 2000)
of the Borland C++ compiler for free download,
as well as a trial version of their latest commercial compiler.
The obvious downside is that this compiler dates back to 2000,
but it does install painlessly and doesn't take up a lot of space
on your hard drive, which is remniscent of Turbo C.
In fact, if you are used to the old Borland Turbo C way of
doing things, you should feel right at home with this compiler. This
free version does
not come with an integrated development environment (IDE).
Everything must be done from the command line.
Also, the license does not allow for commercial software development (i.e.
you cannot sell the software that you develop with this compiler).
The included documentation is
thorough and easy to follow. Unfortunately, this free version of
Borland's compiler generally produces the slowest running executables
according to my Win32 Compiler Comparison
Ch (last update 5-31-2009)
Ch is a cross-platform, C/C++ interpreter from softintegration.com. It touts
itself as "an embeddable C/C++ interpreter for cross-platform scripting, shell programming, 2D/3D plotting, numerical computing, and embedded scripting."
I have not tried it, but the user testimonials
page has some convincing endorsements. The standard edition is free for
personal and commercial use. The professional edition, which has
built-in plotting support, is $500 for non-academic use. There
are also several toolkits for numerical analysis and web programming.
Cygwin (last update 5-31-2009)
The Cygwin Project provides
a Linux-like environment for Windows, including the cygwin DLL and
a ton of linux packages
which have been ported to cygwin, including
gcc 4.3.2. Cygwin
and works with both 32-bit and
64-bit versions of Windows, though support for Windows Me/98/95 will
be discontinued with v1.7.0 (in beta test as of 5-31-09).
It is a very popular package for those wishing to port Linux apps to
Windows.
If you do not have a lot of Linux experience and just want a Windows
compiler, I do not recommend using Cygwin.
Digital Mars (last update 5-31-2009)
This is one of three free C compilers not ported from GNU C. It
used to be Zortech C++ and then Symantec C++. Now it is
the Digital
Mars C/C++ Compilers by
Walter Bright.
This compiler (on v8.5 as of May 2009) has a reasonable footprint and
installs painlessly, and, thanks to some quick work by the author,
it flawlessly compiled all of the code in my
Win32 Compiler Comparison.
Digital Mars generates "Win32, Win16, DOS16 and DOS32" exe's
(though the development environment is Win32 only).
The Digital Mars web pages
have lots of interesting links (e.g. Walter Bright's new
D programming
language), and they are worth checking out.
DJGPP (last update 6-3-2009)
Another port of the GNU-C compiler to MS-DOS is DJ Delorie's port,
known as DJGPP (DJ's GNU Programming
Platform). I used this
compiler way back in the MS-DOS days before MS Windows took hold.
It's strength is generating
32-bit DOS applications, but with RSXNTDJ (RSXNT for DJGPP), it can
be used to create Win32 apps like EMX/RSXNT. The disadvantage
(compared to EMX/RSXNT, for example) is that
the compiler and other tools are distributed in MS-DOS 32-bit format
instead of Win32 format, and this means that they run more slowly on
a Windows 95/NT
system. Go to DJ's web site
for all kinds of information on GNU, C compilers, etc.
EMX/RSXNT (last update 6-1-2009)
RSXNT, developed by Rainer Schnitker, appears to be defunct.
Rainer Schnitker's home page for his port of GNU C to Win32 has now
gone missing, and he hasn't re-surfaced in a google search as of
2009. RSXNT is a solid port of GCC to the Win32 environment, but I
started using MinGW32 instead
back in September 2002. MinGW is actively supported.
One advantage to RSXNT is the capability to
create a single .exe file which will run in both
native Win32 mode and in MS-DOS (with a couple of support files, and
assuming that the code is a "console" application which has no Win32 calls).
This simplifies code maintenance if you are developing for a mixed
environment which includes some very old PC's. Otherwise,
I would use MinGW.
Click here to get the RSXNT compiler
(based on gcc 2.7.2) and install instructions from my web server.
I've designed my distribution
to have an install feel more like MinGW (a single directory tree rather
than the three that Rainer had his distribution set up for).
Intel (last update 6-3-2009)
They're not Win32 compilers, but Intel does offer their
Linux
compilers (C, C++, and FORTRAN) and other Linux development tools
to non-commercial developers free of charge.
They are offering 11.0 as of May 2009. You have to provide
an e-mail address to get the software,
and it's only for non-commercial development.
Read more about Intel in the commercial compilers column
on this page.
Lcc-win32/64 (last update 6-4-2009)
Lcc-win32 is a Win32 C compiler based on
lcc, a
retargetable compiler authored by
Christopher Fraser and David Hanson at AT&T.
The lcc compiler was ported to Win32/64 and bundled with tools
and documentation and called lcc-win32/64 by Jacob Navia.
It is worth noting that lcc and lcc-win32 are different compilers
and have different licensing agreements. Lcc is free for personal
and commercial use, while lcc-win32/64 is free only for personal use.
The original lcc-win32
home page seems to have some broken links, but you can
find mirror sites by Googling win32hlp.exe, for example, which lead me to
this mirror in Germany, where you can find some of the 2003 downloads of lcc-win32,
including the FORTRAN compiler.
Navia now
works for Q Solutions which offer up-to-date versions of
lcc-win32 and lcc-win64 free for private use
(as far as I can tell) or for sale for full
commercial development.
If the lcc-win32 licensing scheme doesn't appeal to you, you might try
Pelles C, which is also based on
lcc, offers
Win32 and 64-bit versions,
has no licensing restrictions, and comes with a free IDE as well.
Q-solutions also offers an IDE (QIDE), but I believe it only comes with the
version that you buy.
I tried lcc-win32 out briefly back on version 3.0.
You can see performance results in my Win32
Compiler Comparison.
It was easy to set up, had a small footprint, compiled code very quickly,
and came with a nice text editor and a Win32 documentation file,
though the Win32 doc file is quite old (1996)
and does not include recent Win32 API's.
(A better place for Win32 API's is msdn.microsoft.com.)
Microsoft (last update 6-4-2009)
Microsoft's offers free downloads at their
Visual Studio Express Editions Download Page, which includes
Visual C++ 2008 Express Edition, along with Visual Basic, C#, etc. The download page says
this:
To get started today, select an Express Edition product from the list
below. You should run WindowsUpdate to ensure your computer is
up-to-date before you install any Express Edition. Remember, Express
Editions are not the complete Visual Studio product, but are tools
designed for students and hobbyists.
Hard-core hobbyists and professional developers should get a complete
edition of Visual Studio. Free trials are available for download before
you decide to buy.
|
... and this page talks about Visual C++ in particular ...
|
Visual C++ 2008 Express Edition provides a complete integrated
development and debugging environment making it the easiest way to
create powerful applications using the C/C++ language. Visual
C++Express Edition also contains an enhanced version of the C/C++
optimizing compiler for the fastest executables. Best of all, the
Visual C++ Express Edition is completely free!
|
MinGW-32/64 (last update 2-24-2010)
If you don't need the Linux/Unix API provided
by Cygwin, you can get a GCC port from
the MinGW Page for a "Minimalist"
(i.e. not so unix-like and more Win32-like) implementation of GCC
under Windows.
Start with the MinGW Getting Started page.
You can then download and install more recent individual components for GCC if
you like, e.g.
simply extract the non-source .tar.gz files from a more recent GCC candidate
package from the Package List into the MinGW directory tree.
The GCC version standard with MinGW is still 3.4.5. MinGW has been
slow to standardize on GCC 4.x because of regression issues between
GCC and Windows. MinGW provides a
GCC Release Status page
maintained by
Aaron W. LaFramboise.
A Win64 (64-bit) version of MinGW
is also available on Sourceforge. I downloaded the sezero distribution,
unpacked it into c:\mingw64, put c:\mingw64\bin in my path and re-named the .exe files
to their small names and was off and running. The only issues I'm having are that the
environment variable for the library path doesn't seem to work, and there is no crt_noglob.o
file for those cases where I don't want command argument globbing
(I haven't actually tested that), but I was still able to recompile thousands of
lines of source in just a few minutes. Here are my first benchmarks under Windows 7.
I've been using MinGW (32-bit) as my main compiler since September 2002
(when I switched from RSXNT).
MinGW comes with g77 for compiling FORTRAN 77, and version 4.x
of GCC supports Fortran 95.
I have my own
MinGW/Gnu C Tips page with
more information and good links about MinGW.
MinGW was spotlighted in 2005 by Sourceforge.
Miracle C (last update 6-4-2009)
The Miracle C compiler, authored
by Tadeusz Szocik,
isn't quite free and only compiles traditional ANSI C programs
(it does not include any Win32 headers or libraries). But the shareware
fee is only $19, it has a small footprint (1 MB), it installed and uninstalled
flawlessly in Win XP, and it comes
with an integrated development environment
(workbench), so I thought it at least deserved a blurb.
Pelles C (last update 6-4-2009)
Pelles C is
"a complete development kit for Windows and Pocket PC" centered around
an optimizing C compiler based on
lcc
(not lcc-win32/64). Both Win32
and Win64 versions are available and are being actively maintained.
I have yet to try it out, but the integrated development environment
(IDE) screenshots on the website look pretty good. This is probably
a very good choice for people who want to start programming Windows.
Unlike lcc-win32/64, which is free for
personal use, but not for professional use, Pelles C is free for
both personal and commercial use since it is based on the original
lcc.
I have received several positive
comments on it via e-mail, an example of which (from 12-5-04)
is shown below (though I'm not sure why the need for a command
box should be seen as a drawback ;-).
|
...I find [it] very useful. It compiles very fast executables and
very tight code. Well-made project management completely
eradicates the need for a command box, and yes, it does PocketPC, WinCE,
and some other cell phones just fine (I have tested them on the
actual systems). It has everything from DOS16, which I used for some time
with Microsoft's QuickBASIC to make some fairly complex programs, to WIN64,
which I have yet to test...I have to say it's the best compiler I've ever used
(and I've used quite a few)...
|
Watcom (last update 6-4-2009)
Open Watcom C/C++ and Fortran is
up to version 1.8 (February 2009)
with support for DOS, Win32, Linux, and O/S 2.
I have not had a chance to download
and install it. Any feedback on it would be welcome.
An excellent resource for Watcom's compiler is
Paul Hsieh's
Watcom C/C++ page.
|
| |
| Commercial Compilers |
Embarcadero (was Borland) (last update 7-25-2009)
I used Borland back in my MS-DOS days when they made Turbo C, and
that compiler was ahead of it's time--small footprint, fast,
conformed to the latest ANSI standards, compiled everything flawlessly,
and had lots of handy library functions for DOS programmers. It was
only when I needed a clean 32-bit compiler that I switched to
DJGPP's GNU C (see DJGPP section) in the late 1980's and early 1990's.
Borland's compiler is now owned by
Embarcadero as of July 2008
and is called
C++Builder
(2009 edition as of July 2009).
There is a
FAQ page and a
product edition page. Prices for the professional, enterprise, and
architect editions are $900, $2000, and $3500, respectively.
A free version is still available--see the freeware compiler column.
Ch (last update 7-25-2009)
Ch (v6.1 as of July 2009) is a cross-platform, C/C++ interpreter from softintegration.com. It touts
itself as "an embeddable C/C++ interpreter for cross-platform scripting,
shell programming, 2D/3D plotting, numerical computing, and
embedded scripting."
I have not tried it, but the
user testimonials page
has some convincing endorsements. The standard edition is free for
personal and commercial use. The professional edition, which has
built-in plotting support, is $500. Ch supports Win32 and Win64 as
well as several other platforms (linux, Mac OS X, Solaris).
There are also several toolkits for numerical analysis and web programming.
CodePlay (last update 7-25-2009)
Founded in 1999, CodePlay continues to offer their
VectorC compiler
for Windows (v2.1) under their "Legacy Products" page. They have a
FAQ page and a
benchmark page for VectorC.
Though the benchmark page is somewhat dated (I should talk!),
it is interesting because it provides
full source code plus the compiled assembler code for all of the examples.
CodePlay also offers tools such as their
Sieve C++ system which layers on top of VectorC to
support multicore platforms.
CodePlay VectorC also supports the Playstation 2 platform.
The VectorC PC compiler has
several prices, including professional ($800) and special
($80), which is presumably targeted at students and/or amateurs.
Comeau (last update 7-25-2009)
Comeau Computing offers
a C++ front-end (v4.3.10.1 as of July 2008) which converts C++ to C, which is
then compiled by a separate back-end. Currently, the Win32 port supports
VC++ 7.0, Borland, Metrowerks, MinGW, lcc-win32 and Digital Mars backends.
Comeau's C++ front end is also available on a wide number of other platforms, though support
for Win64 is not mentioned, and many of the web pages seem a
bit dated. The license runs $50.
I have not tried it out.
Intel (last update 6-3-2009)
Intel's latest C++ compiler release is 11.0 and fully supports their latest processors.
I have not tested it, but I have no doubt it performs well based
on SPEC CPU benchmarks.
Lcc-win32/64 (last update 6-4-2009)
Jacob Navia, through
Q Software Solutions,
now offers commercial
versions of lcc-win32 and lcc-win64.
The prices
run from 40 euros for the base system to 70 euros for the
full system.
The change log shows active development through 2009. I'm not
sure what the difference between
the commercial version of this product and the
the freely downloadable version is, but
it is pointed out in a couple of places that the free version is only
for private use.
Freescale (was Metrowerks) (last update 7-26-2009)
The CodeWarrior Development Tools which used to be
maintained by Metrowerks are now owned by
Freescale, and support for a Windows
version seems to have been dropped, though
googling codewarrior for windows seems to
come up with links where an older version can be downloaded for free.
Microsoft (last update 7-26-2009)
Microsoft's professional version of C/C++ for Windows is now called
Visual Studio 2008 Professional and can be found along
with their free Visual C++ 2008 Express Edition on their
web download page. This seems far simpler than in the
past, when they offered multiple flavors. The Visual Studio 2008
Professional goes for $550 as an upgrade and $800 when buying a full
version.
Note that I've benchmarked the older
Visual C 6.0 in my (dated) Win32 Compiler
Comparison.
PathScale (last update 7-26-2009)
The PathScale compilers (now owned by SiCortex)
aren't explicitly for Win32 programming, but they do
provide a high performance compiler suite for x64-based Linux systems.
They claim to be the "highest-performance 64-bit C, C++ and Fortran compilers for Linux-based environments,"
and their SPEC scores are very good.
Unfortunately, how to purchase of the Pathscale suite isn't obvious,
since SiCortex is a hardware vendor. They say they ship the PathScale
suite with their hardware, but don't seem to have a link for buying
it separately.
PGI (last update 7-26-2009)
The Portland Group (PGI) offers
a a compiler suite
for Win32/64, Linux x32/x64, and Mac OS X. They are on Release 9.0
as of July 2009. Commercial single-seat
prices are $420 for C++,
$700 for FORTRAN, and $990 for both. Academic pricing is also available.
|
|