Using the GNU compilers
Although OS X installs part of the GNU compiler tools automatically, it lacks gfortran. To install it one should use either macports or fink. These instructions always assume that you are using macports.
As a first step, install Apple's XCode. It is included in the OS X install DVD but updated versions can be dowloaded from Apple's site if you register at Apple's Developer Connection.
Then download the most recent macports tool for your version of OS X and install it. This will install several TCL scripts in /opt/local/bin that will allow you to check what packages are available and install them. Macports is similar to the apt tools in linux systems. You should probably add /opt/local/bin to your PATH variable.
The packages you should now install are gcc44 and gsl (and gd2, if you'd like to have access to an esoteric feature of octopus). As OS X is a 64-bit system, try to install the 64-bit versions of these packages. In Snow Leopard (OS X 10.6.x) you don't need to do anything, everything is automatically 64-bit. But if you are running Leopard (OS X 10.5.x) you will have to edit /opt/local/etc/macports.conf before you install any package. Look for the line containing "build_arch" in this file, change it to "build_arch x86_64" and uncomment it. To install the packages you just need to do "port selfupdate" to get the most recent package database and then "port install gcc44 gsl". Leave your computer running and go for a looong coffee.
Now you have to install the other libraries octopus requires: blas, lapack, fftw, and netcdf. Don't do it using macports or you'll get these libraries compiled with the system compiler instead of the just installed gfortran. And you will not be able to link octopus with them...