david m. whipp, Installing C/C++/Fortran compilers on your Mac, here.
One of the nice things about Mac OS X is that you have a polished user interface atop a Unix operating system. This means that using command line utilities such as compilers is straightforward, making coding on your Mac easy. Below is a terse version of the steps needed to get a recent version of the GNU C, C++ and Fortran compilers installed on your Mac. The instructions are available for Mac OS 10.6 (Snow Leopard) with XCode 3, Mac OS 10.7 (Lion) with XCode 4 and Mac OS 10.8 (Mountain Lion) with XCode 4. If you have a multi-core Mac (most should by now) and would like to run codes that use MPI to distribute processing across multiple processor cores, you can check out my page on configuring/installing Open MPI for use with the GNU compilers. Note that you’ll need to follow the instructions on this page prior to installing Open MPI if you don’t already have some set of compilers installed.