You can also just install XCode, which is free with the OS.
Yes, I know the complaint is that it's "too large" just for gcc and related toolchain. But that's not true for me. I find it far, far easier to just download one thing from Apple and install it, then to spend cycles of my own to figure out how to save myself a little bit of disk space.
The new XCode 4.2 and presumably the next versions of it do not ship with a real GCC, which is one of the things mentioned in the article.
This causes problems for software that doesn't compile right with LLVM yet (arguably bugs in the software, but tell that to someone who can't use the LLVM compiled binaries any more).
Eventually, the version of Xcode that includes GCC will be too old to do anything useful with.
So then you wouldn't be able to "just install XCode", unfortunately.
They will ship with a different compiler, clang, and then with homebrew you can compile and install GCC to your hearts content.
For all of my personal projects and projects at work I am using clang because the errors and warnings it gives me are clearer, pinpoint the problem and it compiles my codebase almost 30% faster than GCC.
The newest Xcode actually doesn't ship with gcc, which is the complaint here I suppose. It hasn't impacted me all that much, but I don't use a ton of non-OSX specific software (and none outside of homebrew/ports).
Gcc binary is the gcc+llvm, but you also have gcc-4.2
gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
but gcc-4.2 is the real deal
gcc-4.2 --version
i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Hmm, it looks like it's actually a gcc frontend that uses LLVM as its backend - more than just a command-line wrapper. But I hadn't realized that it wasn't standard gcc.
Heh, I've been using the gcc command on my mac since I switched and I, quite literally, have never come across a program that wouldn't compile for me. That level of compatibility is... well... staggering. heh.
Same here, hence why I assumed it was standard gcc. In fact, I just did "sudo port install python27 py27matplotlib" which pulled in a lot of code and there were zero problems.