Skip to content

Instantly share code, notes, and snippets.

@holishing
Last active January 7, 2019 16:56
Show Gist options
  • Save holishing/ce774ddbdcd7b30ad46262df6595a5b2 to your computer and use it in GitHub Desktop.
Save holishing/ce774ddbdcd7b30ad46262df6595a5b2 to your computer and use it in GitHub Desktop.
Manually build GMT 5.4.x/Current(6.0.0) on FreeBSD 11.2/12.0

Manually build GMT 5.4.x on FreeBSD 11.2/12.0

  1. get FreeBSD ports collection:
# portsnap fetch
# portsnap extract
  1. enter /usr/ports/graphics/gmt5/
  2. check information in Makeflie(*), and enter make install clean.

check path for DCW_ROOT and GSHHG_ROOT is correct

Manually build GMT Current (git master) Version on FreeBSD 11.2/12.0

1. Get source and extract

  • Install Build Dependencies
# pkg install \
    devel/cmake \
    science/netcdf \
    ftp/curl \
    devel/pcre \
    math/fftw3-float \
    graphics/gdal \
    shells/bash \
    graphics/gmt5-dcw \
    graphics/gmt5-gshhg \
    devel/git
  • Download files
$ git clone https://github.com/GenericMappingTools/gmt.git

2. Configuration and Build

$ cd gmt
$ mkdir build && cd build
$ cmake \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        -DCMAKE_C_FLAGS=-fstrict-aliasing \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DDCW_ROOT=/usr/local/share/dcw-gmt \
        -DGSHHG_ROOT=/usr/local/share/gshhg-gmt \
        -DGMT_INSTALL_MODULE_LINKS=off \
        -DGMT_INSTALL_TRADITIONAL_FOLDERNAMES=off \
        -DGMT_DATADIR=share/gmtx \
        -DGMT_DOCDIR=share/doc/gmtx \
        -DGMT_MANDIR=share/doc/gmtx/man \
        -DGMT_INSTALL_NAME_SUFFIX=-gmtx \
        ..
$ make -j4
# make install

If you want to uninstall

# /usr/local/share/gmtx/tools/gmt_uninstall.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment