Initial Notes:

A comprehensive review of, or set of instructions for, compiling GRASS on a Mac is not here yet. In the meantime, here are some notes put together by Scott Mitchell (smitch AT mac dot com). Suggestions / additions welcome.  See also material compiled by others, not yet incorporated here.

Compiling GRASS under Mac OS X requires the development tools to be installed. This is a separate package if you installed OS X yourself, and depending on the software version, it is either on one of the install disks, or you need to download it from Apple (it's free). If OS X came pre-installed on your computer, the developer tools may have been installed for you, depending on the computer model and when it was purchased. If not, they may be on a CD that came with the computer, and if not you also need to download them from Apple.

Two checks I can think of off the top of my head to see if they are installed are to (1) check to see if you have a /Developer directory in your boot drive, or (2) at a command line prompt, type the command gcc and press enter - if you get a "Command not found" error, or something to that effect, you likely don't have the tools installed. If you get "gcc: no input files", then you've got the tools.

Beyond having the necessary compilers and libraries provided by the development environment, you also need all of the other prerequisites for GRASS. If you are experienced in building Unix/Linux applications, you may elect to obtain and compile them all yourself. Otherwise, you will probably want to use some form of packaging system. In either case, refer back to the main GRASS on Mac page for more details.

Once you have all the prerequisities in place, compiling GRASS is relatively straightforward, or at least it's pretty much the same on this platform as others, except perhaps that some required libraries are in non-standard locations from the point of view of other platforms. For example, if you have used FINK to install related tools, those will be located under the /sw directory. Some of the required bits are provided by Apple and are typically under /usr, and if you compiled and installed anything manually, it may be under /usr/local.

For more compilation advice, until I receive any other great suggestions, the best I can offer is to show the procedure I have been using successfully on my own machines.

I have most of the required extras installed by fink. These include the graphics libraries, Postgresql, unixodbc, FFTW, lesstif, and libdl. Freetype is provided by Apple's X11 on my Panther machines, and by fink on the Jaguar one (which also has XFree86 provided by fink instead of by Apple). I have compiled PROJ4 and GDAL myself and installed them in to the default /usr/local hierarchy, mostly using the instructions and defaults that come with those packages. So for PROJ I just did the typical set of commands to compile it:

	./configure
make
sudo make install
For GDAL, there was a small change, which was necessary at one time to get the compile to work for Macs - I don't know if that is still the case, but it's safe to keep it this way as far as GRASS compatibility:
	./configure --with-python=no 
and then it gets standard:
	make
sudo make install

Next, I'm ready to set up the GRASS compile, in the GRASS source directory. Note that I'm assuming that you've obtained and extracted the source, and have read all the directions that come with it - this document is not duplicating any of the other directions on this site, just pointing out parts that may be different than on other systems.

So first I need to configure the build so that it finds all my extra libraries. Instead of typing in the location for ALL of the libraries that are provided by my FINK installation, I use the generic --with-includes= and --with-libs= to tell configure to add the /sw/[lib,include] directories to all of its searches for the requirements. Some of the other switches used are described below.

So my configure command (copied from my last compile of v5.3-cvs) is:

./configure  --with-includes="/usr/X11R6/include /sw/include" \
--with-libs="/usr/X11R6/lib /sw/lib" --with-motif --with-glw \
--with-postgres=yes --with-gdal=/usr/local/bin/gdal-config \
--with-proj --with-freetype \
--with-freetype-includes=/usr/X11R6/include/freetype2 --enable-64-bit \
--enable-shared --with-gd \
--with-postgres-includes=/sw/include/postgresql \
--with-postgres-libs=/sw/lib/postgresql/

Notes on the above command:

After that, the

make
command builds the software. Check the error log file. If all looks good,
sudo make install
will put everything in place.

Congratulations!

Please do get back to me using "smitch at mac dot com" with suggestions or problems regarding these instructions.

Scott



Extra notes: