Gilles' sysadmin & dev blog for Earth Science

Compiling GAMIT & GLOBK 10.35 for Mac OS X 10.5-10.6

A post dedicated to help compiling GAMIT and GLOBK for Mac OS X 10.5 Leopard (PowerPC and INTEL) and 10.6 Snow Leopard (INTEL only).

GAMIT, GLOBK, and TRACK form a comprehensive suite of programs for analyzing GPS measurements primarily to study crustal deformation. The software has been developed by MIT, Scripps Institution of Oceanography, and Harvard University with support from the National Science Foundation (USA).

Pre-requirements

  • For Mac OS X 10.6.x: install Apple XCode Dev Tools 3.2.1 with X11 SDK
  • For Mac OS X 10.5.x: install Apple XCode Dev Tools 3.1.4 with X11 SDK
  • gfortran binaries

Download gfortran

Install the appropriate (INTEL or PowerPC) gfortran disk image for Mac OS X from:
http://gcc.gnu.org/wiki/GFortranBinaries

Download GAMIT/GLOBK

Download the source code of ‘GAMIT 10.35’ from MIT’s ftp-server with incremental updates (Registration required)

Change both install scripts to be executable


#chmod u+x install_software
#chmod u+x install_updates

Launch the install script ‘install_software’

This will decompress the *tar.gz files, with command:

# sudo install_software

You will get some errors with X11 missing etc. Don’t worry we will fix this right now.

Modify ‘libraries/Makefile.config’ for Mac OS X

Edit ‘libraries/Makefile.config’ with your favorite editor
Uncomment the topic specific to Mac OS X for X11LIBPATH and X11NCPATH to read:


# Specific for MacOSX
X11LIBPATH /usr/X11/lib
X11INCPATH /usr/X11/include/X11

Since Mac OS X 10.6 compiles by default in 64bit mode we need to add the “-m32” CFLAGS option to keep 32bit mode compatibilty in Mac OS X 10.5 and 10.6, or else we get compiler errors.

We need also to update the OS_ID Darwin number to 1000 (for Snow Leopard compatibility):


#------ for Mac OSX 5.2-8.8.0 (10.4-10.6)
OS_ID Darwin 1000 9900
# ASSIGMENTS
### GCC V4 gfortran flags ###
FTN = gfortran
FFLAGS = -O3 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash
CC = gcc
CFLAGS = -g -m32
# EXPLICIT_RULES
ranlib THELIB
# SUFFIX_RULES
.c.a:
$(CC) -c $(CFLAGS) -I$(II) $< ar rv $@ *.o rm -f $*.o .f.a: $(FTN) -c $(FFLAGS) $< ar rv $@ *.o rm -f $*.o # BLOCKEND

Relaunch the install script

Relaunching the install script will compile just fine GAMIT/GLOBK, with command:


# sudo install_software