Install GMT from source code
Background:
It is recommended to download binary packages of GMT release for Windows and MacOS at http://gmt.soest.hawaii.edu/projects/gmt/wiki/Download. However, for linux distributions, one may need to install GMT from source code.
Steps:
1. Download source code, the latest version, gmt-5.1.2-src.tar.gz.
tar zxf gmt-5.1.2-src.tar.gz
cd gmt-5.1.2
2. From README: required packages: cmake, netCDF, GDAL(optional).
2.a: cmake
Already installed.
2.b: libnetcdf:
Download wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.gz
tar zxf netcdf.tar.gz
cd netcdf
./configure --prefix=$HOME/tools
make -j4
make install
NOTE: It is suggested to install all dependency libraries in the same place, e.g. $HOME/tools here. $HOME/tools is indeed similar as /usr/local, which is the default install location of many softwares.
**** Just add $HOME/tools into PATH.
3. install GMT (refer to README.CMake):
cd gmt-5.1.2
cp cmake/ConfigUserTemplate.cmake cmake/ConfigUser.cmake
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/tools -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -j4
make install
NOTE: There are some options in cmake/ConfigDefault.cmake. Some of them may need to be configured.
4. It's done!
It is recommended to download binary packages of GMT release for Windows and MacOS at http://gmt.soest.hawaii.edu/projects/gmt/wiki/Download. However, for linux distributions, one may need to install GMT from source code.
Steps:
1. Download source code, the latest version, gmt-5.1.2-src.tar.gz.
tar zxf gmt-5.1.2-src.tar.gz
cd gmt-5.1.2
2. From README: required packages: cmake, netCDF, GDAL(optional).
2.a: cmake
Already installed.
2.b: libnetcdf:
Download wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.gz
tar zxf netcdf.tar.gz
cd netcdf
./configure --prefix=$HOME/tools
make -j4
make install
NOTE: It is suggested to install all dependency libraries in the same place, e.g. $HOME/tools here. $HOME/tools is indeed similar as /usr/local, which is the default install location of many softwares.
**** Just add $HOME/tools into PATH.
3. install GMT (refer to README.CMake):
cd gmt-5.1.2
cp cmake/ConfigUserTemplate.cmake cmake/ConfigUser.cmake
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/tools -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -j4
make install
NOTE: There are some options in cmake/ConfigDefault.cmake. Some of them may need to be configured.
4. It's done!