Gilles' sysadmin & dev blog for Earth Science

Install GAMIT 10.4.x on Mac OS X Lion 10.7.x

GAMIT / GLOBK 10.4 can also be installed on Mac OS X 10.7 Lion. Here’s a quick How-To (thanks to David Zuliani from Italy for providing the CFLAGS tip).

1. Install Apple XCode 4.2

You need to first install Apple’s Development Tools called XCode 4.2 or later for Mac OS X Lion to compile GAMIT.
You can get it in 2 ways:

2. Install gfortran for Mac OS X Lion

Install gfortran for Mac OS X Lion 10.7 (tested with gfortran 4.6.2 ):

Check often the GFortranBinaries page since gfortran is in active development.
Here’s the direct download link for gfortran 4.6.2 for Mac OS X Lion 10.7

3. Download GAMIT 10.4

Download GAMIT 10.4 from the GAMIT-GLOBK webpage (you must be registered), and change the permissions of the script ‘install_software’

chmod ug+rx install_software

4. Launch the install script install_software


5a. Modify X11 paths in libraries/Makefile.config

Modify line 99 to 101 to read:

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

5b. Change CFLAGS and OS_ID

Still in libraries/Makefile.config you *MUST* change the compiler options to 64bit for the Mac OS X part (by using the -m32 option it won’t work for Mac OS X Lion 10.7) and change the OS_ID number to a higher value.
It should read like this:

#------ for Mac OSX 5.2-8.8.0 (10.4.8) and Mac OS X Lion 11.0.0
OS_ID Darwin 1000 1500
### GCC V4 gfortran flags ###
FTN = gfortran
FFLAGS = -O3 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash
CC = gcc
CFLAGS = -g -m64

ranlib THELIB

$(CC) -c $(CFLAGS) -I$(II) $< ar rv $@ *.o rm -f $*.o .f.a: $(FTN) -c $(FFLAGS) $< ar rv $@ *.o rm -f $*.o # BLOCKEND

6. Finally relaunch the script 'install_software'


This should compile GAMIT 10.4 fine on Mac OS X Lion.