GMT 4 Installation Helper

This page helps you customize the GMT installation procedure under Unix or Unix-like operating systems capable of running a Bourne (sh) script. When submitting the completed form, you will receive a parameter file (e.g., GMT4param.txt) that you may save and use as argument to the script. For example, assuming you save the parameter file to GMT4param.txt, you can install the GMT4 package with the command

sh GMT4param.txt

Output may be redirected to a log file by appending >& install.log (if your login shell is csh or tcsh) or appending > install.log 2>&1 (if your login shell is bash or sh).

Any problems during the install will be noted in the log. Saving the log messages is of course optional.

Note: You do not have to use this form. can still be run interactively as in previous versions. However, after a successful install it will write all the parameters to a file named by you, and this file can be used for background installs as shown above.

IMPORTANT: Move or remove old gmt-*.bz2 files from the current directory before running!

A. Basic Requirements:

1. Select default units in GMT:
SI units (cm)
US units (inch)

Note: This used to be a choice that affected the compilation of GMT. However, since version 3.3.2 this selection is a run-time selection, meaning you can reverse it at any time. The present choice is simply a convenient way to set the default units for all users of your GMT installation (see gmtdefaults man page for how to change this choice at a later time). Individual users can always override the default with gmtset MEASURE_UNIT cm|inch

2. Select default PostScript output format for GMT:
Freeform PostScript (PS)
Encapsulated PostScript (EPS)

Note: GMT-produced PostScript files will by default use the printer configuration command setpagedevice to set image area (i.e., paper size) and to select specific paper trays, including the manual tray (e.g., when making overhead transparencies). Encapsulated PostScript files (EPS) are not allowed to use this command. Some older PostScript previewers (like Sun's pageview) do not understand setpagedevice, while more up-to-date previewers like GNU ghostview does. The parameter PAPER_MEDIA is used to choose between EPS and PS output and this can be changed at run-time with the gmtset command. Thus, this radio button only affects the initial default selection. Choose EPS if you do not need to worry about paper trays. Choose the default PS if you need the extra flexibility offered. Please read the gmtdefaults man page and Appendix C for more details.

3. Select POSIX Advisory File Locking:
YES. Use file locking
NO. Do not use file locking

Note: GMT passes information about previous GMT command-line options to future GMT commands via a hidden file in the current directory (.gmtcommands4). To avoid that this file is updated by more than one program at the time (e.g., when you connect two or more GMT commands with a pipe) we use POSIX advisory file locking on the file. Unfortunately, some versions of the Network File System (NFS) have not implemented file locking properly. Although the behavior may be undefined in this case, it should be safe to activate this option.

B. Support Library Setup

1. Select the appropriate netCDF library:
Give full pathname to the nc-config script or the netCDF directory:

Note: Leave empty unless netCDF is installed in a non-standard location. If netCDF is installed in the standard library locations or if nc-config is available in the shell's command search path, the location of netCDF is auto-detected. You can also leave the path empty if you have defined $NETCDFHOME to be the directory where you installed netCDF. If the netCDF library and include files do not have the same parent directory, then leave the path blank and manually set the environmental variables $NETCDF_LIB and $NETCDF_INC prior to running the installer.

2. OPTIONAL. Experimental GDAL import support:
Do not build optional/experimental GDAL grid import
Build optional/experimental GDAL grid import
If you selected to use GDAL, give full pathname to the GDAL directory or preferable to the gdal-config script:

Note: If selected, GMT will be able to read additional grid formats supported by GDAL, and grdimage can plot images such as geotiffs. Specify the gdal-config script or the parent directory where both the lib and include subdirs for GDAL can be found. If these directories do not have the same parent directory, then leave the path blank and manually set the environmental variables $GDAL_LIB and $GDAL_INC prior to running the installer. If the gdal-config script is installed in the shell's command search path, leave the path empty.

3. GSHHG Coastlines, rivers and political boundaries:
GSHHG is already installed (provide installed location below)
Please get and install the latest GSHHG
I already have the GSHHG archive, just install it for me
Give full pathname to the GSHHG directory:

Note: The GSHHG package is distributed separately from GMT. If you already have installed GSHHG once (e.g., with another GMT release such as GMT 5) then you can simply provide the directory name. Otherwise, we will install GSHHG for you in the directory you specify or, if unspecified, in the same directory where GMT will be installed.

C. GMT Setup

1. Select the FTP site nearest you:
Pacific (SOEST, University of Hawaii [GMT Home], Honolulu, Hawaii, USA)
North America (NOAA, Lab for Satellite Altimetry, Silver Springs, Maryland, USA
North America (Incorporated Research Institutions for Seismology, Seattle, Washington, USA)
South America (IAG-USP, Dept. of Geophysics, University of Sao Paulo, Brazil)
Europe (Goodie Domain Service, Vienna U of Technology, Austria)
Asia (ISV, Hokkaido University, Sapporo, Japan)
Africa (Tertiary Education & Research Networks, South Africa)
No FTP, archives already obtained

Note: Download times are shorter when you pick a site that is physically closer to you. If you already have downloaded the files and simply wants to use the script to reinstall, select the last option.

2. Select passive [Default] or active ftp transmission:
Passive ftp
Active ftp

Note: If you are behind a firewall you will need to use a passive ftp session. Only if you have some very old ftp client, you may have to resort to active ftp (which involves the server connecting back to the client).

3. Install GMT version 4.5.18; uncheck if no install is required (bzip2 sizes indicated):
GMT source, docs, supplements (38 Mb)

Note: The only reason to uncheck this selection would be to just ftp the archive but not install it.

4. Select which triangulation algorithm to use:
Watson's algorithm
Shewchuk's algorithm

Note: You may want to select Shewchuk's faster triangulation routine but as it is not distributed under the GNU Public License it is not included by default. For-profit organizations should first inspect Shewchuk's license.

5. Select library build type:
Static Libraries
Shared (dynamic) Libraries

Note: The GMT libraries can be made static or shared. The main benefit of using shared (dynamic) libraries is significantly reduced executable sizes (50-70% savings in disk space) and hence faster loading times of successive executed GMT programs. The GMT install procedure knows how to make shared libraries under Linux, FreeBSD, NetBSD, SunOS, Solaris, HPUX, OSF1, OSX, and IRIX. For other systems capable of generating shared libraries you must manually configure the file. If you have no preferences or no idea what to do on an unlisted system, select the default static libraries. If you select shared, you cannot later move the executables around without messing with environment settings like LD_LIBRARY_PATH.

6. Select the C compiler you want to use:

Note: The default should work unless you are on a system with several C compilers or your compiler lives in a strange directory not in your path. E.g., you may run Solaris and have purchased Sun's compiler but have also installed GNU gcc. To ensure you get the GNU you should select "other" and provide the path to gcc.
Custom C Compiler:
When producing executables:
Use default (whatever your compiler prefers)
Force 32-bit (not recommended)
Force 64-bit (not recommended)
Note: GMT can be built as 32-bit or 64-bit. We do not recommend that you explicitly choose 32-bit or 64-bit. The default is to compile without sending any 32-bit or 64-bit options to the compiler, which generally create 32-bit versions on older systems, and 64-bit versions on newer systems.

7. Select the make program you want to use:

Note: The default make should work unless you are on a system with a weird make utility. GNU make works best, and some Sys V makes have problems. If you have make problems, use GNU make (assuming it is installed): Select "other" and enter the path for make below.
Custom make program:

8. Select GMT final destination directories
Place GMT in subdirectories of:
Place GMT executables in:
Place GMT libraries in:
Place GMT include files in:
Place GMT data resources in:
Place GMT man pages in:
Place GMT doc pages in:

Note: The installation will install all GMT components in several subdirectories under one root directory. By default, GMT will be installed under gmt-4.5.18 in the current working directory where is run. On most Unix systems, however, the preferred location of the root directory will be something like /usr/local or /sw, under which the installation will add bin, lib, include, share, share/man, and share/doc/gmt, respectively. To select another location for the root directory than the default (gmt-4.5.18), specify it in the first box above, or enter subdirectories individually. Only specify alternative directories if you want to place the files elsewhere.

Note that the man pages will be be placed in the sub-directories man1 and man3 of the directory specified above. The man utility will find the GMT man pages if the chosen man directory is included in the users' MANPATH environmental variable. Make sure the users' search path contains the directory where you place the executables. Finally, advise users to add a browser bookmark for the file share/doc/gmt/html/gmt_services.html in the doc directory you chose above; that page provides links to online GMT documentation and man pages.

9. Select alternative GMT_SHAREDIR directory
Alternative GMT_SHAREDIR directory:

Note: At run-time GMT will look in the shared data directory (specified in section C.8) to find configuration and data files. That directory may appear with a different name to remote users if a different mount point is used or a symbolic link is set. GMT can use the environment variable $GMT_SHAREDIR to point to the right place. If users see a different location for the shared data files, specify it here. (It will be used only to remind you at the end of the installation to set the environment variable $GMT_SHAREDIR). Leave blank to select the shared data directory of the data resources directory given in C.8 [Default].

10. Select optional supplemental packages to install:
MEX: Interface for reading/writing GMT grdfiles for Matlab or Octave
XGRID: X11 graphical editor for netCDF-based .nc files (REQUIRES Xlibs)

Note: GMT supplements that only depend on GMT are always installed. The above packages will only be installed if you select them. The mex package requires Matlab or Octave, while xgrid requires various X11 libraries and include files.

11. Additional information for MEX (Matlab or Octave):

Enter head of the Matlab system directory if you selected Matlab above:
Note: You can leave the path blank under OS X or if $MATLAB is defined in your environment and points to the correct directory.
Enter directory for *.m files for the GMT/Matlab-Octave interface:
Enter directory for *.mex files for the GMT/Matlab-Octave interface:
Note: You can leave these two paths blank to select the default paths for either Matlab or Octave. In any case you must have permission to create these directories (if they don't exist) and write to them. Finally, if you chose Octave then it is assumed that octave is already in your executable path, in particular that the utilities mkoctfile and octave-config can be found when configure is run.
11. Complete the operation:
Delete all archives upon successful installation
Run all example scripts

Note: Examples will only be run if you also ftp'ed the doc archive.


Once received, use right-click to bring up the Save Frame As... option to save the GMT4param.txt file.