The Generic Mapping Tools
Clone or download
PaulWessel and joa-quim Finish the last few modules using gmt_report_usage (#87)
Some modules had odd setups or names that prevented seismans script replaceing
Latest commit 9b1d83f Sep 21, 2018

Generic Mapping Tools


Information for installing GMT 6

Note: The build system has recently been switched to CMake which is a cross-platform system for managing the build process. If you are familiar with the old GNU Build Tools (automake, autoconf, and configure) you can probably skip over to the CMake quick start guide in README.CMake.


You do not need to read these instructions unless you plan to build and install the programs manually.

GMT has been installed successfully under UNIX/Linux/OS X on workstations. It also installs under Windows and in UNIX emulators such as Cygwin or on virtual machines. We anticipate few problems if you are installing the package on other platforms.

Note there are three GMT tar archives available (#3 is optional):

  1. gmt-6.x.x.tar.bz2: The GMT 6 distribution
  2. gshhg-gmt-2.x.x.tar.gz: All five resolutions of GSHHG coastline data
  3. dcw-gmt-1.x.x.tar.bz2: Digital Chart of the World polygon data

The archives are available in bzip2 (*.bz2) and gzip (*.gz) formats. If you do not have bzip2 installed you can obtain source or executables from

For Windows users there are separate Windows installers available; this discussion only considers UNIX/Linux/OS X installations. Windows users who which to build GMT from the sources refer to README.WIN32.

A reminder

If you think it is appropriate, you may consider paying us back by including our latest EOS article (Wessel, P., W. H. F. Smith, R. Scharroo, J. F. Luis, and F. Wobbe (2013), Generic Mapping Tools: Improved version released, Eos Trans. AGU, 94(45), 409-410, doi:10.1002/2013EO450001) in the reference list of your future publications that will benefit from the availability of GMT.

Note to package maintainers

Package maintainers note packaging recommendations at

Build and runtime prerequisites

  • Software: You need Ghostscript, CMake (>=2.8.5), netCDF (>=4.0, netCDF-4/HDF5 support mandatory). Optionally install Sphinx, PCRE1 or PCRE2, GDAL, LAPACK, BLAS and FFTW (single precision version).
  • Data: You need gshhg (>=2.2.2); optionally install dcw-gmt (>=1.0.5)


Install CMake (>=2.8.5) from

Install netCDF library

For all major Linux distributions there are prepackaged development binaries available. netCDF is also available on MacOSX trough the macports and fink package managers.

Otherwise, get netCDF from You need at least version 4.0 with netCDF-4/HDF5 data model support (do not disable HDF5/ZLIB in netCDF with --disable-netcdf-4).

Install CURL library

To handle URLs we depend on libcurl so install via your favorite package manager if it is not intrinsic to your Unix installation. Otherwise, get it from

GDAL (optional)

To use the GDAL interface (ability to provide grids or images to be imported via gdal) you must have the GDAL library and include files installed. Like netCDF, GDAL is available through your favorite package manager on many *NIX systems.

PCRE (optional)

To use the PCRE interface (ability to specify regular expressions in some search options, e.g., gmtconvert) you must have the PCRE library and include files installed. PCRE is available through your favorite package manager on many *NIX systems.

Because GDAL already links with PCRE1 it is most practical to use that version. But if you insist, GMT can also be compiled with PCRE2.

LAPACK (optional)

To greatly speed up some linear algebra calculations (greenspline in particular) you must have the LAPACK library and include files installed. LAPACK is available through your favorite package manager on many NIX systems or in the case of OS X is built in. Normally this also installs BLAS but if not you need to do that separately as we are using some cblas_ functions to do linear algebra calculations.

Install support data

You can obtain GMT from Alternatively you may get GMT from any of the following FTP sites. Try the site that is closest to you to minimize transmission times:

Site FTP address
SOEST, U. of Hawaii
Lab for Satellite Altimetry, NOAA
IRIS, Washington, US
IAG-USP, U. of Sao Paulo, BRAZIL
ISV, Hokkaido U, Sapporo, JAPAN
GDS, Vienna U. of Technology, AUSTRIA
TENET, Tertiary Education & Research Networks, SOUTH AFRICA

The development sources are available from the subversion repository at svn://

Extract the files and put them in a separate directory (need not be where you eventually want to install GMT).

Building GMT (quick start)

This is just a quick start description. For a more thorough description read more on Building GMT with CMake

Checkout GMT5 from its GitHub repository:

git clone
cd gmt
cp cmake/ConfigUserTemplate.cmake cmake/ConfigUser.cmake

Edit cmake/ConfigUser.cmake [see comments in the file]. Then:

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -j

where x is the number of threads you want to use and depends on the number of cores in your CPU and if hyperthreading is available or not. cmake will build out-of-source in the the directory build. 'CMAKE_BUILD_TYPE' can be one of: empty, Debug, Release, RelWithDebInfo or MinSizeRel

make -j install

installs a basic gmt in build/gmt.

NOTE: All cmake command line options such as -DCMAKE_INSTALL_PREFIX can be configured in cmake/ConfigUser.cmake.

Set path

Make sure users set their PATH to include the directory containing the GMT executables (BINDIR) if this is not a standard directory like /usr/local/bin. You should now be able to run GMT programs.

GMT supplemental Code

GMT users elsewhere have developed programs that utilize the GMT libraries and produce PostScript code compatible with the rest of GMT or simply perform data manipulation. In addition, misc. code developed by us depend on GMT libraries. Currently, the supplemental archive include the directories:

gshhg - Data extractor for GSHHG shoreline polygons and rivers, borders. img - Data extractor for Smith/Sandwell altimetry grids. meca - Plotting of focal mechanisms, velocity arrows, and error ellipses on maps. mgd77 - Programs for handling of native MGD77 files. misc - dimfilter potential - geopotential manipulations segyprogs - Plotting SEGY seismic data sets. spotter - Plate tectonic & kinematics applications. x2sys - Track intersection (crossover) tools.


Before running programs, there are a few things you should do/know:

  • Read carefully the documentation for the gmt system. This can be found as both PDF and HTML files in the doc/pdf|html directories. The successful operation of gmt-programs depends directly on your understanding of how gmt "works", its option lists, I/O, and composite plot mechanisms. Then, before running individual gmt programs, read the associated man page.

Software support

You haven't bought anything so you cannot expect full service. However, if you find a bug in any of the programs, please report it to us ( rather than trying to fix it yourself so that we, and through us, other users may benefit from your find. Make sure you provide us with enough information so that we can recreate the problem.

In addition to the bug tracking feature (New Issues) on the website, you can also post general questions on the GMT user forum. Note that registration is required to post on the site.

Ordering the GMT package on CD/DVD-Rs

Should you or someone you know without net-access need to obtain GMT: Geoware makes and distributes CD/DVD-Rs with the GMT package and many useful data sets. For more details and a full description of the data sets (up to 60 Gb of data!) visit

Good luck!

The GMT Team.