Issues while trying to install GMT4

Added by Matt 7 months ago

I need to install GMT4 and I am having troubles.
I have over 100 scripts that were written with GMT4 commands and don't have the time to modify all the scripts to work with GMT5 or GMT6.

Ok so the steps I have taken:
1. Downloaded Ubuntu 18.04 LTS and enabled WSL on my windows machine.

2. Install package before GMT4 install:

sudo apt-get update -y
sudo apt-get install ghostscript build-essential cmake libnetcdf-dev libgdal-dev libfftw3-dev libpcre3-dev subversion

3. Went to http://gmt.soest.hawaii.edu/gmt4/ and then attempted to follow option number 1 of Linux/Unix installation (Automated install [Recommended]. Obtain and install GMT by interacting with the INSTALL FORM. Follow instructions there to obtain the Bourne shell install-script and a customized install parameter file. Note: The automated install will no longer install netCDF so you should make sure this is installed first.)
I filled in the INSTALL FORM at http://gmt.soest.hawaii.edu/gmt4/gmt/gmt_install_form.html to get:

# This file contains parameters needed by the install script
# install_gmt for GMT Version 4.5.18.  Give this file
# as the argument to the install_gmt script and the whole
# installation process can be placed in the background.
# Default answers will be selected where none is given.
# You can edit the values, but do not remove definitions!
#
# Assembled by gmt_install_form.html, $Revision: 10410 $
# Processed by install_gmt_form.pl : 10410  on
#
#       Wed Nov 20 15:19:38 HST 2019
#
# Do NOT add any spaces around the = signs.  The
# file MUST conform to Bourne shell syntax
#---------------------------------------------
#       GMT VERSION
#---------------------------------------------
GMT_version=4.5.18
#---------------------------------------------
#       SYSTEM UTILITIES AND FTP SETTING
#---------------------------------------------
GMT_make=make
passive_ftp=y
#---------------------------------------------
#       NETCDF SECTION
#---------------------------------------------
netcdf_path=/usr/bin/nc-config
#---------------------------------------------
#       GSHHG SECTION
#---------------------------------------------
GSHHG_install=y
GSHHG_ftp=y
GSHHG_path=
#---------------------------------------------
#       GDAL SECTION
#---------------------------------------------
use_gdal=n
gdal_path=
#---------------------------------------------
#       GMT FTP SECTION
#---------------------------------------------
GMT_ftp=y
GMT_ftpsite=1
GMT_inst_gmt=y
#---------------------------------------------
#       GMT SUPPLEMENTS SELECT SECTION
#---------------------------------------------
GMT_suppl_mex=n
GMT_mex_type=octave
GMT_suppl_xgrid=n
#---------------------------------------------
#       GMT ENVIRONMENT SECTION
#---------------------------------------------
GMT_si=y
GMT_ps=y
GMT_prefix=
GMT_bin=
GMT_lib=
GMT_share=
GMT_include=
GMT_man=
GMT_doc=
GMT_sharedir=
#---------------------------------------------
#       COMPILING & LINKING SECTION
#---------------------------------------------
GMT_sharedlib=y
GMT_cc=cc
GMT_64=
GMT_flock=y
GMT_triangle=n
#---------------------------------------------
#       TEST & print FILE SECTION
#---------------------------------------------
GMT_run_examples=y
GMT_delete=n
#---------------------------------------------
#       MEX SECTION
#---------------------------------------------

Copied these parameters to a new file named: GMT4param.txt

Downloaded: install_gmt4.sh (from GMT 4 Installation Helper webpage)

Ran:

sh install_gmt4.sh GMT4param.txt

Output:
+++ Will expand *.bz2 files made with bzip2 +++
install_gmt.sh: Use /usr/bin/nc-config for netcdf support
Getting GMT4 by anonymous ftp from ftp.soest.hawaii.edu (be patient)...
ftp: setsockopt: Bad file descriptor
---> USER anonymous
---> PASS XXXX
---> SYST
---> CWD gmt
---> TYPE I
ftp: setsockopt (ignored): Permission denied
---> PORT 132,156,214,62,251,182
---> RETR gmt-4.5.18-src.tar.bz2
Cannot connect to 132.156.214.62:64438 - Connection timed out.
ftp: setsockopt (ignored): Permission denied
---> PORT 132,156,214,62,251,208
---> RETR gshhg-gmt-2.3.7.tar.gz
Cannot connect to 132.156.214.62:64464 - Connection timed out.
---> QUIT
Got 0 kb ... done

Set write privileges on all files in gmt-4.5.18 ...
Done

---> Begin GMT 4.5.18 installation <---

---> Run configure to create config.mk and gmt_notposix.h

./configure --prefix=/home/matt/GMT4/gmt-4.5.18 --bindir=/home/matt/GMT4/gmt-4.5.18/bin --libdir=/home/matt/GMT4/gmt-4.5.18/lib --includedir=/home/matt/GMT4/gmt-4.5.18/include    --enable-netcdf=/usr/bin/nc-config    --enable-shared     --mandir=/home/matt/GMT4/gmt-4.5.18/man --docdir=/home/matt/GMT4/gmt-4.5.18/share/doc/gmt --datadir=/home/matt/GMT4/gmt-4.5.18/share --enable-update=ftp.soest.hawaii.edu   --disable-mex --disable-xgrid    --with-gshhg-dir=/home/matt/GMT4
install_gmt4.sh: 1023: install_gmt4.sh: ./configure: not found
make: *** No rule to make target 'all'.  Stop.

NOTE:
I also tried to replace

"netcdf_path=/usr/bin/nc-config"
with
"netcdf_path="
in GMT4param.txt.

Does anyone have any advice?


Replies (1)

RE: Issues while trying to install GMT4 - Added by Paul 7 months ago

Your ftp failed so nothing got downloaded. I tested your command here and apart from the fact my Mac does no longer have ftp (I installed lftp and changed the ftp -dn to lftp -d in the script) it worked fine. So that means a network issue on your end.
You could go to https://www.generic-mapping-tools.org/download and just get the 4.5.18 tar ball and work from that.

(1-1/1)