GRASS GIS on Mac OS X

GDAL/OGR

Last change: 2005/8/28


GDAL version: 1.3.0
gdal.org

Almost there!

There are two options to install GDAL, one being a bit tricky. Without GRASS raster support, MapServer can't read GRASS rasters, and GRASS can't use GDAL to export rasters (this is because it uses GDAL utilities to convert the rasters), but it can use GDAL to read raster data and can still export rasters with other r.out.* commands. With GRASS support, MapServer can read GRASS rasters, and GRASS can use GDAL for both import and export.

The simplest is without GRASS raster support. Just go ahead and install it without the grass configure option.

The more difficult, but useful, option is with GRASS raster support. This requires GRASS 6 to be installed. But GRASS also requires GDAL - a circular problem. So, this is what we do:

Install GDAL without GRASS, to get things started. That is, leave out the --with-grass= option below.
Install GRASS with GDAL support. This works because GRASS doesn't care if GDAL has GRASS support, tho the r.out.gdal module will fail if you try it at this point.
Then rebuild and install GDAL + GRASS by adding the --with-grass= option below. Before building GDAL this second time, run a make distclean to clean out the source.

Once you have completed that cycle, you shouldn't need to go back to 'GDAL no GRASS' when updating either GDAL or GRASS.

So, here's the gorey details. In a Terminal type:

$ cd path_to_folder_containing_gdal_source_tar_gz
$ tar -zxf gdal-1.3.0.tar.gz
$ cd gdal-1.3.0
$ ./configure --mandir=/usr/local/share/man --without-python --with-threads --with-static-proj4=/usr/local --with-libtiff=/usr/local --with-geotiff=/usr/local --with-jpeg=/usr/local --with-gif=/usr/local --with-png=/usr/local --with-jasper=/usr/local

If you installed any of these optional packages, add to the configure line (make sure you hold off on the GRASS option the first time you build GDAL), all options separated by spaces:

PostgreSQL + PostGIS --with-pg=/usr/local/pgsql/bin/pg_config
MrSID Geo DSDK --with-mrsid=
and drag the MrSID Geo DSDK folder from the Finder to the Terminal window.
    NOTE: The MrSID DSDK does NOT work in Tiger yet
NetCDF --with-netcdf=
and drag the NetCDF folder (that is, the folder containing the /lib, /include and /src folders from the NetCDF build) from the Finder to the Terminal window.
HDF --with-hdf4=
and drag the HDF install folder (the one you set for the prefix in the HDF build) from the Finder to the Terminal window.
OGDI --with-ogdi=/usr/local
GEOS --with-geos=/usr/local/bin/geos-config
GRASS libraries --with-grass=/usr/local/grass-6.0.1
(it will be slightly different if you use a CVS build of GRASS)

Then finish:

% make
% sudo make install

© 2003-2005 GRASS Development Team
Imprint | Comments about this page
Last change: $Date$