GMTSWITCH(1)
β¨ GMTSWITCH(1) β¨
okay bestie, welcome to the gmtswitch era π
this is a GMT page and it lives in section 1 of the manual, and it's literally about switching between different GMT versions, so let's get into it π¦
πΈ NAME πΈ
gmtswitch β switching between different GMT versions (iconic behaviour, honestly)
π SYNOPSIS π
gmtswitch [ D | version ]
π INTRODUCTION π
okay so here's the vibe: gmtswitch helps you modify your environment so you can go back and forth between several installed GMT versions. no cap. π₯
the way it works: it keeps a list of directories pointing at your GMT installations in a file in your home directory, and then it manipulates a symbolic link to point at the GMT directory whose executables we want to use. that's the whole trick, periodt β¨
quick heads up: The Windows version works a bit differently; see WINDOWS below πͺ
π§ REQUIRED ARGUMENTS π§
None. ngl, there are literally none. If you give no arguments you get presented with a menu of installed GMT versions from 1 to n and you just specify which one you wanna switch to π«
π OPTIONAL ARGUMENTS π
Dβ Select the default GMT version. This is the first entry in the~/.gmtversionsfile πversionβ Search for a unique match in the~/.gmtversionsfile. If one match is found we switch to that entry; otherwise an error is generated. where module is the name of a GMT program and the options are those that pertain to that particular program. π
π οΈ SETUP π οΈ
If you have official versions installed then running gmtswitch the very first time will examine your hard disk starting at / and look for directories with GMT4, GMT5, etc., in the names. this will fail to find the subversion directories and possibly others you have placed elsewhere. π
The fastest way to get up and running is this:
- Edit/Create
~/.gmtversionsand add the paths to all GMT installations you have or care to consider. Each path goes on separate lines and points to the top dir of each distribution, e.g.,/Users/pwessel/UH/RESEARCH/PROJECTS/GMTdev/gmt-4.5.18 - In your
.bashrcor.[t]csrhor wherever you are maintaining yourPATHorpathvariable, remove any directories you have added that contain GMT, and add the new path$HOME/this_gmt/bin(might be$homefor csh users). Make sure this path appears before any others that might contain a GMT installation, such as those used by package managers (e.g.,/sw/binfor fink,/opt/local/binfor Macports, etc.). π«Ά - Make the new path take effect (quit/restart terminal, logout/login, etc). π
cdto the most recent GMT directory where agmtswitchversion lives, and rungmtswitchwith no argument. Select one of the version from the menu. π- If in csh you may have to say
rehashafterwards. π§ - Type
plot -and the synopsis should tell you that you got the correct version. You can now rungmtswitchfrom anywhere; try it out and make sure that you can switch between the versions. β
π EXAMPLES π
To switch to GMT version 4.5.18 (assuming it was installed as such and not via a package manager), try
gmtswitch gmt-4.5.18
To switch to the default (your top choice), do
gmtswitch D
Finally, to select from the menu, just run
gmtswitch
and pick the one you want. π
π BEWARE π
GMT remembers where it was installed the first time and uses that dir to find the default GMT share directory. If you move the entire GMT installation after compilation then you may have to set GMT_SHAREDIR to point to the top dir in order for things to work. It is best not to move things after installation. fr fr, don't do it π
πͺ WINDOWS πͺ
Under Windows use gmtswitch.bat which is a batch script that changes the Windows PATH variable so that the BIN directory of the preferred version always comes first. To do that the batch works in two alternative modes:
1 - Permanent mode
2 - Temporary mode
π The permanent mode
The permanent mode makes use of the free executable program "EditPath" to change the user path in the registry. It's called permanent because the changes remains until ... next change. See
https://www.softpedia.com/get/Tweak/Registry-Tweak/EditPath.shtml
Of course the editpath.exe binary must be in your system's path as well.
WARNING: The path change will not be visible on the shellcmdwhere it was executed. For the change to be active you will need to open a newcmdwindow. π
π The temporary mode
The second mode is temporary because the path to the selected GMT binary dir is prepended to the previous path via a shell command line. This modification disappears when the shell cmd window where it was executed is deleted. π¦
πΈ Your job, bestie
It is the user responsibility to set the contents of the G32_32 to G5_64 below to valid paths where the binaries of the different GMT versions are installed. Note that it is not mandatory to have all four of them in you computer. For the ones you do not have just let them pointing to nothing e.g.,
set G4_64=
The permanent mode is the default one (but this can be changed. See edit section). To run in the temporary mode just give a second argument (doesn't matter what) β¨
π Example usage to set a GMT5 64 bits permanent
gmtswitch g5_64
π To temporary set a GMT4 32 bits do
gmtswitch g4_32 1
Run without arguments to get a "Usage" (for permanent mode) π«
π COPYRIGHT π
2025, The GMT Team
okay that's the whole page bestie, you ate that π π and just so you know where this all came from: it's version 6.6, dated Jul 23, 2025 β mwah, go switch some versions, you got this π«ΆπΈβ¨
π¦ where this page comes from
- ubuntu resolute: gmt 6.6.0+dfsg-1build2 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms