GMT Workshop at Fragile Earth Conference, Sept 9, 2011, Munich, Germany
Updated Sept 11, 2011
Workshop Preparation:
This page contains information on the GMT 5 installation as well as data sets and tutorials
that workshop participants must download prior to the workshop. The GMT team released GMT5.0.0 beta
on August 26, 2011 so both Linux/Unix/OSX and Windows installers are available.
Note that for OS X and Linux you may install GMT5 at any time via subversion; see the
GMT 5.
Computer Requirements:
You will need to bring a laptop that conforms to one of these specifications:
- Windows: If you have no prior experience with GMT under Windows then this will be the most challenging part of
the process. You must either install Cygwin (to gain a minimalistic UNIX bash shell terminal and tools) or install
a virtual Linux distribution (e.g., via VMWare or the VirtualBox):
- Cygwin. The simplest installation is to first install the GMT5.0.0b executables via the GMT5b Windows installer,
then do the basic Cygwin installation. As Cygwin inherits the executable PATH from Windows, we get to use GMT immediately. However, we need to
install a usable editor (here nedit), ghostscript, gv, and the xinit X server. Here are the minimal step-by-step instructions that I have successfully tried myself:
- Download and start startup.exe from cygwin.com.
- Choose Install from Internet.
- Leave Root be C:\cygwin and install for All Users (change if you know what you are doing).
- Select a directory to store packages (Perhaps a cygwin folder in My Documents).
- Set Internet connection specifics if they differ from the basic default direct connection.
- Choose download site. I picked the first one; pick one in or near your country.
- The Select Packages menu appears. By default you get a basic install only. Add these packages:
- Expand Editors, then select nedit (click "skip" once).
- Expand Graphics, then select ghostscript and gv.
- Expand X11, then select xinit.
- Click Next.
- Resolving dependencies: leave box checked, then click Next. This starts the download and
install of packages. Get coffee, this takes a while.
- Accept defaults on icons and click Finish.
- Restart your laptop.
- Test your install: Goto Start menu, select All Programs, find Cygwin-X, start XWin Server. This opens a xterm terminal. Try the commands
pscoast -Rg -JH0/15c -Gbrown -Bg -P -Dc | gv -
You should now be looking at a global map.
- Virtual Linux. I personally think Cygwin is very painful, but it is fairly lightweight. The alternative is to install a full-fledged
Linux distribution inside a virtual machine. A good, free virtual machine is Virtual Box.
You install that program and then you need to download the ISO image (or get a DVD) of some recent Linux distribution like Ubuntu. Basically,
you are setting up a Linux computer within Windows. The benefit is that you have full access to a regular Linux distribution and can install
whatever programs you like. The downside is that if you are a complete novice on Linux you may be overwhelmed by learning and managing a new operating
system. This could be a good solution if you have knowledgable colleagues to help you out. You can then follow instructions for Linux below.
- OS X: Apple's OS X is built on top of BSD Unix so many things are already there. However, to install GMT 5b you need to compile and therefore you need to have
Xcode installed. This used to be found on your OS X Install DVD, but under Snow Leopard Apple started charging USD 5 for this tool, whereas under OS X Lion
it is a free download. You will also need a set of Unix tools best obtained by installing one of the package managers
fink or MacPorts.
I only have experience with fink but they both do the job. In either case, you install one of these managers in order to install packages required by GMT5b, such as ghostscript, gv, gdal, pcre, and netcdf, and an editor such as nedit.
- Linux: Unless you chose to install the entire distribution, make sure you have basic development tools installed (gcc compiler, autoconf, etc), as well as ghostscript, gv, gdal, pcre,
and netCDF, and an editor such as nedit. Note that the GMT5b installation will also offer to install netCDF for you in case your package manager does not list it.
GMT 5b Installation
- Windows: Use the GMT-5b installer from GMT5's Windows Download site. It will install GMT5b, GSHHS, GDAL, PCRE and netCDF.
- OS X or Linux: Either go to the GMT5 website and follow instructions for download (identical to the
GMT 4 instructions), or choose to install GMT5 via subversion. The latter approach is much preferred
as you can then update GMT5 as often as you like instead of being stuck with a particular point release.
See the GMT5 page for how to install via subversion.
How can I test I am all set?
If you are all set you should be able to
- Open a terminal window
- Type psxy -
You should get a few lines of psxy synopsis message back which looks like this:
psxy 5.0.0b [64-bit] [API] - Plot lines, polygons, and symbols on maps
usage: psxy [<table>] -J<args> -R<west>/<east>/<south>/<north>[/<zmin>/<zmax>][r] [-A[m|p]]
[-B<args>] [-C<cpt>] [-D<dx>/<dy>] [-E[x|y|X|Y][n][cap][/[+|-]<pen>]]
[-G<fill>] [-Jz|Z<args>] [-I<intens>] [-K] [-L] [-N] [-O] [-P]
[-S[<symbol>][<size>|+s<scaling>]] [-T] [-U[<just>/<dx>/<dy>/][c|<label>]]
[-V[<level>]] [-W[+|-][<pen>]] [-X[a|c|r]<xshift>[u]] [-Y[a|c|r]<yshift>[u]]
[-a<col>=<name>[,...]] [-bi[i|o][<ncol>][t][w][+L|B]] [-c<ncopies>]
[-f[i|o]<info>] [-g[a]x|y|d|X|Y|D|[<col>]z[-|+]<gap>[unit]] [-h[i|o][<n>]] [-i<cols>[l][s<scale>][o<offset>][,...]]
[-p[x|y|z]<azim>/<elev>[/<zlevel>][+w<lon0>/<lat0>[/<z0>][+v<x0>/<y0>]] [-t<transp>] [-:[i|o]]
If you get a message along the lines of "psxy not recognized or found", etc, then the directory with GMT executables have
not been properly added to your search path. Finally, also type
ogr2ogr
which will either give a full usage message or some "not recognized message". Perhaps you did not install GDAL properly?
Data Sets to install
The data sets we will use for this part of the workshop have been placed in a 174 Mb zip archive that can be obtained via anonymous ftp from
HERE. Please make a directory for the workshop and extract the contents of the
zip file there; it contains a folder named DATA with several items.
Workshop Notes and Scripts
Additional Software
We expect to build overlays for Google Earth so please make sure you have a recent version of Google Earth installed.
Do not wait until last minute!
Once the workshop starts there is simply no time to help anyone with installation problems. The less experience you have
with the above installation procedures the earlier you should start. In particular, if you are doing the Windows/Cygwin route then follow the
instructions to make sure things are working, since I do not use Windows
myself. Ask for local IT help if you have access. If you run into trouble, send a note to Paul Wessel.
Last updated 11-SEP-2011 by Paul Wessel