Installation of GMT v5.4.4 and GMTSAR v5.6 with Macports

1) (Optional) Download and install orbit files for processing ERS and Envisat data:

mkdir -p gmtsar-data/ORBITS
curl -L ftp://topex.ucsd.edu/pub/gmtsar/ORBITS.tar | tar xv --directory gmtsar-data/ORBITS
sudo mv gmtsar-data ${prefix}/share/

In the above path, ${prefix} is the directory in which Macports is installed, default is /opt/local.

2) Install stable version 5.6 with Macports
(make sure XCODE is installed including the *.h files in /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg)

sudo port install gmtsar  

Installation of GMT and GMTSAR with Homebrew

1) Download and install orbit files in /usr/local/orbits:

http://topex.ucsd.edu/gmtsar/tar/ORBITS.tar
sudo -i
cd /usr/local
mkdir orbits
cd orbits
tar -xvf ~/Downloads/ORBITS.tar # (need full path to ORBITS.tar)

2) Install stable version 5.5 with Homebrew

xcode-select --install
brew tap ecreinisch/homebrew-insar
brew install gmtsar  

Installation of GMT and GMTSAR with package managers and subversion control

1) Install GMT (5.2.1 or later but NOT version 6 yet) first with all optional libraries (GDAL and PCRE, plus FFTW3 and LAPACK for Linux).
  • Linux: Depending on your OS version a GMT package may exist (see below). if not, see Building Instructions
  • OS X (Macports):
  • sudo port install gdal +curl +geos +hdf5 +netcdf +tiff
    sudo port install gmt5
    sudo port install autoconf
    
  • OS X (Fink):
  • sudo fink install libtiff5
    sudo fink install szip
    sudo fink install gmt5
    
2) Install extra libraries. Note that depending on your OS version the actual version numbers in some of the packages below may differ):
  • Ubuntu 14.04 LTS:
  • sudo apt-get install csh subversion autoconf libtiff5-dev libhdf5-dev
    sudo apt-get install liblapack-dev
    sudo apt-get install gfortran
    sudo apt-get install g++
    Install GMT from source since no GMT version >= 5 in 14.04.
    
  • Ubuntu 16.06 LTS:
  • sudo apt-get install csh subversion autoconf libtiff5-dev libhdf5-dev
    sudo apt-get install liblapack-dev
    sudo apt-get install gfortran
    sudo apt-get install g++
    sudo apt-get install libgmt-dev
    sudo apt-get install gmt gmt-dcw gmt-gshhg
    sudo apt-get install gmt
    
  • CentOS 7:
  • sudo yum install svn autoconf gcc-c++ libtiff-devel libhdf5-devel
    sudo yum install gmt
    
  • Fedora 23:
  • sudo yum install csh subversion autoconf  gcc-c++libtiff-devel hdf5-devel
    (need fftw-developer for faster execution.)
    sudo yum install gmt
    

3) Download and install orbit files and place in suitable directory (e.g., /usr/local/orbits):

http://topex.ucsd.edu/gmtsar/tar/ORBITS.tar
sudo -i
cd /usr/local
mkdir orbits
cd orbits
tar -xvf ~/Downloads/ORBITS.tar # (need full path to ORBITS.tar)

4) Download GMTSAR branch 5.6 via subversion in a suitable directory:

sudo -i
cd /usr/local
svn checkout svn://gmtserver.soest.hawaii.edu/GMTSAR/branches/5.6 GMTSAR

checkout the trunk version for more new but not stable features. Or simply run "svn switch ^/trunk" in GMTSAR folder.

5) Make and install GMTSAR (change the orbits directory if different):

cd GMTSAR
autoconf
./configure --with-orbits-dir=/usr/local/orbits
make
make install


6) Add the executables to your path (for csh or tcsh):
cd ~
#
#   edit your .tcshrc file and add the following lines
#
        setenv GMTSAR /usr/local/GMTSAR
        setenv PATH $GMTSAR/bin:"$PATH" 

or
cd ~
#  edit your .bashrc file and add the following lines
        export GMTSAR=/usr/local/GMTSAR
        export PATH=$GMTSAR/bin:"$PATH"