What do I need?

  1. A C compiler. I would suggest the one that Apple provides as part of Xcode.
  2. A FORTRAN compiler. The best suggestion is R tools for Mac development. They have a nice fortran compiler (called gfortran).
  3. X11 for the Mac

Installing the compilers

The C compiler needs to be installed as a package.
The gfortran compiler will come as a DMG file, so will use a similar package installation like the Xcode package.
From here on, /usr/bin and /usr/local/bin needs to be in your path. Typing rehash in a termainal can help.

Other compilers

I have used the MacPorts g77 and gfortran compilers with no problem.
I used to recommend the HPC Fortran compilers. I have had some problems with these, especially g77. I have a makefile below that solves these issues.

Installing X11

This is just a package, done in the usual way. You will have to agree to license and type in your password, but otherwise this is no different than upgrading iTunes.

Building autoslit

Follow the instructions. Remember to edit the Makefile to use the same fortran compiler you used for PGPLOT and include the location of PGPLOT.

That does not work.

If you get warnings like: ld: warning: in lib/env.o, file was built for unsupported file format which is not the architecture being linked (i386) you are mixing a 32 bit and a 64 bit compiler. Usually, gcc defaults to 64 bit and g77 is 32 bit.

One way to fix this is to make sure EVERYTHING has been compiled correctly. The error message will tell you what particular problem you have.

  1. If you want to compile with 64 bit gfortran and 64 bit gcc (you have obtained both of the compilers from the links above), than use my makefile
  2. If you want to compile with 32 bit gfortran (you have obtained both compilers from the links above), than use my 32 bit makefile
  3. If you want to compile with 32 bit g77 (you have obtained the C compiler from the links above), than use my 32 bit makefile

In each file, I assume you have set PGPLOT_DIR to the location of a version of PGPLOT compiled using the same compilers.

None of those work, either.

If you get errors like:
Undefined symbols for architecture i386:
"_get_obj__", referenced from:
_get_data__ in get_data.o

use this makefile
Go to the Start
Last modified: Thu May 31 10:28:23 PDT 2012