We describe here how to install Grass_AG and its prerequisites on the Mac OSX platform. In particular, we add GDAL, OGR and OGDI components (which are listed as optional in the list of requirements). These options are required in order to access high resolution global elevation and vector data as described in separate articles by M. Neteler and M. H. Bowman in Volume 3 of the Grass Newsletter.
The target machine for the build method described here was a PowerBook G4 laptop machine. There is no obvious reason why it shouldn't also work on other OSX based systems.
The main points to know are that the prerequisites must be installed prior to Grass_AG itself and that the prerequisites themselves may have their own prerequisites. In our case, Grass_AG will be built with GDAL as a prerequisite because GDAL provides OGR support. It is OGR which has OGDI as a prerequisite if OGDI support is required (it is!). Hence our build order for this group of interdependent options is:
OGDI
GDAL with OGR
Grass_AG
All other Grass/Grass_AG prerequisites were able to be provided by Darwin Ports. These other prerequisites were all installed first. Although GDAL is also available as a DarwinPort, it would not build with OGDI support, so it was built manually - as below i.e. don't install the DarwinPort version of GDAL!
To automate the build process somewhat, a number of build scripts were created. These address various problems with building the prerequisites on Mac OSX. In particular, OGDI has a number of quirks, with solutions provided mostly from Kyng Chaos (although adapted to take into account some differing prerequisite installation locations). The build scripts required are:
Build.ogdi
Build.gdal-1.2.6
Build.grass600_AG
Its easiest to create a working directory into which the scripts and source tarballs should be downloaded before attempting to run the scripts. The scripts will have to be edited if the tarballs are in another locations.
Also download darwin.mak into the working directory and edit it, if necessary, to reflect the locations of the proj, zlib and X11 installations on your machine. The existing zlib and X11 locations specified in darwin.mak are the default for most OSX systems; the proj location is suitable for a DarwinPorts installation of proj.
The source tarballs to be downloaded into this directory are OGDI, GDAL and Grass_AG.
Before running the build/install scripts, you may wish to review their contents and change any necessary application locations in the configure section. The entries in the configure sections also provide an idea to which support applications and libraries are required. Any of these with a locations beginning with "/opt", have most probably been installed with DarwinPorts; the rest are most probably part of MAc OSX's default installation.
Now, in a shell, cd to your workfile and run:
sudo sh Build.ogdi
to build and install OGDI. Then run:
sudo sh Build.gdal-1.2.6
to build gdal with OGR and OGDI support
sudo sh Build.grass600_AG
to build grass_AG with GDAL support.
If everything runs as expected, you should now be able to use Grass_AG as a standalone application (i.e. like "normal" GRASS) by executing:
grass60_AG
Display problem workaround
A probable quirk when running Grass_AG (or Grass) on Mac OSX relates to the version of TCL/TK being used by Grass_AG. There are often problems when opening a bitmap display or nviz for the first time, typified by the error message:
"Error: channel "console1" wasn't opened for writing"
Most public advice about this problem suggests various methods to force GRASS to use the native (Aqua) version of wish (TCL/TK's windowing shell). In fact I have found the opposite to be the case. To coerce Grass_AG to use a non-native version of wish, edit /opt/local/bin/grass60_AG to include the following line (assuming a DarwinPorts installation of TCL/TK):
export GRASS_WISH=/opt/local/bin/wish
This line should be included just before the existing final line (exec "$GISBASE/etc/Init.sh" "$@")
Acknowledgements
- The free open source GRASS
team
- Grass_AG, the AG aware version of GRASS was developed by Stéphane BIDET <s.bidet at uq.edu.au> (or: <stephane.bidet at tremplin-utc.net>)
- M. Neteler. "SRTM and VMAP0 data in OGR and GRASS". GRASS Newsletter, 3:2-6, June 2005. ISSN 1614-8746.
- M.H. Bowman. "Mapping freely available high resolution global elevation and vector data in GRASS". GRASS Newsletter, 3:7-10, June 2005. ISSN 1614-8746
- This project funded by UQVislab
and QPSF.
Any comments, suggestions to Chris Willing <c.willing at uq.edu.au>
