Next: Index Up: P. Special Operations Previous: P.1 Running GMT in Contents Index

# P.2 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. gmtswitch creates and maintains a symbolic link this_gmt in your home directory that will point to a directory with one of the installed GMT versions.
2. Make sure $HOME/this_gmt/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 version, e.g., 3.4.2). If you use tcsh or csh you may have to type ``rehash'' to initiate the path changes.

Next: Index Up: P. Special Operations Previous: P.1 Running GMT in Contents Index