Mac OS X Porting
or, Building Unix Software from Source Without Fink or Macports
My little guide to my UNIX porting experience on Mac OS X. The focus here is on open source GIS software.
These are provided as-is. There may be raw notes in places — if you can figure them out, great for you, if not, I won't take a lot of time trying to explain them, but I will try to clean them up over time so be patient.
Please, read the notes below. Especially, remember to look at config.log for problems in configure. Check the notes again when you come back for updates to the build instructions.
Mac OS X 10.3.9 or newer
. You should have installed the BSD support with a custom install (it's default in 10.3, and not even shown in later versions).
Apple's X11 + X11 SDK
. X11 is an optional install for OS
X. The X11 SDK
is included in Xcode as an extra install option. Optional, but recommended, especially to run NVIZ in GRASS. Here are a few notes on setting up X11
Apple's Xcode Tools
(free membership required) + any updates. Xcode is included as an optional install with OS
X, but is probably not up to date. Nothing difficult about this installation, but make sure you install the X11 SDK
. Current versions:
Panther: Xcode 1.5
Tiger: Xcode 2.5 – earlier 2.x versions spit an error when multiple -isysroot flags are used, which can easily happen in configure scripts and makefiles.
Leopard: Xcode 3.1 – Xcode 3.0 has a couple nasty bugs.
Snow Leopard: Xcode 3.2+
I use the Terminal exclusively, instead of an X11 xterm.
Commands to type in the Terminal are shown in boxes, some lines may wrap around but should be typed on a single line. I try to hardwire \ line wraps so that it's easy to see where lines continue. You should be able to copy and paste from the web page and it won't insert line endings to mess up the command (triple-click a line to select the whole line).
Where a command needs a full path to something, you can save a lot of typing by dragging the folder or file from a Finder window to the Terminal. The full path will be inserted where the cursor is. Quotes are not needed around the path in this case, special characters are properly escaped.
A change in Tiger – the Terminal now adds a trailing slash to all folders dragged to it, which is silly because it still adds the trailing space after that, so you still have to delete something to add to the path. I think this could cause problems with configure options (I think I had one somewhere) since most config options that take a path expect no trailing slash. So I'm in the habit now (well, almost) of deleting 2 chars after all drag-n-drops to the Terminal.
And now in Leopard, dragging a folder to a Terminal window changed back to the old way – no trailing slash. Make up your minds Apple!
is your best friend for editing files, unless you're comfortable figuring out the CLI/X11 text editors. If you can afford it, buy it, otherwise their free TextWrangler can handle most tasks. Tex-Edit
will also work nicely.
Apple's archive tool works very well for expanding zip, gz, bz2 archives. By default, OSX will expand these when double-clicked – they will have the simple white archive document icon. StuffIt Expander can expand these, but different versions have different problems, and StuffIt went into the bloatware stage many versions ago (let StuffIt handle StuffIt and the old Classic archive formats). If you install StuffIt Expander, it may take over these archive formats, you can tell by the distinctive StuffIt style icon. You can reset this by using Get Info in the Finder on each archive type and selecting Archive Utility or BOM Archive Helper from the Open With popup menu, then clicking the Change All button.
Generally, a lot of text scrolls by after starting 'make'. You can usually just ignore this – as long as make doesn't end with an error message (warnings are OK), you can proceed to 'make install' and it should have been successful. For problems in 'configure', the output in the Terminal window often doesn't have enough about why, you should look in the file 'config.log' for more details.
Many patches described in my install notes are meant for Mac OS
X/Darwin, and may not apply to other flavors of UNIX/Linux.
I don't use Fink or MacPorts. If you have Fink installed, it shouldn't interfere, but it may. If you try to use libraries from either, you may have problems with version mismatches and library duplication between them and /usr/local stuff. When configure or make try to use a program available in the system, the copy in Fink or MacPorts could be used instead if it's found first, and may behave unexpectedly (often it's a difference between BSD and GNU versions of a program). If you are having problems with them getting in the way and you don't want to get rid of them, try setting the LDFLAGS environment variable to -L/usr/local/lib before running configure. Also check your shell init files (.bash_profile and .bashrc) – Fink (and possibly MacPorts) adds a couple things there, and reordering PATHs or disabling Fink environment vars might help (tho could break Fink).
for easy universal binaries. Not used any more.