Compiling GAMIT/GLOBK 10.33 on Mac OS X with gfortran

Here’s what I did to compile GAMIT/GLOBK 10.33 on Mac OS X 10.5.2 (INTEL) with gfortran 4.4.0 20080510

Pre-requirements (INTEL or Power-PC platform)

For Mac OS X 10.5.x: install Apple XCode Dev Tools 3.x with X11 SDK.
For Mac OS X 10.4.x: install Apple XCode Dev Tools 2.4.1 or later with X11 SDK.

Compilation

The compilation of GAMIT/GLOBK 10.3.x is pretty straightforward and easier with gfortran than g77!

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

2. Download ‘GAMIT 10.33’ from MIT ftp server (registration required)

3. Edit ‘libraries/Makefile.config’

3a. Change libraries/Makefile.config to:

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

3b. To avoid compilation error ‘get_otl_grid.f:357: error: unrecognizable insn:’, change the optimization level to -O2 of ‘libraries/Makefile.config‘.
The default optimization of -O3 seems to be too aggressive.

Edit ‘libraries/Makefile.config‘ and change the line in the “Mac OS X section” from:

FFLAGS = -O3 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash
to:
FFLAGS = -O2 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash

4. Change ‘install_software‘ and ‘install_updates‘ to be executable:

#chmod ug+x install_*

5. Launch the installation in ‘sudo’ mode (as root)

#sudo ./install_software

Normally it should compile just fine….

 

Leave a comment

2 Comments.

  1. Joe MacGregor

    Bonjour Gilles,

    Thanks very much for the tips on compiling GAMIT/GLOBK on a Mac. I have an error that shows up at compile time that I’m wondering if you have a quick solution for. I have the source files for 10.34 (executables not available as of 08/27/08), a PowerPC iBook G4 (10.4.11), and gfortran. After going through your steps 1-5, the following error occurs when compiling…

    Makefile for comlib remade by unimake
    gfortran -c -O2 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash GetWord.f
    gfortran: installation problem, cannot exec ‘as’: No such file or directory
    make: *** [com_lib.a(GetWord.o)] Error 1
    Failure in make_gamit — install_software terminated

    Any thoughts? No worries if nothing pops to mind. This suggests to me that the “as” file or directory is somehow missing, which kills make. I thought I had all the files, though.

    Thanks,

    Joe

  2. It seems that you don’t have the Developer Tools (Apple XCode) installed on your iBook.
    Please check if you have the Folder “Developer” on the root path of your Harddisc.

    You can either install the Developer Tools from the Mac OS X Install disc but I
    recommend to download the latest Apple XCode Tools version 2.4.1 for OS X 10.4.11 here (note version XCode 3.0 and up is for Mac OS X 10.5 Leopard):
    Simply register (freely) and download XCode for your system
    http://connect.apple.com