next up previous contents index
Next: Index Up: GMT_Docs Previous: O.5 Putting it all   Contents   Index


P. Using both GMT 3 and 4

We encourage all GMT users to start using version 4 immediately; it has been tested extensively by the GMT team and has benefitted from bug reports for the 3.4.x versions. Users who still worry about the new version breaking things may install GMT 3.4.x versions and 4.x and use our utility gmtswitch to select their current version should the need to switch arises. You will find gmtswitch in the top-level GMT4.x directory; install as explained below.

Because GMT 4.x is backwards compatible with the 3.4.x series yet maintains its parameters and history in separate hidden files (e.g., .gmtdefaults4 versus .gmtdefaults) it is possible to install and use both versions on the same workstation. To simplify such setups we supply the utility gmtswitch which simplifies switching back and forth between any number of installed GMT 3-versions and GMT 4.x. Place the gmtswitch Bourne shell script in your general executable path (not in one of the GMT bin directories) and run it after you have finished installing all GMT versions of interest. The first time you run gmtswitch it will try to find all the available versions installed on your file system. The versions found will be listed in the file .gmtversions in your home directory; each line is the full path to a GMT root directory (e.g., /usr/local/GMT3.4.2). You may manually add or remove entries there at any time. You are then instructed to make two changes to your environment (the details are shell-dependent but explained by gmtswitch):

  1. Define the environmental variable GMTHOME to point to $HOME/this_gmt, where $HOME is the full path to your home directory. Here, this_gmt is a symbolic link that will be created and maintained by gmtswitch to point to a directory with one of the installed versions.
  2. Make sure $GMTHOME/bin is in your executable PATH.
Make those edits, logout, and log and back in again. The next time you run gmtswitch you will be able to switch between versions. Typing gmtswitch with no argument will list the available versions in a numerical menu and prompt you to choose one, whereas gmtswitch version will immediately switch to that version (version must be a piece of unique text making up the full path to a verson, e.g., 3.4.2). If you use tcsh or csh you may have to type ``rehash'' to initiate the path changes.


next up previous contents index
Next: Index Up: GMT_Docs Previous: O.5 Putting it all   Contents   Index
Paul Wessel 2006-01-01