Skip to content
Commits on Source (73)
# The Founders
GMT was conceived and designed in the late 1980s and early 1990s
by [Paul Wessel](http://www.soest.hawaii.edu/pwessel/) and
[Walter H.F. Smith](https://www.star.nesdis.noaa.gov/star/Smith_WHF.php).
The two founders built and maintained GMT from version 1 through 3.
# Addition of Team Members
GMT 4 benefitted from numerous contributions from two new team members
[Remko Scharroo](https://www.researchgate.net/profile/Remko_Scharroo)
and [Joaquim Luis](http://w3.ualg.pt/~jluis/).
GMT 5 saw major new contributions from team member Florian Wobbe.
GMT 6 has benefitted from the contributions of two new team members
[Leonardo Uieda](https://www.leouieda.com) and
[Dongdong Tian](https://msu.edu/~tiandong/).
# Supplement Contributions
[Tim Henstock](https://www.southampton.ac.uk/oes/research/staff/then.page)
contributed the segy supplement, while
[Kurt Feigl](http://geoscience.wisc.edu/geoscience/people/faculty/feigl/) and
Genevieve Patau wrote the seis supplement.
[Dennis Milbert](https://geodesyworld.github.io) donated the Fortran code that
was translated to become earthtide.c.
[David Sandwell](https://topex.ucsd.edu/sandwell/) contributed the img supplement.
# Further Acknowledgments
We would also like to acknowledge feedback, suggestions and bug reports
from Andreas Bjørnestad, Michael Barck, Manfred Brands, Allen Cogbill, Stephan Eickschen, John Helly,
Ben Horner-Johnson, Kristof Koch, John Kuhn, Angel Li, Andrew Macrae, Alex Madon, Ken McLean,
Greg Neumann, Ameet Raval, John Robbins, Georg Schwarz, Richard Signell, Peter Schmidt,
Dirk Stoecker, Eduardo Suárez, Mikhail Tchernychev, Malte Thoma, David Townsend,
Garry Vaughan, William Weibel, and many others, including their advice on how
to make GMT portable to a wide range of platforms. John Lillibridge and Stephan
Eickschen provided the original Examples (11) and (32), respectively; Hanno von
Lom helped resolve early problems with DLL libraries for Win32; Lloyd Parkes
enabled indexed color images in PostScript; Brent Wood developed the GMT/OGR format;
Wayne Wilson implemented the full general perspective projection; and William Yip
helped translate GMT to POSIX ANSI C and incorporate netCDF 3. The SOEST RCF staff
(Ross Ishida, Pat Townsend, and Sharon Stahl) provided valuable help on Linux and
web server support.
# Building GMT
This document describes how to build GMT from source codes
(stable release or development version) on Linux, macOS and Windows.
## Contents
For general users:
- [Build and runtime dependencies](#build-and-runtime-dependencies)
- [Installing dependencies](#installing-dependencies)
* [Ubuntu/Debian](#ubuntudebian)
* [RHEL/CentOS](#rhelcentos)
* [Fedora](#fedora)
* [Archlinux](#archlinux)
* [FreeBSD](#freebsd)
* [macOS with homebrew](#macos-with-homebrew)
* [Windows](#windows)
- [Getting GMT source codes](#getting-gmt-source-codes)
- [Configuring](#configuring)
- [Building GMT source codes](#building-gmt-source-codes)
- [Installing](#installing)
- [Setting path](#setting-path)
For developers and advanced users:
- [Building documentation](#building-documentation)
- [Running tests](#running-tests)
- [Creating source packages](#creating-source-packages)
- [Packaging](#packaging)
- [Updating the development source codes](#updating-the-development-source-codes)
For package maintainers:
- [Packaging GMT](#packaging-gmt)
## Build and runtime dependencies
To build GMT, you must install:
- [CMake](https://cmake.org/) (>=2.8.5)
- [Ghostscript](https://www.ghostscript.com/)
- [netCDF](https://www.unidata.ucar.edu/software/netcdf/) (>=4.0, netCDF-4/HDF5 support mandatory)
- [curl](https://curl.haxx.se/)
Optionally install these for more capabilities within GMT:
- [GDAL](https://www.gdal.org/) (Ability to read and write numerous grid and image formats)
- [PCRE](https://www.pcre.org/) or PCRE2 (Regular expression support)
- [FFTW](http://www.fftw.org/) single-precision (Fast FFTs, >=3.3 [not needed under macOS])
- [GLib](https://developer.gnome.org/glib/) GTHREAD support
- LAPACK (Fast matrix inversion [not needed under macOS])
- BLAS (Fast matrix multiplications [not needed under macOS])
For movie-making capabilities these executables are needed:
- [GraphicsMagick](http://www.graphicsmagick.org/) (Convert images to animated GIFs)
- [FFmpeg](http://www.ffmpeg.org/) (Convert images to videos)
For viewing documentation under Linux via `gmt docs`, your need `xdg-open`:
- xdg-open (Unified open for a variety of files)
Optionally install for building GMT documentations and running tests:
- [Sphinx](http://www.sphinx-doc.org) (>=1.4.x, for building the manpage and HTML documentation)
- [GraphicsMagick](http://www.graphicsmagick.org/) (for running the tests)
You also need to download support data:
- [GSHHG](https://www.soest.hawaii.edu/pwessel/gshhg/): A Global Self-consistent, Hierarchical, High-resolution Geography Database (>=2.2.0)
- [DCW-GMT](https://www.soest.hawaii.edu/pwessel/dcw/): The Digital Chart of the World (optional, >=1.0.5)
## Installing dependencies
### Ubuntu/Debian
For Ubuntu and Debian, there are prepackaged development binaries available.
Install the GMT dependencies with:
# Install required dependencies
sudo apt-get install build-essential cmake libcurl4-gnutls-dev libnetcdf-dev ghostscript
# Install optional dependencies
sudo apt-get install gdal-bin libgdal-dev libfftw3-dev libpcre3-dev liblapack-dev libblas-dev libglib2.0-dev
# to enable movie-making
sudo apt-get install graphicsmagick ffmpeg
# to enable document viewing via gmt docs
sudo apt-get install xdg-utils
# to enable testing
sudo apt-get install graphicsmagick
# to build the documentation
sudo apt-get install python-sphinx
### RHEL/CentOS
For RHEL and CentOS, GMT's dependencies are available from Extra Packages for Enterprise Linux.
You can add this repository by telling yum:
sudo yum install epel-release
You then can install the GMT dependencies with:
# Install necessary dependencies
sudo yum install cmake libcurl-devel netcdf-devel ghostscript
# Install optional dependencies
sudo yum install gdal gdal-devel pcre-devel fftw3-devel lapack-devel openblas-devel glib2-devel
# to enable movie-making
# ffmpeg is provided by [rmpfusion](https://rpmfusion.org/)
sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
sudo yum install GraphicsMagick ffmpeg
# to enable document viewing via gmt docs
sudo yum install xdg-utils
# to enable testing
sudo yum install GraphicsMagick
# to build the documentation
sudo yum install python-sphinx
### Fedora
For Fedora, there are prepackaged development binaries available.
Install the GMT dependencies with:
# Install necessary dependencies
sudo dnf install cmake libcurl-devel netcdf-devel ghostscript
# Install optional dependencies
sudo dnf install gdal gdal-devel pcre-devel fftw3-devel lapack-devel openblas-devel glib2-devel
# to enable movie-making
# ffmpeg is provided by [rmpfusion](https://rpmfusion.org/)
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install GraphicsMagick ffmpeg
# to enable document viewing via gmt docs
sudo dnf install xdg-utils
# to enable testing
sudo dnf install GraphicsMagick
# to build the documentation
sudo dnf install python-sphinx
### Archlinux
For Archlinux, there are prepackaged development binaries available.
Install the gmt dependencies with:
# install necessary dependencies
sudo pacman -S base-devel cmake libcurl-gnutls netcdf ghostscript
# install optional dependencies
sudo pacman -S gdal pcre fftw lapack openblas glib2
# to enable movie-making
sudo pacman -S graphicsmagick ffmpeg
# to enable document viewing via gmt docs
sudo pacman -S xdg-utils
# to enable testing
sudo pacman -S graphicsmagick
# to build the documentation
sudo pacman -S python-sphinx
### FreeBSD
For FreeBSD, there are prepackaged development binaries available.
Install the gmt dependencies with:
# install necessary dependencies
sudo pkg install shells/bash devel/cmake ftp/curl science/netcdf print/ghostscript9
# install optional dependencies
sudo pkg install graphics/gdal devel/pcre math/fftw3-float math/lapack math/openblas
# to enable movie-making
sudo pkg install graphics/GraphicsMagick multimedia/ffmpeg
# to enable document viewing via gmt docs
sudo pkg install xdg-utils
# to enable testing
sudo pkg install graphics/GraphicsMagick
# to build the documentation
sudo pkg install py36-sphinx
### macOS with homebrew
For macOS with [homebrew](https://brew.sh/) installed, you can install the dependencies with:
# Install necessary dependencies
brew install cmake curl netcdf ghostscript
# Install optional dependencies
brew install gdal pcre2 fftw glib
# to enable movie-making
brew install graphicsmagick ffmpeg
# to enable testing
brew install graphicsmagick
# to build the documentation
brew install sphinx-doc
### Windows
For some software, e.g. CMake, Ghostscript, GraphicsMagick and FFmpeg,
you can download binary installers to install them.
If there is an option to add it to the system PATH, remember to tick it.
For other dependency libraries, it's recommended to install them
via [vcpkg](https://github.com/microsoft/vcpkg).
To use vcpkg, make sure you have met the prerequisites:
- Windows 10, 8.1, 7
- [Visual Studio 2015 Update 3 or newer](https://visualstudio.microsoft.com/)
with "Desktop development with C++" installed
- [Git](https://git-scm.com/)
- [CMake](https://cmake.org) >=3.12.4
Open a command prompt, and install vcpkg with:
cd C:\
git clone https://github.com/microsoft/vcpkg
cd C:\vcpkg
.\bootstrap-vcpkg.bat
After installing vcpkg, you can install the GMT dependency libraries with (it may take more than 30 minutes):
# Build and install libraries
# If you want to build x64 libraries (recommended)
vcpkg install netcdf-c gdal pcre fftw3 clapack openblas --triplet x64-windows
# If you want to build x86 libraries
vcpkg install netcdf-c gdal pcre fftw3 clapack openblas --triplet x86-windows
# hook up user-wide integration (note: requires admin on first use)
vcpkg integrate install
After installing these dependency libraries, you also need to add
vcpkg's bin path (i.e. `C:\vcpkg\installed\x64-windows\bin`) and
GDAL's bin path (i.e. `C:\vcpkg\installed\x64-windows\tools\gdal`),
to the system environmental variable `PATH`,
so that GMT executables can find the DLL shared libraries and
the GDAL tools (`gdal_translate` and `ogr2ogr`).
## Getting GMT source codes
The latest stable release of the GMT source codes (filename: gmt-x.x.x-src.tar.gz)
are available from the [GMT main site](https://www.generic-mapping-tools.org).
If you want to build/use the latest developing/unstable GMT, you can get the source codes from GitHub by:
git clone https://github.com/GenericMappingTools/gmt
You can also get supporting data GSHHG and DCW (filename: gshhg-gmt-x.x.x.tar.gz and dcw-gmt-x.x.x.tar.gz)
from the [GMT main site](https://www.generic-mapping-tools.org).
Extract the files and put them in a separate directory (need not be where you eventually want to install GMT).
## Configuring
GMT can be built on any platform supported by CMake. CMake is a cross-platform,
open-source system for managing the build process. The building process is
controlled by two configuration files in the `cmake` directory:
- *ConfigDefault.cmake* is version controlled and used to add new default
variables and set defaults for everyone. **You should NOT edit this file.**
- *ConfigUser.cmake* is not version controlled and used to override defaults
on a per-user basis.
There is a template file, *ConfigUserTemplate.cmake*, that you should copy
to *ConfigUser.cmake* and make your changes therein.
In the source tree, copy the template configuration file
`cmake/ConfigUserTemplate.cmake` to `cmake/ConfigUser.cmake`,
and edit the file according to your demands. This is an example:
```
set (CMAKE_INSTALL_PREFIX /opt/gmt)
set (GSHHG_ROOT /path/to/gshhg)
set (DCW_ROOT /path/to/dcw)
set (COPY_GSHHG true)
set (COPY_DCW true)
```
For Windows users, a good example is:
```
set (CMAKE_INSTALL_PREFIX "C:/programs/gmt6")
set (GSHHG_ROOT <path to gshhg>)
set (DCW_ROOT <path to dcw>)
set (COPY_GSHHG true)
set (COPY_DCW true)
set (GMT_INSTALL_MODULE_LINKS FALSE)
set (CMAKE_C_FLAGS "/D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_DEPRECATE ${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE ${CMAKE_C_FLAGS}")
```
See the additional comments in `cmake/ConfigUserTemplate.cmake` for more details.
Now that you made your configuration choices, it is time for invoking CMake.
To keep generated files separate from source files in the source tree,
you should create a build directory in the top-level directory,
where the build files will be generated, and change into your build directory:
```
mkdir build
cd build
cmake ..
```
For Windows users, you need to open a command prompt and run:
```
mkdir build
cd build
# For x64 build
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_GENERATOR_PLATFORM=x64
# For x86 build
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_GENERATOR_PLATFORM=x86
```
For advanced users, you can append the option `-G Ninja` to use the
build tool [Ninja](https://ninja-build.org/), which is a small build system
with a focus on speed.
## Building GMT source codes
In the build directory, type
```
# Linux/macOS
cmake --build .
# Windows
cmake --build . --config Release
```
which will compile all the programs. You can also append **--parallel** [*jobs*]
to enable parallel build, in which *jobs* is the maximum number of concurrent
processes to use when building. If *jobs* is omitted the native build tool's
default number is used.
## Installing
```
# Linux/macOS
cmake --build . --target install
# Windows
cmake --build . --target install --config Release
```
will install gmt executable, library, development headers and built-in data
to the specified GMT install location.
Optionally it will also install the GSHHG shorelines (if found), DCW (if found),
UNIX manpages, and HTML documentations.
Depending on where GMT is being installed, you might need
write permission for this step so you can copy files to system directories.
Using `sudo` will often do the trick.
## Setting path
Make sure you set the `PATH` to include the directory containing the GMT executables
if this is not a standard directory like `/usr/local/bin`.
For Linux/macOS users, open your SHELL configuration file (usually `~/.bashrc`)
and add the line below to it.
```
export PATH=${PATH}:/path/to/gmt/bin
```
Then, you should now be able to run GMT programs.
---
**Below are instructions for developers and advanced users.**
## Building documentation
The GMT documentations are available in different formats and can be generated with:
```
cmake --build . --target docs_man # UNIX manual pages
cmake --build . --target docs_html # HTML manual, tutorial, cookbook, and API reference
```
To generate the documentation you need to install the [Sphinx](http://www.sphinx-doc.org/)
documentation builder. You can choose to install the documentation files
from an external location instead of generating the Manpages, and HTML files from the sources.
This is convenient if Sphinx is not available. Set *GMT_INSTALL_EXTERNAL_DOC* in
`cmake/ConfigUser.cmake`.
## Running tests
A complete set of the example scripts used to create all the example plots,
including all necessary data files, are provided by the installation.
To enable testing, you need following lines in your `ConfigUser.cmake`:
```
enable_testing()
set (DO_EXAMPLES TRUE)
set (DO_TESTS TRUE)
set (DO_ANIMATIONS TRUE)
set (DO_API_TESTS ON)
set (SUPPORT_EXEC_IN_BINARY_DIR TRUE)
```
Then run:
```
cmake --build . --target check
```
Optionally set *N_TEST_JOBS* to the number of ctest jobs to run simultaneously.
You can also select individual tests using regexp with ctest, e.g.:
```
ctest --output-on-failure -R ex2[3-6]
```
## Creating source packages
Edit `cmake/ConfigDefault.cmake` and set
*GMT_PACKAGE_VERSION_MAJOR*, *GMT_PACKAGE_VERSION_MINOR*, and
*GMT_PACKAGE_VERSION_PATCH*. Also set *GMT_PUBLIC_RELEASE* to TRUE.
Then create source packages with:
```
cmake --build . --target gmt_release # export the source tree and documentation
cmake --build . --target gmt_release_tar # create tarballs (in tar.gz and tar.xz formats)
```
## Packaging
Currently, packaging with CPack works on macOS (Bundle, TGZ, TBZ2),
Windows (ZIP, NSIS), and UNIX (TGZ, TBZ2). On Windows you need to install
[NSIS](http://nsis.sourceforge.net/). After building GMT and the documentation,
build and place the executables, including the supplements, with
```
cmake --build . --target install
```
and then create the package with either one of these:
```
cmake --build . --target package
cpack -G <TGZ|TBZ2|Bundle|ZIP|NSIS>
```
## Updating the development source codes
Assuming you did not delete the build directory, this is just as simple as
```
cd path-to-gmt
git pull
cd build
cmake --build .
cmake --build . --target install
```
CMake will detect any changes to the source files and will automatically
reconfigure. If you deleted all files inside the build directory you have to
run cmake again manually.
---
## Packaging GMT
**These recommendations are directed at package maintainers of GMT.**
First split off DCW-GMT and GSHHG into separate architecture independent packages,
e.g., `dcw-gmt` and `gshhg-gmt`, because they have a different development cycle.
Files should go into directories `/usr/share/dcw-gmt/` and `/usr/share/gshhg-gmt/` or
`/usr/share/gmt/{dcw,gshhg}/`. Then configure GMT as shown below.
### DCW-GMT
- **Homepage**: https://www.soest.hawaii.edu/pwessel/dcw/
- **Summary**: Digital Chart of the World (DCW) for GMT
- **License**: LGPL-3+
- **Source**:
- https://www.soest.hawaii.edu/pwessel/dcw/dcw-gmt-x.x.x.tar.gz
- ftp://ftp.soest.hawaii.edu/dcw/dcw-gmt-x.x.x.tar.gz
- **Description**: DCW-GMT is an enhancement to the original 1:1,000,000 scale vector basemap of the world,
available from the Princeton University Digital Map and Geospatial Information Center.
It contains more state boundaries (the largest 8 countries are now represented) than the original data source.
Information about DCW can be found on Wikipedia (https://en.wikipedia.org/wiki/Digital_Chart_of_the_World).
This data is for use by GMT, the Generic Mapping Tools.
### GSHHG
- **Homepage**: https://www.soest.hawaii.edu/pwessel/gshhg/
- **Summary**: Global Self-consistent Hierarchical High-resolution Geography (GSHHG)
- **License**: LGPL-3+
- **Source**:
- https://www.soest.hawaii.edu/pwessel/gshhg/gshhg-gmt-x.x.x.tar.gz
- ftp://ftp.soest.hawaii.edu/gshhg/gshhg-gmt-x.x.x.tar.gz
- **Description**: GSHHG is a high-resolution shoreline data set amalgamated from
two databases: Global Self-consistent Hierarchical High-resolution Shorelines (GSHHS)
and CIA World Data Bank II (WDBII). GSHHG contains vector descriptions at five different
resolutions of land outlines, lakes, rivers, and political boundaries.
This data is for use by GMT, the Generic Mapping Tools.
### GMT
- **Homepage**: https://www.generic-mapping-tools.org/
- **Summary**: Generic Mapping Tools
- **License**: GPL-3+, LGPL-3+, or Restrictive depending on LICENSE_RESTRICTED setting
- **Source**:
- ftp://ftp.soest.hawaii.edu/gmt/gmt-6.x.x-src.tar.xz
- ftp://ftp.soest.hawaii.edu/gmt/gmt-6.x.x-src.tar.gz
- **Description**: GMT is an open-source collection of command-line tools for
manipulating geographic and Cartesian data sets (including filtering, trend fitting,
gridding, projecting, etc.) and producing PostScript illustrations ranging from simple
x–y plots via contour maps to artificially illuminated surfaces and 3D perspective views.
It supports many map projections and transformations and includes supporting data
such as coastlines, rivers, and political boundaries and optionally country polygons.
- **Build dependencies**:
- cmake
- gcc
- curl
- netcdf
- gdal
- pcre
- fftw
- glib2
- lapack
- openblas
- dcw-gmt
- gshhg-gmt
- **Runtime dependencies**:
- ghostscript (*required*)
- curl (*required*)
- netcdf (*required*)
- gdal
- pcre
- fftw
- glib2
- lapack
- openblas
- dcw-gmt
- gshhg-gmt (at least the crude resolution GSHHG files are mandatory)
- **CMake arguments**:
```
-DCMAKE_C_FLAGS=-fstrict-aliasing
-DCMAKE_INSTALL_PREFIX=${prefix}
-DDCW_ROOT=${prefix}/share/gmt/dcw
-DGSHHG_ROOT=${prefix}/share/gmt/gshhg
-DNETCDF_ROOT=${prefix}
-DFFTW3_ROOT=${prefix}
-DGDAL_ROOT=${prefix}
-DPCRE_ROOT=${prefix}
-DGMT_INSTALL_MODULE_LINKS=off
-DGMT_INSTALL_TRADITIONAL_FOLDERNAMES=off
-DLICENSE_RESTRICTED=LGPL or -DLICENSE_RESTRICTED=no to include non-free code
```
Note that you have to configure and build out-of-source.
It is safe to make a parallel build with `make -j`.
It is expected that the GMT supplements plugin be distributed with the core programs.
# Citing GMT
If you think it is appropriate, you may consider paying us back by including
our latest article in the reference list of your future publications that
will benefit from the availability of GMT:
> Wessel, P., Luis, J., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F., & Tian, D. (2019).
> The Generic Mapping Tools Version 6. Geochemistry, Geophysics, Geosystems, 20.
> https://doi.org/10.1029/2019GC008515
Here is a BibTeX entry for LaTeX users:
```
@article{doi:10.1029/2019GC008515,
title = {The {Generic Mapping Tools} Version 6},
author = {Wessel, P. and Luis, J. and Uieda, L. and Scharroo, R. and Wobbe, F. and Smith, W.H.F. and Tian, D.},
year={2019},
journal = {Geochemistry, Geophysics, Geosystems},
doi = {10.1029/2019GC008515},
}
```
#
# $Id$
#
# Copyright (c) 1991-2019 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
# See LICENSE.TXT file for copying and redistribution conditions.
#
# This program is free software; you can redistribute it and/or modify
......@@ -13,10 +11,12 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# Contact info: gmt.soest.hawaii.edu
# Contact info: www.generic-mapping-tools.org
#-------------------------------------------------------------------------------
#
# To modify the cmake process: Edit your cmake/ConfigUser.cmake file
# To configure the cmake process, first copy the configuration template
# 'cmake/ConfigUserTemplate.cmake' to 'cmake/ConfigUser.cmake',
# then edit 'cmake/ConfigUser.cmake'.
#
# To build out-of-source do (example):
#
......@@ -26,9 +26,6 @@
#
# CMAKE_BUILD_TYPE can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
#
# cmake creates a new file cmake/ConfigUser.cmake if it does not already
# exist. You can configure additional options there.
#
# Make sure the user doesn't play dirty with symlinks
get_filename_component (srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
......@@ -49,6 +46,8 @@ cmake_minimum_required (VERSION 2.8.5)
# Use NEW behavior with newer CMake releases
foreach(p
CMP0025 # CMake 3.0: Compiler id for Apple Clang is now AppleClang
CMP0058 # CMake 3.3: Ninja requires custom command byproducts to be explicit
CMP0074 # CMake 3.12: find_package uses PackageName_ROOT variables
)
if(POLICY ${p})
cmake_policy(SET ${p} NEW)
......@@ -71,19 +70,17 @@ project (GMT C)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/"
CACHE INTERNAL "Location of our custom CMake modules." FORCE)
# Include configuration options (default options and options overridden by user).
include (ConfigCMake)
# Find UNIX commands
include (FindUnixCommands)
find_program (GIT git)
find_program (GS gs gswin64)
find_program (XZ NAMES xz)
find_package (Git)
# Include configuration options (default options and options overridden by user).
include (ConfigCMake)
# Global test target
add_custom_target (check
COMMAND ${CMAKE_CTEST_COMMAND}
--force-new-ctest-process -j${N_TEST_JOBS})
--output-on-failure --force-new-ctest-process -j${N_TEST_JOBS})
# Find test dependencies
find_program (GRAPHICSMAGICK gm)
......@@ -93,44 +90,60 @@ if (DO_EXAMPLES OR DO_TESTS AND NOT GRAPHICSMAGICK)
endif (DO_EXAMPLES OR DO_TESTS AND NOT GRAPHICSMAGICK)
# Add subdirectories
#set(_manfiles_ps "" CACHE INTERNAL "Global list of PS manpages")
add_subdirectory (src)
add_subdirectory (share) # share must be processed *after* src (GSHHG_PATH)
add_subdirectory (doc) # share must be processed *after* src (PDF manpages)
add_subdirectory (doc) # doc must be processed *after* src
if (EXISTS ${GMT_SOURCE_DIR}/test/)
add_subdirectory (test)
endif (EXISTS ${GMT_SOURCE_DIR}/test/)
add_subdirectory (cmake/dist) # make distribution bundles (always last)
# Source release target
if (GIT AND HAVE_SVN_VERSION)
# Export svn working tree
#add_custom_target (git_export_release_tar
# COMMAND ${GIT} archive --prefix=gmt-${GMT_PACKAGE_VERSION}/ -o ${GMT_RELEASE_PREFIX}.tar 5.4
# WORKING_DIRECTORY ..)
if (GZIP AND XZ)
if (GIT_FOUND AND HAVE_GIT_VERSION)
# Export git working tree
add_custom_target (git_export_release
COMMAND ${GIT_EXECUTABLE} -C ${GMT_SOURCE_DIR} checkout-index -a -f --prefix=${GMT_RELEASE_PREFIX}/)
# Remove some directories and files, so that they are not included in the final release tarball
add_custom_target (git_prune_dirs
COMMAND ${CMAKE_COMMAND} -E remove_directory ${GMT_RELEASE_PREFIX}/.git
COMMAND ${CMAKE_COMMAND} -E remove_directory ${GMT_RELEASE_PREFIX}/.github
COMMAND ${CMAKE_COMMAND} -E remove_directory ${GMT_RELEASE_PREFIX}/admin
COMMAND ${CMAKE_COMMAND} -E remove_directory ${GMT_RELEASE_PREFIX}/ci
COMMAND ${CMAKE_COMMAND} -E remove_directory ${GMT_RELEASE_PREFIX}/test)
add_custom_target (git_prune_files
COMMAND ${CMAKE_COMMAND} -E remove
${GMT_RELEASE_PREFIX}/.azure-pipelines.yml
${GMT_RELEASE_PREFIX}/.gitignore)
add_depend_to_target (git_prune_dirs git_export_release)
add_depend_to_target (gmt_release git_prune_dirs)
add_depend_to_target (git_prune_files git_export_release)
add_depend_to_target (gmt_release git_prune_files)
find_program (GNUTAR NAMES gnutar gtar tar)
find_program (XZ NAMES xz)
if (GNUTAR AND GZIP AND XZ)
# Targets for creating tarballs
string (REGEX REPLACE ".*/" "" _release_dirname "${GMT_RELEASE_PREFIX}")
add_custom_command (OUTPUT ${_release_dirname}-src.tar
COMMAND ${GIT} archive --prefix=gmt-${GMT_PACKAGE_VERSION}/ -o ${GMT_RELEASE_PREFIX}-src.tar 5.4
WORKING_DIRECTORY ..
COMMAND ${GNUTAR} -c --owner 0 --group 0 --mode a=rX,u=rwX --force-local
-f ${GMT_BINARY_DIR}/${_release_dirname}-src.tar ${_release_dirname}
DEPENDS ${GMT_RELEASE_PREFIX}
WORKING_DIRECTORY ${GMT_RELEASE_PREFIX}/..
VERBATIM)
add_custom_command (OUTPUT ${_release_dirname}-src.tar.gz
COMMAND ${GZIP} -9 --keep --force ${GMT_BINARY_DIR}/${_release_dirname}-src.tar
DEPENDS ${_release_dirname}-src.tar
DEPENDS ${GMT_RELEASE_PREFIX} ${_release_dirname}-src.tar
WORKING_DIRECTORY ${GMT_RELEASE_PREFIX}/..
VERBATIM)
add_custom_command (OUTPUT ${_release_dirname}-src.tar.xz
COMMAND ${XZ} -9 --keep --force ${GMT_BINARY_DIR}/${_release_dirname}-src.tar
DEPENDS ${_release_dirname}-src.tar
COMMAND ${XZ} -9 -T 0 --keep --force ${GMT_BINARY_DIR}/${_release_dirname}-src.tar
DEPENDS ${GMT_RELEASE_PREFIX} ${_release_dirname}-src.tar
WORKING_DIRECTORY ${GMT_RELEASE_PREFIX}/..
VERBATIM)
add_custom_target (gmt_release_tar
DEPENDS ${_release_dirname}-src.tar
DEPENDS ${GMT_RELEASE_PREFIX}
${_release_dirname}-src.tar.gz ${_release_dirname}-src.tar.xz)
add_depend_to_target (gmt_release gmt_release_tar)
endif (GZIP AND XZ)
endif (GIT AND HAVE_SVN_VERSION)
endif (GNUTAR AND GZIP AND XZ)
endif (GIT_FOUND AND HAVE_GIT_VERSION)
get_target_property (_location gmtlib LOCATION)
get_filename_component (GMT_CORE_LIB_NAME ${_location} NAME)
......@@ -168,11 +181,19 @@ endif (EXTRA_BUILD_DIRS)
# Configure header file to pass some of the CMake settings to the source code
configure_file (src/config.h.in src/config.h)
if (GMT_DATA_URL) # Backwards compatibility with old ConfigUser.cmake files
set (GMT_DATA_SERVER ${GMT_DATA_URL})
endif (GMT_DATA_URL)
# Configuration done
message(
"*\n"
"* GMT Version: : ${GMT_PACKAGE_VERSION_WITH_GIT_REVISION}\n"
"*\n"
"* Options:\n"
"* Found GSHHG database : ${GSHHG_PATH} (${GSHHG_VERSION})\n"
"* Found DCW-GMT database : ${DCW_PATH}\n"
"* Found GMT data server : ${GMT_DATA_SERVER}\n"
"* NetCDF library : ${NETCDF_LIBRARY}\n"
"* NetCDF include dir : ${NETCDF_INCLUDE_DIR}\n"
"* Curl library : ${CURL_LIBRARY}\n"
......@@ -186,17 +207,23 @@ message(
"* ZLIB library : ${ZLIB_LIBRARY}\n"
"* ZLIB include dir : ${ZLIB_INCLUDE_DIR}\n"
"* LAPACK library : ${GMT_CONFIG_LAPACK_MESSAGE}\n"
"* BLAS library : ${GMT_CONFIG_BLAS_MESSAGE}\n"
"* License restriction : ${LICENSE_RESTRICTED}\n"
"* Triangulation method : ${GMT_TRIANGULATE}\n"
"* OpenMP support : ${GMT_CONFIG_OPENMP_MESSAGE}\n"
"* GLIB GTHREAD support : ${GMT_CONFIG_GTHREAD_MESSAGE}\n"
"* PTHREAD support : ${GMT_CONFIG_PTHREAD_MESSAGE}\n"
"* Build mode : ${BUILD_MODE}\n"
"* Build GMT core : always [${GMT_CORE_LIB_NAME}]\n"
"* Build PSL library : always [${PSL_LIB_NAME}]\n"
"* Build GMT supplements : ${SUPPL}\n"
"* Build GMT for developers : ${DEVEL}\n"
"* Build proto supplements : ${PROTO}\n"
"* Found Ghostscript (gs) : ${GMT_CONFIG_GS_MESSAGE}\n"
"* Found GraphicsMagick (gm) : ${GMT_CONFIG_GM_MESSAGE}\n"
"* Found ffmpeg : ${GMT_CONFIG_FFMPEG_MESSAGE}\n"
"* Found open : ${GMT_CONFIG_OPEN_MESSAGE}\n"
"* Found ogr2ogr : ${GMT_CONFIG_OGR2OGR_MESSAGE}\n"
"* Found gdal_translate : ${GMT_CONFIG_GDAL_TRANSLATE_MESSAGE}\n"
"*\n"
"* Locations:\n"
"* Installing GMT in : ${CMAKE_INSTALL_PREFIX}\n"
......@@ -209,5 +236,3 @@ message(
#foreach (_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
#endforeach()
# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at `pwessel at hawaii dot edu` or
`leouieda at gmail dot com`.
All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
# Contributing Guidelines
**First of all, thank you for considering contributing to the project.**
This is a community-driven project, so it's people like you that make it useful and
successful.
These are some of the many ways to contribute:
* :bug: Submitting bug reports and feature requests
* :memo: Writing tutorials or examples
* :mag: Fixing typos and improving to the documentation
* :bulb: Writing code for everyone to use
If you get stuck at any point you can create an issue on GitHub (look for the *Issues*
tab in the repository) or contact us at one of the other channels mentioned below.
For more information on contributing to open source projects,
[GitHub's own guide](https://guides.github.com/activities/contributing-to-open-source/)
is a great starting point if you are new to version control.
## Ground Rules
The goal is to maintain a diverse community that's pleasant for everyone.
**Please be considerate and respectful of others**.
Everyone must abide by our [Code of Conduct](CODE_OF_CONDUCT.md) and we encourage all to
read it carefully.
## Contents
* [What Can I Do?](#what-can-i-do)
* [How Can I Talk to You?](#how-can-i-talk-to-you)
* [Reporting a Bug](#reporting-a-bug)
* [Editing the Documentation](#editing-the-documentation)
* [Contributing Code](#contributing-code)
- [General guidelines](#general-guidelines)
- [Code Review](#code-review)
## What Can I Do?
* Tackle any [issue](https://github.com/GenericMappingTools/gmt/issues) that you wish!
Please leave a comment on the issue indicating that you want to work on it.
Some issues are labeled as
["good first issues"](https://github.com/GenericMappingTools/gmt/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
to indicate that they are beginner friendly, meaning that they don't require extensive
knowledge of the project.
* Report a bug you found through the [Github issues](https://github.com/GenericMappingTools/gmt/issues).
* Make a tutorial or example of how to do something.
* Provide feedback about how we can improve the project or about your particular use
case.
* Contribute code you already have. It doesn't need to be perfect! We will help you
clean things up, test it, etc.
## How Can I Talk to You?
Discussion often happens in the issues and pull requests.
We don't have a good solution for a user forum yet but we're working on it.
## Reporting a Bug
Find the [Issues](https://github.com/GenericMappingTools/gmt/issues) tab on the top of
the Github repository and click *New Issue*.
You'll be prompted to choose between different types of issue, like bug reports and
feature requests.
Choose the one that best matches your need.
The Issue will be populated with one of our templates.
**Please try to fillout the template with as much detail as you can**.
Remember: the more information we have, the easier it will be for us to solve your
problem.
## Editing the Documentation
If you're browsing the documentation and notice a typo or something that could be
improved, please consider letting us know. You can either
[create an issue](#reporting-a-bug) on GitHub, or click the "Edit on GitHub" button
at the top right corner of the documentation, and submit a fix (even better :star2:).
## Contributing Code
**Is this your first contribution?**
Please take a look at these resources to learn about git and pull requests (don't
hesitate to [ask questions](#how-can-i-talk-to-you)):
* [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/).
* Aaron Meurer's [tutorial on the git workflow](http://www.asmeurer.com/git-workflow/)
* [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)
### General guidelines
We follow the [git pull request workflow](http://www.asmeurer.com/git-workflow/) to
make changes to our codebase.
Every change made goes through a pull request, even our own, so that our
[continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) services
have a change to check that the code is up to standards and passes all our tests.
This way, the *master* branch is always stable.
General guidelines for pull requests (PRs):
* **Open an issue first** describing what you want to do. If there is already an issue
that matches your PR, leave a comment there instead to let us know what you plan to
do.
* Each pull request should consist of a **small** and logical collection of changes.
* Larger changes should be broken down into smaller components and integrated
separately.
* Bug fixes should be submitted in separate PRs.
* Describe what your PR changes and *why* this is a good thing. Be as specific as you
can. The PR description is how we keep track of the changes made to the project over
time.
* Do not commit changes to files that are irrelevant to your feature or bugfix (eg:
`.gitignore`, IDE project files, etc).
* Write descriptive commit messages. Chris Beams has written a
[guide](https://chris.beams.io/posts/git-commit/) on how to write good commit
messages.
* Be willing to accept criticism and work on improving your code; we don't want to break
other users' code, so care must be taken not to introduce bugs.
* Be aware that the pull request review process is not immediate, and is generally
proportional to the size of the pull request.
### Code Review
After you've submitted a pull request, you should expect to hear at least a comment
within a couple of days.
We may suggest some changes or improvements or alternatives.
Some things that will increase the chance that your pull request is accepted quickly:
* Write a good and detailed description of what the PR does.
* Write tests for the code you wrote/modified.
* Readable code is better than clever code (even with comments).
* Write documentation for your code and leave comments explaining the *reason* behind
non-obvious things.
* Include an example of new features in the gallery or tutorials.
Pull requests will automatically have tests run by Azure Pipelines.
Github will show the status of these checks on the pull request.
Try to get them all passing (green).
If you have any trouble, leave a comment in the PR or
[get in touch](#how-can-i-talk-to-you).
# Installing GMT
[![GitHub release](https://img.shields.io/github/release/GenericMappingTools/gmt)](https://github.com/GenericMappingTools/gmt/releases)
GMT is available on Windows, macOS and Linux.
Source and binary packages are provided for the latest release,
and can be downloaded from the [GMT main site](https://www.generic-mapping-tools.org)
and [the GitHub repository](https://github.com/GenericMappingTools/gmt/releases).
This file provides instructions for installing GMT binary packages on
different operating systems. Please refer to the [Building Instructions](BUILDING.md)
for compiling GMT source package (either stable release or development version).
Note: Distributions may not all update at the same time so check if GMT 6 is
available first.
## Contents
- [Windows](#windows)
- [macOS](#macos)
* [Application Bundle](#application-bundle)
* [Install via Homebrew](#install-via-homebrew)
* [Install via Macports](#install-via-macports)
* [Install via fink](#install-via-fink)
- [Linux](#linux)
* [Fedora](#fedora)
* [RHEL/CentOS](#rhelcentos)
* [Ubuntu/Debian](#ubuntudebian)
- [Cross Platform Install Instructions](#cross-platform-install-instructions)
* [Install via conda](#install-via-conda)
## Windows
We provide 32 and 64 bit standalone installers (e.g., gmt-6.x.x-win64.exe)
on the [GMT main site](https://www.generic-mapping-tools.org).
The installers come with GDAL, FFmpeg, and Ghostscript pre-installed.
In addition to the GMT installer, you also need to download and install
[GraphicsMagick](http://www.graphicsmagick.org/) if you want to create
animated GIFs.
## macOS
### Application Bundle
We provide macOS application bundle on the [GMT main site](https://www.generic-mapping-tools.org).
The bundle comes with GDAL, FFmpeg, Ghostscript and GraphicsMagick pre-installed.
Download the application bundle (gmt-6.x.x-darwin-x86_64.dmg), double-click to mount it
and drag GMT-6.x.x.app to the "Applications" folder (or any other folder).
GMT-6.x.x.app opens a terminal from which you can invoke GMT programs and scripts.
If you like, you can add the GMT programs contained in the application bundle to
your search path for executables. For that, just run GMT-6.x.x.app once and follow
the instructions at the end of the GMT splash screen.
Note: The installer is always built for the latest macOS version only.
### Install via Homebrew
Installation of GMT through [Homebrew](https://brew.sh/) is extremely simple.
Installing Homebrew itself is a one line command only (see [the Homebrew page](https://brew.sh/)).
You may need to update the formulas so for that you will do:
brew update && brew upgrade
For the latest GMT 6 version, use:
brew install gmt
If you want to install GMT 5 and GMT 6 alongside, do:
brew unlink gmt && brew install gmt5
and to go from GMT 6 to GMT 5 (and vice-versa for 5 to 6, but see also the doc about gmtswitch):
brew unlink gmt && brew link gmt5
You also need to install other GMT run-time dependencies separately:
brew install ghostscript graphicsmagick ffmpeg
### Install via MacPorts
Install [MacPorts](https://www.macports.org) and then the required ports in this order:
sudo port install gdal +hdf5 +netcdf +openjpeg
sudo port install gmt6
Optional FFTW-3 support and experimental OpenMP parallel acceleration can be
enabled with the `+fftw3` and `+openmp` flags.
You also need to install other GMT run-time dependencies separately:
sudo port install graphicsmagick ffmpeg
For the legacy GMT 4 or GMT 5 versions, use:
sudo port install gmt4
or:
sudo port install gmt5
### Install via fink
Installation of GMT through [Fink](http://www.finkproject.org/) is quite easy.
All required packages will also be installed.
For the latest GMT 5 version use:
sudo fink install gmt5
For the legacy GMT 4 version use:
sudo fink install gmt
The two versions cannot live side by side.
You also need to install other GMT run-time dependencies separately:
fink install ghostscript graphicsmagick ffmpeg
## Linux
### Fedora
The GMT binary packages provided by the Fedora official repositories are usually too old.
We provide [the GMT official RPM repository](https://copr.fedorainfracloud.org/coprs/genericmappingtools/gmt)
to allow Fedora users access the latest GMT releases in an easy way.
Fedora users can add the GMT official RPM repository and install gmt by:
# enable the RPM repository
dnf copr enable genericmappingtools/gmt
# Install the latest GMT provided by the RPM repository
dnf install gmt
# Update to the latest version if available
dnf update gmt
You may also install other optional dependencies for more capabilities within GMT:
dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
dnf install GraphicsMagick ffmpeg gdal
**Note**:
If you already installed the GMT packages provided by Fedora,
you have to uninstall them before installing the new GMT packages provided
by the official GMT repository. You can uninstall the older packages by:
dnf uninstall GMT dcw-gmt gshhg-gmt-nc4 gshhg-gmt-nc4-full gshhg-gmt-nc4-high
### RHEL/CentOS
GMT binary packages are available from Extra Packages for Enterprise Linux (EPEL).
However, EPEL is far hebind packaging a recent version.
We provide [the GMT official RPM repository](https://copr.fedorainfracloud.org/coprs/genericmappingtools/gmt)
to allow RHEL/CentOS users access the latest GMT releases in an easy way.
For RHEL/CentOS, run:
# install epel-release
yum install epel-release
# enable the RPM repository (RHEL/CentOS 7 ONLY)
yum install yum-plugin-copr
yum copr enable genericmappingtools/gmt
# enable the RPM repository (RHEL/CentOS 6 ONLY)
wget https://copr.fedorainfracloud.org/coprs/genericmappingtools/gmt/repo/epel-6/genericmappingtools-gmt-epel-6.repo -O /etc/yum.repos.d/genericmappingtools-gmt-epel-6.repo
# Install GMT
yum install gmt
# Update to the latest version if available
yum update gmt
You may also install other optional dependencies for more capabilities within GMT:
yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
yum install GraphicsMagick ffmpeg gdal
**Note**:
If you already installed the GMT packages provided by EPEL,
you have to uninstall them before installing the new GMT packages provided
by the official GMT repository. You can uninstall the older packages by:
yum uninstall GMT dcw-gmt gshhg-gmt-nc4 gshhg-gmt-nc4-full gshhg-gmt-nc4-high
### Ubuntu/Debian
**Note:** Ubuntu/Debian are way behind in packing a recent GMT version.
Typically you may find they offer 5.2.1 from 2015 while the rest of us have
moved on to 2019. Your best bet then is to
[build the latest release from source](BUILDING.md).
Otherwise, installing from the distros goes like this:
Install GMT5 via
sudo apt-get install gmt gmt-dcw gmt-gshhg
Install other GMT dependencies (some are optional) via:
# required
sudo apt-get install ghostscript
# optional
sudo apt-get install gdal-bin
**Note:** The Ubuntu package under 16.04 LTS for mysterious reasons does not
include the supplements. If you need them you will need to
[build from source](BUILDING.md) or upgrade to 18.04 LTS.
## Cross Platform Install Instructions
### Install via conda
You can use the [conda package manager](https://conda.io/) that comes with the
[Anaconda Python Distribution](https://www.anaconda.com/distribution/) to install GMT.
1. Download and install the [Python **3.7** **64-bit** version of Miniconda](https://conda.io/en/latest/miniconda.html).
This will give you access to the conda package manager. **Make sure you select to
have conda added to your `PATH` when asked by the installer**. If you have
the Anaconda Python distribution installed, you won't need to do this step.
2. Install GMT and its dependencies (including ghostscript, gdal, ffmpeg and graphicsmagick)
by running the following in a terminal:
```
conda install gmt -c conda-forge
```
NOTE: Currently conda-forge doesn't provide graphicsmagick on win-64 platform.
Windows users need to download and install graphicsmagick separately.
3. If you want to install GMT 5, use:
```
conda install gmt=5 -c conda-forge
```
$LastChangedDate$
$Revision$
Copyright (c) 1991–2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
As of GMT 5.0.0, GMT is distributed under the GNU Lesser General Public
License (LGPL) version 3 or later. Copies of the The GNU General Public
License (LGPL) version 3 or later. Copies of the GNU General Public
License (GPL) and the GNU Lesser General Public License (LGPL) are
distributed along with the sources. Refer to the files COPYINGv3 and
COPYING.LESSERv3.
......@@ -22,10 +21,13 @@ permission notice appear in supporting documentation, and that the name
of GMT not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission. The GMT package may be included in a bundled distribution
of software for which a fee may be charged. The University of Hawaii
(UH) and the National Oceanic and Atmospheric Administration (NOAA)
make no representations about the suitability of this software for any
purpose. It is provided "as is" without expressed or implied warranty.
It is provided with no support and without obligation on the part of UH
or NOAA, to assist in its use, correction, modification, or
enhancement.
of software for which a reasonable fee may be charged.
The GMT package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
In particular, the authors or any other individuals involved in the design and
maintenance of GMT, as well as their employers, are NOT responsible
for any damage that may follow from correct or incorrect use of these programs.
It is provided with no support and without obligation on the part of the authors,
to assist in its use, correction, modification, or enhancement.
$Id$
== Information for installing GMT 5 ==
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.
Introduction
------------
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-5.x.x.tar.bz2: The GMT 5 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 http://www.bzip.org.
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.
CMake
-----
Install CMake (>=2.8.5) from http://www.cmake.org/cmake/resources/software.html
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 http://www.unidata.ucar.edu/downloads/netcdf/.
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 https://curl.haxx.se.
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.
Install support data
--------------------
You can obtain GMT from http://gmt.soest.hawaii.edu/. 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 ftp.soest.hawaii.edu
Lab for Satellite Altimetry, NOAA ibis.grdl.noaa.gov
IRIS, Washington, US ftp.iris.washington.edu
IAG-USP, U. of Sao Paulo, BRAZIL ftp.iag.usp.br
ISV, Hokkaido U, Sapporo, JAPAN ftp.eos.hokudai.ac.jp
TENET, Tertiary Education & Research Networks, SOUTH AFRICA
gmt.mirror.ac.za
The development sources are available from the subversion repository at
svn://gmtserver.soest.hawaii.edu/gmt5/trunk
Extract the files and put them in a separate directory (need not be
where you eventually want to install GMT).
Configuring
-----------
GMT can be build on any platform supported by CMake. CMake is a
cross-platform, open-source system for managing the build process.
Refer to README.CMake for further details. In the source tree copy
cmake/ConfigUserTemplate.cmake to cmake/ConfigUser.cmake and edit
the file according to your demands.
By default, GMT will use Dave Watson's Delaunay triangulation routine.
However, a much faster alternative is available from Jonathan Shewchuk, but
his routine is not distributed under the GNU Public License. If you work for
a for-profit organization you should read Shewchuk's copyright statement (in
src/triangle.c) first. If you agree with the license terms you can enable
Shewchuk's triangulation routine in cmake/ConfigUser.cmake.
At run-time, GMT will initialize all default variables. You can change
this by adding a gmt.conf file in your current or home directory
and edit those settings since GMT will check for that file before loading
system defaults (actually, it will first look in the current directory, then
the home directory, and then finally in share). See the gmt.conf man page
for a description of all defaults.
To prevent two GMT processes writing to the same gmt.conf file simultaneously
(thereby corrupting it), GMT can implement the POSIX advisory file locking
scheme and sets and releases locks on these files. This might not be reliable
when the files reside in directories on network filesystems, such as NFS.
Whether flock works on network filesystems is implementation dependent. If
you want to activate file locking you may enable it in cmake/ConfigUser.cmake.
By default, both GMT and all its supplements are built. You can turn
off all supplements via the BUILD_SUPPLEMENTS setting in ConfigUsers.cmake
The top-level installation directory is configured with the variable
CMAKE_INSTALL_PREFIX.
Now that you made your configuration choices it is time for invoking CMake.
Create a subdirectory where the build files will be generated, e.g., in the
source tree 'mkdir build'.
In the build subdirectory, type
cmake [options] ..
Append any of the options explained above as you see fit. If CMake cannot
figure out all the dependent libraries or required compiler and linker flags
it will give you a message and you will be asked to edit
cmake/ConfigUser.cmake.
Build GMT
---------
In the build directory, type
make
which will compile all the programs. After a successful compilation you may
install the executables in the designated bin directory with the command
make install
After a successful install you can have the object files and the local
executables removed by saying
make clean
or just remove the entire build directory.
Documentation
_____________
The documentation is available online at http://gmt.soest.hawaii.edu/
or as platform independent package that you can install along with GMT.
The GMT documentation includes HTML files for online browsing, user guide,
cookbook, and manual pages. The Documentation also contains the
GMT_Tutorial.pdf file which is a short course in how to use GMT. It can be
^^^^^^^^^^^^^^^^
still missing!
followed individually or in a lab setting by a group of users.
The development sources from subversion do not contain the precompiled
documentation. The manuals, HTML pages, and PDFs have to be created from
source with Sphinx (see README.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.
Misc
----
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.
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.
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
(http://gmt.soest.hawaii.edu/) 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 http://www.geoware-online.com/.
Good luck!
The GMT Team.
vim: tw=78 et ts=2 sts=2 sw=2 autoindent smartindent
////
$Id$
Copyright (c) 1991-2019 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis
and F. Wobbe. See LICENSE.TXT file for copying and redistribution conditions.
Contact info: http://gmt.soest.hawaii.edu/
////
CMake User Guide
================
Note: This guide is also available at http://gmt.soest.hawaii.edu/
Package maintainers note packaging recommendations at
http://gmt.soest.hawaii.edu/projects/gmt/wiki/PackagingGMT
Build and runtime prerequisites
-------------------------------
1. Software:
You need Ghostscript, CMake (>=2.8.5), netCDF (>=4.0, netCDF-4/HDF5
support mandatory). Optionally install Sphinx, PCRE1 or PCRE2, GDAL, LAPACK
and FFTW (single precision version).
2. Data:
You need gshhg (>=2.2.2); optionally install dcw-gmt (>=1.0.5)
Information for building GMT 5 with CMake
-----------------------------------------
Quick start:
~~~~~~~~~~~~
Checkout GMT5 from its subversion repository:
$ svn co svn://gmtserver.soest.hawaii.edu/gmt5/trunk gmt5-dev
$ cd gmt5-dev
$ 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 -jx
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 ill build out-of-source in the the directory _build_. 'CMAKE_BUILD_TYPE'
can be one of: empty, Debug, Release, RelWithDebInfo or MinSizeRel
$ make -jx install
installs a basic gmt in _build/gmt5_.
NOTE: All cmake command line options such as _-DCMAKE_INSTALL_PREFIX_ can be
configured in *cmake/ConfigUser.cmake*.
In more detail:
~~~~~~~~~~~~~~~
For CMake related questions refer to the CMake manual which is available
online: http://www.cmake.org/cmake/help/documentation.html
To avoid CMake's lengthy command line options you can create your custom
ConfigUser.cmake file in the cmake directory. Simply duplicate the
cmake/ConfigUserTemplate.cmake to cmake/ConfigUser.cmake and then make
changes in cmake/ConfigUser.cmake. See additional comments in that file.
There are two configuration files:
1. "ConfigDefault.cmake" -- is version controlled and used to add new default
variables and set defaults for everyone. You should not edit this file.
2. "ConfigUser.cmake" -- is not version controlled (currently listed in
svn:ignore property) and used to override defaults on a per-user basis.
There is a template file, ConfigUserTemplate.cmake, that you should copy
to ConfigUser.cmake and make your changes therein.
NOTE: If you want to change CMake behaviour for your build then only modify
the "ConfigUser.cmake" file (not "ConfigDefault.cmake").
Invoking CMake:
~~~~~~~~~~~~~~~
CMake supports out-of-source builds and puts generated files in a completely
separate directory, so that the source tree is unchanged. Trying to run CMake
in the source tree will result in an error. CMake will first check for the
minimal required version and then search for required and optional libraries
(netCDF, CURL, PCRE, GDAL, LAPACK) in the default locations. The configuration
step will fail if dependencies are not met. You have to ensure that CMake can
find the required resources by configuring *cmake/ConfigUser.cmake*.
Finding GSHHG:
~~~~~~~~~~~~~~
GSHHG shorelines are searched in FindGSHHG.cmake and a little helper program
tests the version (gshhg_version.c). If CMake cannot find the shorelines you
have to configure _GSHHG_ROOT_ in cmake/ConfigUser.cmake.
Finding DCW:
~~~~~~~~~~~~~~
DCW (Digital Chart of the World) country polygons are searched at compile time.
The DCW data are optional; they are currently used in pscoast -E for painting
individual countries only. If CMake cannot auto-find DCW for you then you can
configure _DCW_ROOT_ in cmake/ConfigUser.cmake.
Documentation:
~~~~~~~~~~~~~~
The GMT manual is available in different formats and can be generated with:
$ make -jx docs_man # UNIX manual pages
$ make -jx docs_html # HTML manual, cookbook, and API reference
$ make -jx docs_pdf # PDF manual, cookbook, and API reference
$ make -jx docs_pdf_shrink # Like docs_pdf but with reduced size
To generate the documentation you need to install the Sphinx documentation
builder, and for PDFs you also need LaTeX. You can choose to install the
documentation files from an external location instead of generating the
Manpages, PDF, and HTML files from the sources. This is convenient if Sphinx
and/or LaTeX are not available. Set GMT_INSTALL_EXTERNAL_DOC in
cmake/ConfigUser.cmake.
Installing:
~~~~~~~~~~~
$ make -jx install
will compile and install libps, libgmt, and the gmt executable. Optionally it
will install the GSHHG shorelines (if found), DCW (if found), UNIX manpages,
and HTML and PDF documentation.
You have to explicitly make the latter two beforehand or they will be omitted
during installation. You have the choice between installing into a
traditional directory structure (_-DGMT_INSTALL_TRADITIONAL_FOLDERNAMES=ON_)
where everything goes into a common subdirectory or a distribution-like
installation (PREFIX/bin/gmtSUFFIX, PREFIX/lib/gmtSUFFIX/,
PREFIX/include/gmtSUFFIX/, PREFIX/share/gmtSUFFIX/,
PREFIX/share/doc/gmtSUFFIX/).
GMT is shipped as a single executable. By default we also set "classic mode"
by installing convenience links for all GMT modules. New GMT users should set
GMT_INSTALL_MODULE_LINKS to FALSE in cmake/ConfigUser.cmake.
Updating:
~~~~~~~~~
Assuming you did not delete the build directory and that your current
working directory is the build directory this is just as simple as
$ cd ..
$ svn up
$ cd -
$ make -jx install
CMake will detect any changes to the source files and will automatically
reconfigure. If you deleted all files inside the build directory you have to
run cmake again manually.
Packaging:
~~~~~~~~~~
Currently, packaging with CPack works on MacOSX (Bundle, TGZ, TBZ2),
Windows (ZIP, NSIS), and UNIX (TGZ, TBZ2). On Windows you need to install NSIS
(http://nsis.sourceforge.net/). After building GMT and the documentation run
either one of these:
$ make package
$ cpack -G <TGZ|TBZ2|Bundle|ZIP|NSIS>
Creating a source package:
~~~~~~~~~~~~~~~~~~~~~~~~~~
Set GMT_RELEASE_PREFIX in cmake/ConfigUser.cmake and run cmake. Then do
$ make -jx docs_depends # optional but increases speed (parallel build)
$ make gmt_release # export the source tree and install doc
You should then edit ${GMT_RELEASE_PREFIX}/cmake/ConfigDefault.cmake and
set GMT_PACKAGE_VERSION_MAJOR, GMT_PACKAGE_VERSION_MINOR, and
GMT_PACKAGE_VERSION_PATCH. Also uncomment and set
GMT_SOURCE_CODE_CONTROL_VERSION_STRING to the current svn version. Then
create tarballs with:
$ make -jx gmt_release_tar
In-build-dir tests:
~~~~~~~~~~~~~~~~~~~
A complete set of the example scripts used to create all the example plots,
including all necessary data files, are provided by the installation.
Examples and tests can be build inside GMT_BINARY_DIR *without* installing.
This is very convenient for testing. Just _enable_testing()_, set
_DO_EXAMPLES_ and/or _DO_TESTS_ in ConfigUser.cmake and do:
$ make -jx
$ make check
Optionally set _N_TEST_JOBS_ to the number of ctest jobs to run
simultaneously. You can also select individual tests using regexp with ctest,
e.g.:
$ ctest -R ex2[3-6]
Tests are preferably run through valgrind and GMT's internal memory tracker.
Configure cmake with _add_definitions(-DMEMDEBUG)_ and prior to invoking the
test, export the following variables:
$ export GMT_TRACK_MEMORY=2
$ export VALGRIND_ARGS="--track-origins=yes --leak-check=full"
The test script will keep gmt_memtrack_<pid>.log and valgrind_<pid>.log files
in the test directories for later inspection, when memory related errors were
identified.
////
vim: ft=asciidoc tw=78 et ts=2 sts=2 sw=2 autoindent smartindent
////
# Generic Mapping Tools
[![Azure](https://dev.azure.com/GenericMappingTools/GMT/_apis/build/status/GenericMappingTools.gmt?branchName=master)](https://dev.azure.com/GenericMappingTools/GMT/_build/latest?definitionId=2&branchName=master)
[![CodeCov](https://img.shields.io/codecov/c/github/GenericMappingTools/gmt.svg)](https://codecov.io/gh/GenericMappingTools/gmt/)
[![Coverity](https://scan.coverity.com/projects/7153/badge.svg)](https://scan.coverity.com/projects/gmt)
[![Documentation (development version)](https://img.shields.io/badge/docs-development-green.svg)](http://docs.generic-mapping-tools.org/dev/)
[![GitHub release](https://img.shields.io/github/release/GenericMappingTools/gmt)](https://github.com/GenericMappingTools/gmt/releases)
## What is GMT?
GMT is an open source collection of about 90 command-line tools for manipulating
geographic and Cartesian data sets (including filtering, trend fitting, gridding,
projecting, etc.) and producing PostScript illustrations ranging from simple x–y
plots via contour maps to artificially illuminated surfaces and 3D perspective
views. The GMT supplements add another 50 more specialized and discipline-specific
tools. GMT supports over 30 map projections and transformations and requires
support data such as [GSHHG](http://www.soest.hawaii.edu/pwessel/gshhg/)
coastlines, rivers, and political boundaries and optionally
[DCW](http://www.soest.hawaii.edu/pwessel/dcw) country polygons.
GMT is developed and maintained by [the GMT Team](AUTHORS.md),
with help from a global set of [contributors](AUTHORS.md)
and support by the [National Science Foundation](http://www.nsf.gov/).
It is released under the
[GNU Lesser General Public License](http://www.gnu.org/licenses/lgpl.html)
version 3 or any later version.
## The GMT World Domination
Considering its flexibility at no charge, people worldwide are using GMT in their
work and at home. Most users of GMT are Earth, ocean or planetary scientists, but
there are apparently no limits to the kind of applications that may benefit from
GMT. We know GMT is used in medical research, engineering, physics, mathematics,
social and biological sciences, and by geographers, fisheries institutes, oil
companies, a wide range of government agencies, and last but not least innumerable
hobbyists.
## A reminder
If you think it is appropriate, you may consider paying us back by including
our latest article in the reference list of your future publications that
will benefit from the availability of GMT:
> Wessel, P., Luis, J., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F., & Tian, D. (2019).
> The Generic Mapping Tools Version 6. Geochemistry, Geophysics, Geosystems, 20.
> https://doi.org/10.1029/2019GC008515
## Install GMT
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
For macOS and Windows users there are separate installers available.
You can obtain GMT and support data from the [GMT main site](https://www.generic-mapping-tools.org).
Refer to the [install instructions](INSTALL.md) to install GMT,
and [build instructions](BUILDING.md) to build GMT from the sources.
## 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. Currently, the supplemental archive include these directories:
- geodesy: Velocity arrows and error ellipses, solid Earth tides, GPS gridding.
- gshhg: Data extractor for GSHHG shoreline polygons and rivers, borders.
- img: Data extractor for Smith/Sandwell altimetry grids.
- mgd77: Programs for handling of native MGD77 files.
- potential: Geopotential manipulations.
- segy: Plotting SEGY seismic data sets.
- seis: Plotting of focal mechanisms and SAC (seismic Analysis Code) data.
- spotter: Plate tectonic & kinematics applications.
- x2sys: Track intersection (crossover) tools.
## Misc
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 HTML files in the doc/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
(https://github.com/GenericMappingTools/gmt) 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. Note that GitHub 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 http://www.geoware-online.com/.
#
# $Id$
#
# Copyright (c) 1991-2019 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
# See LICENSE.TXT file for copying and redistribution conditions.
#
# This program is free software; you can redistribute it and/or modify
......@@ -13,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# Contact info: gmt.soest.hawaii.edu
# Contact info: www.generic-mapping-tools.org
#-------------------------------------------------------------------------------
#
# Default GMT settings. DO NOT EDIT THIS FILE!
......@@ -22,7 +21,7 @@
# 1) "ConfigDefault.cmake" - is version controlled and used to add new default
# variables and set defaults for everyone.
# 2) "ConfigUser.cmake" - is not version controlled (currently listed in
# svn:ignore property) and used to override defaults on a per-user basis.
# .gitignore) and used to override defaults on a per-user basis.
#
# NOTE: If you want to change CMake behaviour just for yourself then copy
# "ConfigUserTemplate.cmake" to "ConfigUser.cmake" and then edit
......@@ -35,41 +34,51 @@ set (GMT_PACKAGE_NAME "GMT")
# a short description of the gmt project (only a few words).
set (GMT_PACKAGE_DESCRIPTION_SUMMARY "The Generic Mapping Tools")
# GMT_VERSION_YEAR is set to current date in
# cmake/modules/ConfigCMake.cmake if not specified here:
# Year of the current GMT release.
set (GMT_VERSION_YEAR "2019")
# The GMT release DOI
set (GMT_VERSION_DOI "https://doi.org/10.5281/zenodo.3407866")
# The GMT release citation
set (GMT_VERSION_CITATION "Wessel, P., Luis, J., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F., & Tian, D. (2019). The Generic Mapping Tools Version 6. Geochemistry, Geophysics, Geosystems, 20. https://doi.org/10.1029/2019GC008515")
# The GMT package version.
set (GMT_PACKAGE_VERSION_MAJOR 5)
set (GMT_PACKAGE_VERSION_MINOR 4)
set (GMT_PACKAGE_VERSION_PATCH 5)
set (GMT_PACKAGE_VERSION_MAJOR 6)
set (GMT_PACKAGE_VERSION_MINOR 0)
set (GMT_PACKAGE_VERSION_PATCH 0)
# If this is a beta version or similar, add a string suffix
# set (GMT_PACKAGE_VERSION_SUFFIX "")
# The subversion revision of the GMT source code.
# This is manually set when making GMT *public* releases.
# However, when making internal releases or just an ordinary developer build, leave it
# empty; if it is empty, the revision number is automatically populated for you on build.
#set (GMT_SOURCE_CODE_CONTROL_VERSION_STRING "20314")
set (GMT_SOURCE_CODE_CONTROL_VERSION_STRING "")
# Whether to make a public release.
# When making internal releases or just an ordinary developer build, it is set to FALSE.
# When making *public* release, uncomment to set it to TRUE.
set (GMT_PUBLIC_RELEASE TRUE)
# The GMT package version.
set (GMT_PACKAGE_VERSION "${GMT_PACKAGE_VERSION_MAJOR}.${GMT_PACKAGE_VERSION_MINOR}.${GMT_PACKAGE_VERSION_PATCH}")
set (GMT_PACKAGE_VERSION "${GMT_PACKAGE_VERSION_MAJOR}.${GMT_PACKAGE_VERSION_MINOR}.${GMT_PACKAGE_VERSION_PATCH}${GMT_PACKAGE_VERSION_SUFFIX}")
# The API version (SOVERSION) of the GMT libraries.
# Increment this when more or fewer functions are included in the
# library, the function prototype changes, or data type changes.
set (GMT_LIB_SOVERSION 5)
set (GMT_LIB_SOVERSION 6)
# The build version (VERSION) of the GMT libraries.
set (GMT_LIB_VERSION "${GMT_LIB_SOVERSION}.${GMT_PACKAGE_VERSION_MINOR}.${GMT_PACKAGE_VERSION_PATCH}")
# The GMT wiki location
set (GMT_TRAC_WIKI "http://gmt.soest.hawaii.edu/")
# The GMT documentation URL
set (GMT_DOC_URL "https://docs.generic-mapping-tools.org/${GMT_PACKAGE_VERSION_MAJOR}.${GMT_PACKAGE_VERSION_MINOR}")
# Use SI units per default
if (NOT UNITS)
set (UNITS "SI")
endif (NOT UNITS)
# The max RMS error in graphicmagick comparisons of PS files
if (NOT DEFINED GRAPHICSMAGICK_RMS)
set (GRAPHICSMAGICK_RMS "0.003")
endif (NOT DEFINED GRAPHICSMAGICK_RMS)
# File locking off
if (NOT DEFINED FLOCK)
set (FLOCK off)
......@@ -93,7 +102,7 @@ endif (NOT DEFINED LICENSE_RESTRICTED)
# Default location of release documentation. If the directory exists in the
# source tree, the files will be copied to GMT_DOCDIR instead of creating
# PDFs from source:
# documentation from source:
if (NOT DEFINED GMT_INSTALL_EXTERNAL_DOC)
set (GMT_INSTALL_EXTERNAL_DOC ${GMT_SOURCE_DIR}/doc_release)
endif (NOT DEFINED GMT_INSTALL_EXTERNAL_DOC)
......@@ -110,21 +119,10 @@ if (NOT DEFINED GMT_RELEASE_PREFIX)
set (GMT_RELEASE_PREFIX ${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION})
endif (NOT DEFINED GMT_RELEASE_PREFIX)
# Default location of optional third-party files used by test suite
# available from svn://gmtserver.soest.hawaii.edu/gmt-data
if (NOT DEFINED GMT_TEST_DATA)
set (GMT_TEST_DATA ${GMT_SOURCE_DIR}/test/data)
endif (NOT DEFINED GMT_TEST_DATA)
# The GMT copyright - string version to be used in a source file.
set (GMT_COPYRIGHT_STRING)
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}Copyright 1991-${GMT_VERSION_YEAR} Paul Wessel, Walter H. F. Smith, R. Scharroo, J. Luis and F. Wobbe\\n")
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}This program comes with NO WARRANTY, to the extent permitted by law.\\n")
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}You may redistribute copies of this program under the terms of the\\n")
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}GNU Lesser General Public License.\\n")
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}For more information about these matters, see the file named LICENSE.TXT.\\n")
set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}\\n")
# Default location of remote data server
if (NOT DEFINED GMT_DATA_SERVER)
set (GMT_DATA_SERVER "https://oceania.generic-mapping-tools.org")
endif (NOT DEFINED GMT_DATA_SERVER)
# You can set the build configuration type as a command-line argument to 'cmake' using -DCMAKE_BUILD_TYPE:STRING=Debug for example.
# If no build configuration type was given as a command-line option to 'cmake' then a default cache entry is set here.
......@@ -149,11 +147,8 @@ set (GMT_COPYRIGHT_STRING "${GMT_COPYRIGHT_STRING}\\n")
#
if (NOT DEFINED CMAKE_CONFIGURATION_TYPES)
if (NOT DEFINED CMAKE_BUILD_TYPE)
# Should we set build type to RelWithDebInfo for developers and
# to release for general public (ie when GPLATES_SOURCE_RELEASE is true) ?
# Currently it's Release for both.
set (CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ${extra_build_configurations}."
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif (NOT DEFINED CMAKE_BUILD_TYPE)
endif (NOT DEFINED CMAKE_CONFIGURATION_TYPES)
......@@ -193,5 +188,3 @@ set (CMAKE_FIND_FRAMEWORK LAST)
if (NOT DEFINED BUILD_DEVELOPER)
set (BUILD_DEVELOPER true)
endif (NOT DEFINED BUILD_DEVELOPER)
# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2
#
# $Id$
#
# Copyright (c) 1991-2019 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
# See LICENSE.TXT file for copying and redistribution conditions.
#
# This program is free software; you can redistribute it and/or modify it
......@@ -13,13 +12,13 @@
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
# for more details.
#
# Contact info: gmt.soest.hawaii.edu
# Contact info: www.generic-mapping-tools.org
# ----------------------------------------------------------------------------
# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
# basis. First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
# edit 'ConfigUser.cmake'. 'ConfigUser.cmake' is not version controlled
# (currently listed in svn:ignore property)
# (currently listed in .gitignore).
#
# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
......@@ -56,12 +55,13 @@
# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
#set (GMT_INSTALL_RELOCATABLE TRUE)
# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, ZLIB dependencies even if you have them installed [FALSE]
# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
#set (GMT_EXCLUDE_GDAL TRUE)
#set (GMT_EXCLUDE_PCRE TRUE)
#set (GMT_EXCLUDE_PCRE2 TRUE)
#set (GMT_EXCLUDE_FFTW3 TRUE)
#set (GMT_EXCLUDE_LAPACK TRUE)
#set (GMT_EXCLUDE_BLAS TRUE)
#set (GMT_EXCLUDE_ZLIB TRUE)
# ============================================================================
......@@ -92,7 +92,7 @@
#set (GMT_MANDIR "share/doc/gmt/man")
# Install documentation files from this external location instead of creating
# new PDF and HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
#set (GMT_INSTALL_EXTERNAL_DOC OFF)
# Install manual pages from this external location instead of creating the
......@@ -104,18 +104,35 @@
## automatically detect the rights version or path.)
##
# Set URL to GMT Data server [auto]:
#set (GMT_DATA_SERVER "data_server_url")
# Set path to GSHHG Shoreline Database [auto]:
#set (GSHHG_ROOT "gshhg_path")
# Copy GSHHG files to $/coast [FALSE]:
# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
#set (COPY_GSHHG TRUE)
# Set path to DCW Digital Chart of the World for GMT [auto]:
#set (DCW_ROOT "dcw-gmt_path")
# Copy DCW files to $/dcw [FALSE]:
# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
#set (COPY_DCW TRUE)
# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
# FOR WINDOWS ONLY
# Set path to location of Ghostscript binaries (optional install)
#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
# FOR WINDOWS ONLY
# Set path to location where the gmtmex is located.
#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
# Set location of NetCDF (can be root directory, path to header file or path
# to nc-config) [auto]:
#set (NETCDF_ROOT "netcdf_install_prefix")
......@@ -148,12 +165,9 @@
#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
# Set location of pthreads-win32 (only Windows); needs GMT_USE_THREADS:
#set (PTHREADS_WIN32_ROOT c:/prefix/of/pthreads-win32)
#set (GMT_USE_THREADS TRUE)
# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
#set (LAPACK_LIBRARY "V:/lapack-3.5.0/build/lib/liblapack.lib")
#set (BLAS_LIBRARY "V:/lapack-3.5.0/build/lib/libblas.lib")
##
## Section 3: GMT features
......@@ -164,6 +178,9 @@
# triangulation (valid values are GPL, LGPL and off) [off]:
#set (LICENSE_RESTRICTED GPL)
# Allow building of OpenMP if compiler supports it
# set (GMT_ENABLE_OPENMP TRUE)
# Configure default units (possible values are SI and US) [SI]:
#set (UNITS "US")
......@@ -172,7 +189,7 @@
#set (BUILD_SHARED_LIBS FALSE)
# Create position independent code on all targets [auto] (needed for static
# build on non-x86:
# build on non-x86):
#set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
# Build GMT shared lib with supplemental modules [TRUE]:
......@@ -198,13 +215,10 @@
#enable_testing()
#set (DO_EXAMPLES TRUE)
#set (DO_TESTS TRUE)
#set (DO_ANIMATIONS TRUE)
# Number of parallel test jobs with "make check":
#set (N_TEST_JOBS 4)
# Location of optional third-party files used by test suite available from
# svn://gmtserver.soest.hawaii.edu/gmt-data [${GMT_SOURCE_DIR}/test/data]
#set (GMT_TEST_DATA "test_data_path")
# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
# for testing [OFF]:
......@@ -214,6 +228,7 @@
# that link against the full gmt libs (not just the API; for building codes
# that only need the GMT API, see the gmt-custom project).
#set (EXTRA_BUILD_DIRS apidemo)
# Uncomment the following line to enable running low-level C tests of the API
#set (DO_API_TESTS ON)
# Directory in which to install the release sources per default
......@@ -237,6 +252,7 @@
#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
## So Xcode can find the supplemental plug-ins during debug sessions
# add_definitions(-DXCODER)
# add_definitions(-DDEBUG_MODERN) # To set PPID == 0 during Xcode test
# message("Add Xcode definition for GMT")
#endif()
#add_definitions(-DDEBUG)
......@@ -244,8 +260,12 @@
#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}") # extra warnings
#set (CMAKE_C_FLAGS_DEBUG -ggdb3) # gdb debugging symbols
#set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized") # check uninitialized variables
#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE) # debug link dependencies
if (HAVE_OPENMP)
set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions") # check uninitialized variables
else (HAVE_OPENMP)
set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized") # check uninitialized variables
endif (HAVE_OPENMP)
#
# System specific tweaks
......@@ -286,5 +306,3 @@
#if(MSVC11)
# add_definitions(/D_ALLOW_KEYWORD_MACROS)
#endif(MSVC11)
# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2
#
# $Id$
#
# Copyright (c) 1991-2019 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
# See LICENSE.TXT file for copying and redistribution conditions.
#
# This program is free software; you can redistribute it and/or modify
......@@ -13,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# Contact info: gmt.soest.hawaii.edu
# Contact info: www.generic-mapping-tools.org
#-------------------------------------------------------------------------------
#
......@@ -24,59 +23,30 @@ set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Generic Mapping Tools data processin
set (CPACK_PACKAGE_VERSION_MAJOR ${GMT_PACKAGE_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${GMT_PACKAGE_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${GMT_PACKAGE_VERSION_PATCH})
set (CPACK_PACKAGE_VERSION ${GMT_PACKAGE_VERSION_WITH_SVN_REVISION})
set (CPACK_PACKAGE_VERSION ${GMT_PACKAGE_VERSION_WITH_GIT_REVISION})
if (NOT DEFINED CPACK_PACKAGE_INSTALL_DIRECTORY)
if (WIN32)
set (CPACK_PACKAGE_INSTALL_DIRECTORY gmt${GMT_PACKAGE_VERSION_MAJOR})
else (WIN32)
set (CPACK_PACKAGE_INSTALL_DIRECTORY GMT-${GMT_PACKAGE_VERSION_WITH_SVN_REVISION})
set (CPACK_PACKAGE_INSTALL_DIRECTORY GMT-${GMT_PACKAGE_VERSION_WITH_GIT_REVISION})
endif (WIN32)
endif (NOT DEFINED CPACK_PACKAGE_INSTALL_DIRECTORY)
set (CPACK_PACKAGE_DESCRIPTION_FILE
"${CMAKE_CURRENT_SOURCE_DIR}/cpack_package_description.txt")
if (GMT_BUNDLE_ACCEPT_BUTTON AND FALSE)
# A license with an accept button will only be displayed if
# GMT_BUNDLE_ACCEPT_BUTTON is set.
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/COPYING.COMBINED")
# Read GPL and LGPL license files
file(READ ${COPYING_GPL} _license_gpl)
file(READ ${COPYING_LGPL} _license_lgpl)
set (_license_extra)
if (NOT LICENSE_RESTRICTED)
# Read extra license files
foreach (_license_file ${GMT_EXTRA_LICENSE_FILES})
file(READ ${_license_file} _license_string)
set (_license_extra
"${_license_extra}\n---------------------------------------------------------------------------\n\n${_license_string}")
endforeach (_license_file ${GMT_EXTRA_LICENSE_FILES})
# Copy combined license template
execute_process(COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/COPYING.RESTRICTED.template
${CMAKE_CURRENT_BINARY_DIR}/COPYING.COMBINED)
else (NOT LICENSE_RESTRICTED)
# Clear contents of license file if it exists
execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f
${CMAKE_CURRENT_BINARY_DIR}/COPYING.COMBINED)
endif (NOT LICENSE_RESTRICTED)
# Append GPL, LGPL, and licenses from GMT_EXTRA_LICENSE_FILES
set (_license_combined "${_license_gpl}")
if (NOT LICENSE_RESTRICTED STREQUAL GPL)
set (_license_combined
"${_license_combined}\n---------------------------------------------------------------------------\n\n${_license_lgpl}")
endif (NOT LICENSE_RESTRICTED STREQUAL GPL)
set (_license_combined "${_license_combined}\n${_license_extra}")
# Append to COPYING.COMBINED or create new combined license file
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/COPYING.COMBINED "${_license_combined}")
endif (GMT_BUNDLE_ACCEPT_BUTTON AND FALSE)
if (WIN32)
if (CMAKE_SIZEOF_VOID_P EQUAL 8) # 64 bits
set (CPACK_PACKAGE_FILE_NAME "gmt-${CPACK_PACKAGE_VERSION}-win64")
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits
set (CPACK_PACKAGE_FILE_NAME "gmt-${CPACK_PACKAGE_VERSION}-win32")
endif()
endif (WIN32)
if (APPLE)
set (CPACK_PACKAGE_FILE_NAME "gmt-${CPACK_PACKAGE_VERSION}-darwin-x86_64")
endif (APPLE)
# Install components:
set (CPACK_COMPONENTS_ALL Runtime Documentation DCW GSHHG)
set (CPACK_COMPONENTS_ALL Runtime Documentation DCW GSHHG GDALDATA GHOSTSCRIPT)
# set (CPACK_COMPONENT_DOCUMENTATION_DISABLED ON)
set (CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "Runtime files")
set (CPACK_COMPONENT_RUNTIME_DESCRIPTION
......@@ -87,6 +57,10 @@ set (CPACK_COMPONENT_DCW_DESCRIPTION
"Digital Chart of the World files.")
set (CPACK_COMPONENT_GSHHG_DESCRIPTION
"Shoreline database files.")
set (CPACK_COMPONENT_GDALDATA_DESCRIPTION
"GDAL & PROJ4 auxiliary files.")
set (CPACK_COMPONENT_GHOSTSCRIPT_DESCRIPTION
"Ghostscript program.")
# Create two installation types with pre-selected components:
set (CPACK_ALL_INSTALL_TYPES Full Minimal)
......@@ -95,9 +69,11 @@ set (CPACK_COMPONENT_RUNTIME_INSTALL_TYPES Minimal Full)
set (CPACK_COMPONENT_DOCUMENTATION_INSTALL_TYPES Full)
set (CPACK_COMPONENT_GSHHG_INSTALL_TYPES Full)
set (CPACK_COMPONENT_DCW_INSTALL_TYPES Full)
set (CPACK_COMPONENT_GDALDATA_INSTALL_TYPES Full)
set (CPACK_COMPONENT_GHOSTSCRIPT_INSTALL_TYPES Full)
# One package per COMPONENT:
set(CPACK_COMPONENTS_GROUPING "IGNORE")
# Creates a single package with all (requested) components
set (CPACK_COMPONENTS_GROUPING "ALL_COMPONENTS_IN_ONE")
# Enable component install for archive generators:
set (CPACK_ARCHIVE_COMPONENT_INSTALL ON)
......@@ -150,7 +126,7 @@ if (WIN32 AND NOT CYGWIN)
endif (NOT DEFINED CPACK_NSIS_INSTALL_ROOT)
set (CPACK_NSIS_MODIFY_PATH ON)
string(REPLACE "/" "\\\\" _native_share_path "${GMT_DATADIR}")
set (CPACK_NSIS_ADD_ENVVAR1 "GMT5_SHAREDIR")
set (CPACK_NSIS_ADD_ENVVAR1 "GMT6_SHAREDIR")
set (CPACK_NSIS_ADD_ENVVAL1 "\\\$INSTDIR\\\\${_native_share_path}")
# StartMenu items:
......@@ -168,15 +144,15 @@ if (WIN32 AND NOT CYGWIN)
install (PROGRAMS ${OMP_DLL_LOC} DESTINATION ${GMT_BINDIR} COMPONENT Runtime)
endif (OMP_DLL_LOC)
if (WIN32 AND TRUE)
# Install the gmtmex on Windows. Need to make this work via variables in ConfigUser.cmake
if (WIN32 AND GMTMEX_PATH)
# Install the gmtmex on Windows. Its location is controlled by GMTMEX_PATH set in ConfigUser.cmake
if (BITAGE EQUAL 64)
install (PROGRAMS ${GMTMEX_PATH}/gmtmex.mexw64 DESTINATION ${GMT_BINDIR} COMPONENT Runtime)
install (PROGRAMS "${GMTMEX_PATH}/gmtmex.mexw64" DESTINATION ${GMT_BINDIR} COMPONENT Runtime)
else ()
install (PROGRAMS ${GMTMEX_PATH}/gmtmex.mexw32 DESTINATION ${GMT_BINDIR} COMPONENT Runtime)
install (PROGRAMS "${GMTMEX_PATH}/gmtmex.mexw32" DESTINATION ${GMT_BINDIR} COMPONENT Runtime)
endif ()
install (PROGRAMS "${GMTMEX_PATH}/gmt.m" DESTINATION ${GMT_BINDIR} COMPONENT Runtime)
endif ()
install (PROGRAMS ${GMTMEX_PATH}/../../src/gmt.m DESTINATION ${GMT_BINDIR} COMPONENT Runtime)
endif (WIN32 AND TRUE)
# Fix bundle:
install (CODE "
......@@ -201,7 +177,7 @@ if (APPLE)
# Configure CPack:
set (CPACK_GENERATOR Bundle TGZ TBZ2)
set (CPACK_BUNDLE_NAME
"${CPACK_PACKAGE_NAME}-${GMT_PACKAGE_VERSION_WITH_SVN_REVISION}")
"${CPACK_PACKAGE_NAME}-${GMT_PACKAGE_VERSION_WITH_GIT_REVISION}")
set (CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/GMT.icns")
set (CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
set (CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_BINARY_DIR}/startup_macosx.sh")
......@@ -240,15 +216,6 @@ if (APPLE)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${GMT_BINDIR}/gmt${CMAKE_EXECUTABLE_SUFFIX}\" \"\${CMAKE_INSTALL_PREFIX}/${GMT_LIBDIR}/gmt${CMAKE_EXECUTABLE_SUFFIX}/plugins/supplements.so\" \"\")
endif ()
" COMPONENT Runtime)
# Workaround: move documentation:
install (CODE "
if (CMAKE_INSTALL_PREFIX MATCHES \"_CPack_Packages.+[.]app/Contents/Resources\")
execute_process (COMMAND ${CMAKE_COMMAND} -E rename
\${CMAKE_INSTALL_PREFIX}/${GMT_DOCDIR}
\${CMAKE_INSTALL_PREFIX}/../../../Documentation)
endif ()
" COMPONENT Documentation)
endif (APPLE)
# Linux, Cygwin & Co:
......@@ -261,5 +228,3 @@ set (CPACK_SOURCE_GENERATOR TGZ TBZ2 ZIP)
# This must always be last:
include (CPack)
# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2
GMT is distributed under the GNU Lesser General Public License
(LGPL) version 3 or later. Copies of the The GNU General Public
License (GPL) and the GNU Lesser General Public License (LGPL) are
distributed along with this package and are printed below.
NOTE: This package uses code that is distributed under a
proprietary non-permissive license. Refer to the additional
license terms below.
------------------------------------------------------------------
......@@ -5,31 +5,31 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>GMT-@GMT_PACKAGE_VERSION_WITH_SVN_REVISION@</string>
<string>GMT-@GMT_PACKAGE_VERSION_WITH_GIT_REVISION@</string>
<key>CFBundleGetInfoString</key>
<string>GMT is an open source collection of ~80 command-line tools for manipulating geographic and Cartesian data sets.</string>
<key>CFBundleIconFile</key>
<string>GMT-@GMT_PACKAGE_VERSION_WITH_SVN_REVISION@.icns</string>
<string>GMT-@GMT_PACKAGE_VERSION_WITH_GIT_REVISION@.icns</string>
<key>CFBundleIdentifier</key>
<string>edu.hawaii.soest.gmt5</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>GMT-@GMT_PACKAGE_VERSION_WITH_SVN_REVISION@</string>
<string>GMT-@GMT_PACKAGE_VERSION_WITH_GIT_REVISION@</string>
<key>CFBundleName</key>
<string>GMT</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@GMT_PACKAGE_VERSION_WITH_SVN_REVISION@</string>
<string>@GMT_PACKAGE_VERSION_WITH_GIT_REVISION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>@GMT_PACKAGE_VERSION_WITH_SVN_REVISION@</string>
<string>@GMT_PACKAGE_VERSION_WITH_GIT_REVISION@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 1991-@GMT_VERSION_YEAR@ by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
<string>Copyright © 1991-@GMT_VERSION_YEAR@ by the GMT Team (https://www.generic-mapping-tools.org/team.html)
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 3 or any later version.</string>
</dict>
</plist>
#!/bin/bash
#!/usr/bin/env bash
# Startup script for GMT.app in MacOSX.
# Startup script for GMT.app in macOS.
# Setup environment and start Terminal.
if [ "$1" = "GMT_PROMPT" ]; then
......@@ -9,17 +9,28 @@ if [ "$1" = "GMT_PROMPT" ]; then
export BUNDLE_RESOURCES="${PWD}/Resources"
cd "${OLDPWD}"
dim=(`osascript -e 'tell application "Terminal" to get size of front window' | tr ',' ' '`)
w=`echo "${dim[0]} 1.25" | awk '{print int($1*$2)}'`
osascript << EOF
tell application "Terminal" to set size of front window to {$w, ${dim[1]}}
EOF
export PATH="${BUNDLE_RESOURCES}/@GMT_BINDIR@:${PATH}"
export PROJ_LIB="${BUNDLE_RESOURCES}/share/proj6"
export MAGICK_CONFIGURE_PATH=${BUNDLE_RESOURCES}/lib/GraphicsMagick-1.3.33/config
function gmt () { "${BUNDLE_RESOURCES}/@GMT_BINDIR@/gmt" "$@"; }
export -f gmt
source "${BUNDLE_RESOURCES}/share/tools/gmt_functions.sh"
unset DYLD_LIBRARY_PATH
gmt
echo -e "Note 1: If you want to use GMT outside of this terminal or in scripts, then follow these steps:\n a) export GMTHOME=${BUNDLE_RESOURCES}\n b) add \$GMTHOME/bin to your path\n c) export PROJ_LIB=\$GMTHOME/share/proj6\n d) export MAGICK_CONFIGURE_PATH=\$GMTHOME/lib/GraphicsMagick-1.3.33/config"
echo -e "Note 2: GMT may use Ghostscript, GraphicsMagick, FFmpeg, and GDAL executables; see\n ${BUNDLE_RESOURCES}/share/Licenses for details.\n"
_usershell=$(dscl . -read "/Users/$USER" UserShell)
_usershell=${_usershell##* }
if [ ${_usershell} = ${_usershell%bash} ]; then
# not using bash as default shell
echo -e "Warning: your default shell is ${_usershell}. GMT module commands are only available in BASH. Change your default shell or make sure ${BUNDLE_RESOURCES}/@GMT_BINDIR@ is in your PATH and use ${BUNDLE_RESOURCES}/share/tools/gmt5syntax to convert your old GMT scripts.\n"
echo -e "Warning: your default shell is ${_usershell}. GMT commands completions are only available in BASH.\n"
exec ${_usershell}
fi
# bash: start interactive shell and source gmt completions
......@@ -29,6 +40,8 @@ if [ "$1" = "GMT_PROMPT" ]; then
test -f ~/.bashrc && source ~/.bashrc
source "${BUNDLE_RESOURCES}/share/tools/gmt_completion.bash"
unset DYLD_LIBRARY_PATH
# Assist modern mode scripts by setting a unique session name
export GMT_SESSION_NAME=$$
EOF
exec /bin/bash --rcfile "${_temp_bashrc}" -i
fi
......
#
# $Id$
#
# - Check if the prototype for a function exists.
# CHECK_PROTOTYPE_EXISTS (FUNCTION HEADER VARIABLE)
......
#
# $Id$
#
# - Check if the given struct or class has the specified member variable
# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE)
......@@ -28,4 +27,3 @@ MACRO (CHECK_TYPE_EXISTS _TYPE _HEADER _RESULT)
SET(CMAKE_EXTRA_INCLUDE_FILES ${_HEADER})
CHECK_TYPE_SIZE(${_TYPE} ${_RESULT})
ENDMACRO (CHECK_TYPE_EXISTS)
#
# $Id$
#
# Useful CMake variables.
#
......@@ -7,7 +6,7 @@
# 1) "ConfigDefault.cmake" - is version controlled and used to add new default
# variables and set defaults for everyone.
# 2) "ConfigUser.cmake" in the source tree - is not version controlled
# (currently listed in svn:ignore property) and used to override defaults on
# (currently listed in .gitignore) and used to override defaults on
# a per-user basis.
# 3) "ConfigUser.cmake" in the build tree - is used to override
# "ConfigUser.cmake" in the source tree.
......@@ -18,7 +17,7 @@
#
include ("${CMAKE_SOURCE_DIR}/cmake/ConfigDefault.cmake")
# If "ConfigUser.cmake" doesn't exist then create one for convenience.
# A "ConfigUser.cmake" in the source tree overrides the defaults.
if (EXISTS "${CMAKE_SOURCE_DIR}/cmake/ConfigUser.cmake")
include ("${CMAKE_SOURCE_DIR}/cmake/ConfigUser.cmake")
endif (EXISTS "${CMAKE_SOURCE_DIR}/cmake/ConfigUser.cmake")
......@@ -38,75 +37,46 @@ if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release)
endif (NOT CMAKE_BUILD_TYPE)
# Here we change it to add the SVN revision number for non-public releases - see Package.cmake for
# why this has to be done here.
set (GMT_PACKAGE_VERSION_WITH_SVN_REVISION ${GMT_PACKAGE_VERSION})
# Add the Subversion version number to the package filename if this is a non-public release.
# A non-public release has an empty 'GMT_SOURCE_CODE_CONTROL_VERSION_STRING' variable in 'ConfigDefault.cmake'.
set (HAVE_SVN_VERSION)
if (NOT GMT_SOURCE_CODE_CONTROL_VERSION_STRING)
# Get the location, inside the staging area location, to copy the application bundle to.
# Here we change it to add the git commit hash for non-public releases
set (GMT_PACKAGE_VERSION_WITH_GIT_REVISION ${GMT_PACKAGE_VERSION})
# Check if it's a git repository or not
if (EXISTS ${GMT_SOURCE_DIR}/.git)
set (HAVE_GIT_VERSION TRUE)
endif (EXISTS ${GMT_SOURCE_DIR}/.git)
# Add the last git commit hash and date to the package version if this is a non-public release.
# A non-public release has a FALSE 'GMT_PUBLIC_RELEASE' variable in 'ConfigDefault.cmake'.
if (GIT_FOUND AND NOT GMT_PUBLIC_RELEASE)
# Get the last git commit hash
execute_process (
COMMAND svnversion ${GMT_SOURCE_DIR}
RESULT_VARIABLE SVN_VERSION_RESULT
OUTPUT_VARIABLE SVN_VERSION_OUTPUT
COMMAND ${GIT_EXECUTABLE} describe --abbrev=7 --always --dirty
WORKING_DIRECTORY ${GMT_SOURCE_DIR}
RESULT_VARIABLE GIT_RETURN_CODE
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (SVN_VERSION_RESULT)
message (STATUS "Unable to determine svn version number for non-public release - ignoring.")
else (SVN_VERSION_RESULT)
if (SVN_VERSION_OUTPUT MATCHES "Unversioned")
message (STATUS "Unversioned source tree, non-public release.")
else (SVN_VERSION_OUTPUT MATCHES "Unversioned")
# The 'svnversion' command can output a range of revisions with a colon
# separator - but this causes problems with filenames so we'll remove the
# colon and the end revision after it.
string (REGEX REPLACE ":.*$" "" SVN_VERSION ${SVN_VERSION_OUTPUT})
if (NOT SVN_VERSION STREQUAL exported)
# Set the updated package version.
set (GMT_PACKAGE_VERSION_WITH_SVN_REVISION "${GMT_PACKAGE_VERSION}_r${SVN_VERSION}")
set (HAVE_SVN_VERSION TRUE)
endif (NOT SVN_VERSION STREQUAL exported)
endif (SVN_VERSION_OUTPUT MATCHES "Unversioned")
endif (SVN_VERSION_RESULT)
endif (NOT GMT_SOURCE_CODE_CONTROL_VERSION_STRING)
if (GIT_RETURN_CODE)
message (STATUS "Unable to determine git commit hash for non-public release - ignoring.")
else (GIT_RETURN_CODE)
if (GIT_COMMIT_HASH)
# For non-public release, add the last git commit hash and date
execute_process (
COMMAND ${GIT_EXECUTABLE} log -1 --date=short --pretty=format:%cd
WORKING_DIRECTORY ${GMT_SOURCE_DIR}
RESULT_VARIABLE GIT_DATE_RETURN_CODE
OUTPUT_VARIABLE GIT_COMMIT_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE "-" "." GIT_COMMIT_DATE "${GIT_COMMIT_DATE}")
set (GMT_PACKAGE_VERSION_WITH_GIT_REVISION "${GMT_PACKAGE_VERSION}_${GIT_COMMIT_HASH}_${GIT_COMMIT_DATE}")
endif (GIT_COMMIT_HASH)
endif (GIT_RETURN_CODE)
endif (GIT_FOUND AND NOT GMT_PUBLIC_RELEASE)
# The current GMT version.
set (GMT_VERSION_STRING "${GMT_PACKAGE_NAME} ${GMT_PACKAGE_VERSION_WITH_SVN_REVISION}")
set (GMT_VERSION_STRING "${GMT_PACKAGE_NAME} ${GMT_PACKAGE_VERSION_WITH_GIT_REVISION}")
set (GMT_LONG_VERSION_STRING "${GMT_PACKAGE_NAME} - ${GMT_PACKAGE_DESCRIPTION_SUMMARY}, Version ${GMT_PACKAGE_VERSION_WITH_SVN_REVISION}")
# Get date
if(DEFINED ENV{SOURCE_DATE_EPOCH})
EXECUTE_PROCESS(
COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y;%m;%d;%B"
OUTPUT_VARIABLE _today
OUTPUT_STRIP_TRAILING_WHITESPACE)
else(DEFINED ENV{SOURCE_DATE_EPOCH})
try_run (_exit_today _compiled_today
${CMAKE_BINARY_DIR}/CMakeTmp
${CMAKE_MODULE_PATH}/today.c
CMAKE_FLAGS
RUN_OUTPUT_VARIABLE _today)
if (NOT _compiled_today OR _exit_today EQUAL -1)
message (WARNING "Date not implemented, please file a bug report.")
set(_today "1313;13;13;Undecember")
endif (NOT _compiled_today OR _exit_today EQUAL -1)
endif(DEFINED ENV{SOURCE_DATE_EPOCH})
list(GET _today 0 YEAR)
list(GET _today 1 MONTH)
list(GET _today 2 DAY)
list(GET _today 3 MONTHNAME)
list(GET _today 0 1 2 DATE)
string (REPLACE ";" "-" DATE "${DATE}")
set (_today)
# set package date
if (NOT GMT_VERSION_YEAR)
set (GMT_VERSION_YEAR ${YEAR})
endif (NOT GMT_VERSION_YEAR)
set (GMT_LONG_VERSION_STRING "${GMT_PACKAGE_NAME} - ${GMT_PACKAGE_DESCRIPTION_SUMMARY}, Version ${GMT_PACKAGE_VERSION_WITH_GIT_REVISION}")
# apply license restrictions
if (LICENSE_RESTRICTED) # on
......@@ -158,8 +128,7 @@ if (NOT GMT_MANDIR)
if (GMT_INSTALL_TRADITIONAL_FOLDERNAMES)
set (GMT_MANDIR "${GMT_DATADIR}/man")
else(GMT_INSTALL_TRADITIONAL_FOLDERNAMES)
set (GMT_MANDIR
"${GMT_DOCDIR}/man")
set (GMT_MANDIR "${GMT_DOCDIR}/man")
endif(GMT_INSTALL_TRADITIONAL_FOLDERNAMES)
endif (NOT GMT_MANDIR)
......@@ -250,5 +219,3 @@ if (GMT_DOCS_DEPEND_ON_GMT)
else (GMT_DOCS_DEPEND_ON_GMT)
add_custom_target (gmt_for_img_convert)
endif (GMT_DOCS_DEPEND_ON_GMT)
# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2