Index: /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh	(revision 25242)
+++ /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh	(revision 25243)
@@ -24,5 +24,5 @@
 mkdir build install src
 
-#Download from ISSM server
+# Download source
 ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
 
Index: /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh	(revision 25242)
+++ /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh	(revision 25243)
@@ -11,13 +11,16 @@
 #
 
-# Find libgfortran and libgcc so we do not have to hardcode them
+# Find libgfortran and libgcc so we do not have to hardcode them.
 #
-# NOTE: Assumes user installed gfortran via Homebrew
+# Should retrieve a copy of gfortran that is compiled from source before 
+# returning one that is installed via package manager.
 #
-# TODO: Refactor this to work with other gfortran installations.
+# TODO:
+# - Test if -static-libgfortran flag will avoid all of this.
+# - Otherwise, refactor this to work with other gfortran installations.
 #
-LIBGFORTRAN=$(mdfind -onlyin /usr -name libgfortran | grep -n libgfortran.a | grep -v i386 | sed "s/[0-9]*://g" | head -1) # Should retrieve a copy of gfortran that is compiled from source before returning one that is installed via package manager
+LIBGFORTRAN=$(mdfind -onlyin /usr -name libgfortran | grep -n libgfortran.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
 LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
-LIBGCC=$(mdfind -onlyin ${LIBGFORTRAN_ROOT} -name libgcc | grep -n libgcc.a | grep -v i386 | sed "s/[0-9]*://g" | head -1) # Should retrieve a copy of gfortran that is compiled from source before returning one that is installed via package manager
+LIBGCC=$(mdfind -onlyin ${LIBGFORTRAN_ROOT} -name libgcc | grep -n libgcc.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
 
 export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
Index: /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 25242)
+++ /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 25243)
@@ -10,13 +10,11 @@
 ## Environment
 #
-# Find libgfortran and so we do not have to hardcode it
+
+# Find libgfortran so that we do not have to hardcode it.
 #
-# NOTE:
-# - Assumes user installed gfortran via Homebrew.
-# - Searches for libgfortran.a as it is easier to find it.
+# Should retrieve a copy of gfortran that is compiled from source before 
+# returning one that is installed via package manager.
 #
-# TODO: Refactor this to work with other gfortran installations.
-#
-LIBGFORTRAN=$(mdfind -onlyin /usr -name libgfortran | grep -n libgfortran.a | grep -v i386 | sed "s/[0-9]*://g" | head -1) # Should retrieve a copy of gfortran that is compiled from source before returning one that is installed via package manager
+LIBGFORTRAN=$(mdfind -onlyin /usr -name libgfortran | grep -n libgfortran.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
 LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
 
Index: /issm/trunk-jpl/externalpackages/gmt/configs/6.0/cmake/ConfigUser.cmake
===================================================================
--- /issm/trunk-jpl/externalpackages/gmt/configs/6.0/cmake/ConfigUser.cmake	(revision 25243)
+++ /issm/trunk-jpl/externalpackages/gmt/configs/6.0/cmake/ConfigUser.cmake	(revision 25243)
@@ -0,0 +1,308 @@
+#
+#
+# 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
+# under the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; version 3 or any later version.
+#
+# This program 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.  See the GNU Lesser General Public License
+# for more details.
+#
+# 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 .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
+# "False", "off", "no", and "something-NotFound" are all false).  Other values
+# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
+# OFF, or YES and NO for your booleans.
+
+##
+## Section 1: Installation paths
+##
+
+# ============================================================================
+# Basic setup begins here.  All settings are optional.  In most cases, setting
+# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
+# reasonable defaults enabled.  Note: If you need to specify directory names
+# with spaces (e.g., on Windows) then you must put them in quotes.
+# ============================================================================
+
+# Installation path (usually defaults to /usr/local) [auto]:
+set (CMAKE_INSTALL_PREFIX "$ENV{ISSM_DIR}/externalpackages/gmt/install")
+
+# Set install name suffix used for directories and gmt executables
+# [undefined]:
+#set (GMT_INSTALL_NAME_SUFFIX "suffix")
+
+# Install into traditional directory structure. Disable to install a
+# distribution type directory structure (doc and share separated) [on]:
+#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
+
+# Install convenience links for GMT modules. Disable to install only the main
+# gmt program and access modules as "gmt modulename options" [TRUE]:
+#set (GMT_INSTALL_MODULE_LINKS FALSE)
+
+# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
+set (GMT_INSTALL_RELOCATABLE TRUE)
+
+# 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)
+
+# ============================================================================
+# Advanced configuration begins here.  Usually it is not necessary to edit any
+# settings below.  You should know what you are doing if you do though.  Note:
+# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
+# path is given.
+# ============================================================================
+
+# Set binary installation path [bin]:
+#set (GMT_BINDIR "bin")
+
+# Set library installation path [lib or lib64]:
+#set (GMT_LIBDIR "lib")
+
+# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_INCLUDEDIR "include/gmt")
+
+# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DATADIR "share/gmt")
+
+# Set doc installation path [share/doc or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DOCDIR "share/doc/gmt")
+
+# Set manpage installation path [share/man or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
+#set (GMT_MANDIR "share/doc/gmt/man")
+
+# Install documentation files from this external location instead of creating
+# 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
+# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
+#set (GMT_INSTALL_EXTERNAL_MAN OFF)
+
+##
+## Section 2: Build dependencies (should only be needed if CMake cannot
+## 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 "$ENV{ISSM_DIR}/externalpackages/gshhg/install")
+
+# 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 ${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 "$ENV{ISSM_DIR}/externalpackages/netcdf/install")
+
+# Set location of GDAL (can be root directory, path to header file or path to
+# gdal-config) [auto]:
+set (GDAL_ROOT "$ENV{ISSM_DIR}/externalpackages/gdal/install")
+
+# Set location of PCRE (can be root directory, path to header file or path to
+# pcre-config) [auto]:
+#set (PCRE_ROOT "pcre_install_prefix")
+# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
+# pcre2-config) [auto]:
+#set (PCRE2_ROOT "pcre2_install_prefix")
+
+# Set location of single precision FFTW (can be root directory or path to
+# header file) [auto]:
+#set (FFTW3_ROOT "fftw_install_prefix")
+
+# Set location of ZLIB (can be root directory or path to header file) [auto]:
+set (ZLIB_ROOT "$ENV{ISSM_DIR}/externalpackages/petsc/install")
+
+# Set location of CURL (can be root directory or path to header file) [auto]:
+#set (CURL_ROOT "curl_install_prefix")
+
+# Set location of GLIB component gthread [auto].  This is an optional (and
+# experimental) option which you need to enable:
+#set (GMT_USE_THREADS TRUE)
+# If pkg-config is not installed (e.g. on Windows) you need to specify these:
+#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 LAPACK location. Use this when want to link with LAPACK and it's not found automatically
+set (LAPACK_LIBRARY "-L$ENV{ISSM_DIR}/externalpackages/petsc/install/lib -lflapack")
+set (BLAS_LIBRARY "-L$ENV{ISSM_DIR}/externalpackages/petsc/install/lib -lfblas")
+
+##
+## Section 3: GMT features
+##
+
+# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
+# redistributed under the terms of the GPL or LGPL such as Shewchuk's
+# 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")
+
+# Enable building of shared libraries [TRUE] (disable to use static libraries;
+# not recommended; on non-x86 architectures uncomment the next option as well):
+#set (BUILD_SHARED_LIBS FALSE)
+
+# Create position independent code on all targets [auto] (needed for static
+# build on non-x86):
+#set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
+# Build GMT shared lib with supplemental modules [TRUE]:
+#set (BUILD_SUPPLEMENTS FALSE)
+
+# Build/Install GMT Developer include files [TRUE]:
+# This installs the extra include files and configured files needed by 3rd-party
+# developers.  Until we build a separate gmt-devel we include them in the main
+# Distribution.
+#set (BUILD_DEVELOPER FALSE)
+
+##
+## Section 4: Advanced tweaking
+##
+
+#
+# Testing and development
+#
+
+# Enable running examples/tests with "ctest" or "make check" (out-of-source).
+# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
+# line.
+#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)
+
+# 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]:
+#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
+
+# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
+# 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
+# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
+#set (GMT_RELEASE_PREFIX "release-src-prefix")
+
+# If set to false, image conversion from PS images to PNG and PDF does
+# not depend on the gmt binary target. Note: "make gmt" is then required
+# before docs_depends [TRUE].
+#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
+
+#
+# Debugging
+#
+
+# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
+# [Release]:
+#set (CMAKE_BUILD_TYPE Debug)
+
+# Extra debugging for developers:
+#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)
+#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
+#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_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
+#
+
+# This is for GCC on Solaris to avoid "relocations remain against allocatable
+# but non-writable sections" problems:
+#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
+
+# This may be needed to enable strdup and extended math functions with GCC and
+# Suncc on Solaris:
+#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
+
+# Do not warn when building with Windows SDK or Visual Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+
+# Manually select runtime library when compiling with Windows SDK or Visual
+# Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
+
+# If your NetCDF library is static (not recommended, applies to Windows only)
+#set (NETCDF_STATIC TRUE)
+
+# If want to rename the DLLs to something else than the default (e.g. to
+# append the bitness - Windows only)
+# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
+#if (WIN32)
+# set (BITAGE 32)
+# # Detect if we are building a 32 or 64 bits version
+# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+#   set (BITAGE 64)
+# endif ()
+# set (GMT_DLL_RENAME gmt_w${BITAGE})
+# set (PSL_DLL_RENAME psl_w${BITAGE})
+#endif(WIN32)
+
+# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
+#if(MSVC11)
+#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
+#endif(MSVC11)
Index: /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/ConfigUser.static.cmake
===================================================================
--- /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/ConfigUser.static.cmake	(revision 25243)
+++ /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/ConfigUser.static.cmake	(revision 25243)
@@ -0,0 +1,308 @@
+#
+#
+# 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
+# under the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; version 3 or any later version.
+#
+# This program 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.  See the GNU Lesser General Public License
+# for more details.
+#
+# 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 .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
+# "False", "off", "no", and "something-NotFound" are all false).  Other values
+# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
+# OFF, or YES and NO for your booleans.
+
+##
+## Section 1: Installation paths
+##
+
+# ============================================================================
+# Basic setup begins here.  All settings are optional.  In most cases, setting
+# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
+# reasonable defaults enabled.  Note: If you need to specify directory names
+# with spaces (e.g., on Windows) then you must put them in quotes.
+# ============================================================================
+
+# Installation path (usually defaults to /usr/local) [auto]:
+set (CMAKE_INSTALL_PREFIX "$ENV{ISSM_DIR}/externalpackages/gmt/install")
+
+# Set install name suffix used for directories and gmt executables
+# [undefined]:
+#set (GMT_INSTALL_NAME_SUFFIX "suffix")
+
+# Install into traditional directory structure. Disable to install a
+# distribution type directory structure (doc and share separated) [on]:
+#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
+
+# Install convenience links for GMT modules. Disable to install only the main
+# gmt program and access modules as "gmt modulename options" [TRUE]:
+#set (GMT_INSTALL_MODULE_LINKS FALSE)
+
+# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
+set (GMT_INSTALL_RELOCATABLE TRUE)
+
+# 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)
+
+# ============================================================================
+# Advanced configuration begins here.  Usually it is not necessary to edit any
+# settings below.  You should know what you are doing if you do though.  Note:
+# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
+# path is given.
+# ============================================================================
+
+# Set binary installation path [bin]:
+#set (GMT_BINDIR "bin")
+
+# Set library installation path [lib or lib64]:
+#set (GMT_LIBDIR "lib")
+
+# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_INCLUDEDIR "include/gmt")
+
+# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DATADIR "share/gmt")
+
+# Set doc installation path [share/doc or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DOCDIR "share/doc/gmt")
+
+# Set manpage installation path [share/man or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
+#set (GMT_MANDIR "share/doc/gmt/man")
+
+# Install documentation files from this external location instead of creating
+# 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
+# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
+#set (GMT_INSTALL_EXTERNAL_MAN OFF)
+
+##
+## Section 2: Build dependencies (should only be needed if CMake cannot
+## 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 "$ENV{ISSM_DIR}/externalpackages/gshhg/install")
+
+# 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 ${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 "$ENV{ISSM_DIR}/externalpackages/netcdf/install")
+
+# Set location of GDAL (can be root directory, path to header file or path to
+# gdal-config) [auto]:
+set (GDAL_ROOT "$ENV{ISSM_DIR}/externalpackages/gdal/install")
+
+# Set location of PCRE (can be root directory, path to header file or path to
+# pcre-config) [auto]:
+#set (PCRE_ROOT "pcre_install_prefix")
+# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
+# pcre2-config) [auto]:
+#set (PCRE2_ROOT "pcre2_install_prefix")
+
+# Set location of single precision FFTW (can be root directory or path to
+# header file) [auto]:
+#set (FFTW3_ROOT "fftw_install_prefix")
+
+# Set location of ZLIB (can be root directory or path to header file) [auto]:
+set (ZLIB_ROOT "$ENV{ISSM_DIR}/externalpackages/petsc/install")
+
+# Set location of CURL (can be root directory or path to header file) [auto]:
+set (CURL_ROOT "$ENV{ISSM_DIR}/externalpackages/curl/install")
+
+# Set location of GLIB component gthread [auto].  This is an optional (and
+# experimental) option which you need to enable:
+#set (GMT_USE_THREADS TRUE)
+# If pkg-config is not installed (e.g. on Windows) you need to specify these:
+#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 LAPACK location. Use this when want to link with LAPACK and it's not found automatically
+#set (LAPACK_LIBRARY "-L$ENV{ISSM_DIR}/externalpackages/petsc/install/lib -lflapack")
+#set (BLAS_LIBRARY "-L$ENV{ISSM_DIR}/externalpackages/petsc/install/lib -lfblas")
+
+##
+## Section 3: GMT features
+##
+
+# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
+# redistributed under the terms of the GPL or LGPL such as Shewchuk's
+# 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")
+
+# Enable building of shared libraries [TRUE] (disable to use static libraries;
+# not recommended; on non-x86 architectures uncomment the next option as well):
+set (BUILD_SHARED_LIBS FALSE)
+
+# Create position independent code on all targets [auto] (needed for static
+# build on non-x86):
+set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
+# Build GMT shared lib with supplemental modules [TRUE]:
+set (BUILD_SUPPLEMENTS FALSE)
+
+# Build/Install GMT Developer include files [TRUE]:
+# This installs the extra include files and configured files needed by 3rd-party
+# developers.  Until we build a separate gmt-devel we include them in the main
+# Distribution.
+#set (BUILD_DEVELOPER FALSE)
+
+##
+## Section 4: Advanced tweaking
+##
+
+#
+# Testing and development
+#
+
+# Enable running examples/tests with "ctest" or "make check" (out-of-source).
+# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
+# line.
+#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)
+
+# 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]:
+#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
+
+# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
+# 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
+# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
+#set (GMT_RELEASE_PREFIX "release-src-prefix")
+
+# If set to false, image conversion from PS images to PNG and PDF does
+# not depend on the gmt binary target. Note: "make gmt" is then required
+# before docs_depends [TRUE].
+#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
+
+#
+# Debugging
+#
+
+# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
+# [Release]:
+#set (CMAKE_BUILD_TYPE Debug)
+
+# Extra debugging for developers:
+#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)
+#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
+#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_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
+#
+
+# This is for GCC on Solaris to avoid "relocations remain against allocatable
+# but non-writable sections" problems:
+#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
+
+# This may be needed to enable strdup and extended math functions with GCC and
+# Suncc on Solaris:
+#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
+
+# Do not warn when building with Windows SDK or Visual Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+
+# Manually select runtime library when compiling with Windows SDK or Visual
+# Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
+
+# If your NetCDF library is static (not recommended, applies to Windows only)
+set (NETCDF_STATIC TRUE)
+
+# If want to rename the DLLs to something else than the default (e.g. to
+# append the bitness - Windows only)
+# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
+#if (WIN32)
+# set (BITAGE 32)
+# # Detect if we are building a 32 or 64 bits version
+# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+#   set (BITAGE 64)
+# endif ()
+# set (GMT_DLL_RENAME gmt_w${BITAGE})
+# set (PSL_DLL_RENAME psl_w${BITAGE})
+#endif(WIN32)
+
+# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
+#if(MSVC11)
+#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
+#endif(MSVC11)
Index: /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/modules/FindGDAL.cmake
===================================================================
--- /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/modules/FindGDAL.cmake	(revision 25243)
+++ /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/modules/FindGDAL.cmake	(revision 25243)
@@ -0,0 +1,187 @@
+#
+#
+# Locate gdal
+#
+# This module accepts the following environment variables:
+#
+#    GDAL_DIR or GDAL_ROOT - Specify the location of GDAL
+#
+# This module defines the following CMake variables:
+#
+#    GDAL_FOUND - True if libgdal is found
+#    GDAL_LIBRARY - A variable pointing to the GDAL library
+#    GDAL_INCLUDE_DIR - Where to find the headers
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See COPYING-CMAKE-SCRIPTS for more information.
+#=============================================================================
+# Note: this file is not an exact copy of the original file from Kitware.
+#       It has been modified for the needs of GMT.
+
+#
+# $GDAL_DIR is an environment variable that would
+# correspond to the ./configure --prefix=$GDAL_DIR
+# used in building gdal.
+#
+# Created by Eric Wing. I'm not a gdal user, but OpenSceneGraph uses it
+# for osgTerrain so I whipped this module together for completeness.
+# I actually don't know the conventions or where files are typically
+# placed in distros.
+# Any real gdal users are encouraged to correct this (but please don't
+# break the OS X framework stuff when doing so which is what usually seems
+# to happen).
+
+# This makes the presumption that you are include gdal.h like
+#
+#include "gdal.h"
+
+if (DEFINED GDAL_ROOT AND NOT GDAL_ROOT)
+	set (GDAL_LIBRARY "" CACHE INTERNAL "")
+	set (GDAL_INCLUDE_DIR "" CACHE INTERNAL "")
+	return()
+endif (DEFINED GDAL_ROOT AND NOT GDAL_ROOT)
+
+if (UNIX AND NOT GDAL_FOUND)
+	# Use gdal-config to obtain the library version (this should hopefully
+	# allow us to -lgdal1.x.y where x.y are correct version)
+	# For some reason, libgdal development packages do not contain
+	# libgdal.so...
+	find_program (GDAL_CONFIG gdal-config
+		HINTS
+		${GDAL_DIR}
+		${GDAL_ROOT}
+		$ENV{GDAL_DIR}
+		$ENV{GDAL_ROOT}
+		PATH_SUFFIXES bin
+		PATHS
+		/sw # Fink
+		/opt/local # DarwinPorts
+		/opt/csw # Blastwave
+		/opt
+		/usr/local
+	)
+
+	if (GDAL_CONFIG)
+		execute_process (COMMAND ${GDAL_CONFIG} --cflags
+			ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
+			OUTPUT_VARIABLE GDAL_CONFIG_CFLAGS)
+		if (GDAL_CONFIG_CFLAGS)
+			string (REGEX MATCHALL "-I[^ ]+" _gdal_dashI ${GDAL_CONFIG_CFLAGS})
+			string (REGEX REPLACE "-I" "" _gdal_includepath "${_gdal_dashI}")
+			string (REGEX REPLACE "-I[^ ]+" "" _gdal_cflags_other ${GDAL_CONFIG_CFLAGS})
+		endif (GDAL_CONFIG_CFLAGS)
+		execute_process (COMMAND ${GDAL_CONFIG} --libs
+			ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
+			OUTPUT_VARIABLE GDAL_CONFIG_LIBS)
+		if (GDAL_CONFIG_LIBS)
+			string (REGEX MATCHALL "-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_LIBS})
+			string (REGEX REPLACE "-l" "" _gdal_lib "${_gdal_dashl}")
+			string (REGEX MATCHALL "-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_LIBS})
+			string (REGEX REPLACE "-L" "" _gdal_libpath "${_gdal_dashL}")
+		endif (GDAL_CONFIG_LIBS)
+		execute_process (COMMAND ${GDAL_CONFIG} --dep-libs
+			ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
+			OUTPUT_VARIABLE GDAL_CONFIG_DEP_LIBS)
+		if (GDAL_CONFIG_DEP_LIBS)
+			string (REGEX MATCHALL "-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_DEP_LIBS})
+			string (REGEX REPLACE "-l" "" _gdal_dep_lib "${_gdal_dashl}")
+			string (REGEX MATCHALL "-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_DEP_LIBS})
+			string (REGEX REPLACE "-L" "" _gdal_dep_libpath "${_gdal_dashL}")
+		endif (GDAL_CONFIG_DEP_LIBS)
+	endif (GDAL_CONFIG)
+	if (_gdal_dep_lib)
+		list (REMOVE_DUPLICATES _gdal_dep_lib)
+		list (REMOVE_ITEM _gdal_dep_lib gdal)
+	endif (_gdal_dep_lib)
+endif (UNIX AND NOT GDAL_FOUND)
+
+find_path (GDAL_INCLUDE_DIR gdal.h
+	HINTS
+	${_gdal_includepath}
+	${GDAL_DIR}
+	${GDAL_ROOT}
+	$ENV{GDAL_DIR}
+	$ENV{GDAL_ROOT}
+	PATH_SUFFIXES
+	include/gdal
+	include/GDAL
+	include
+	PATHS
+	~/Library/Frameworks/gdal.framework/Headers
+	/Library/Frameworks/gdal.framework/Headers
+	/sw # Fink
+	/opt/local # DarwinPorts
+	/opt/csw # Blastwave
+	/opt
+	/usr/local
+)
+
+find_library (GDAL_LIBRARY
+	NAMES ${_gdal_lib} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
+	HINTS
+	${GDAL_DIR}
+	${GDAL_ROOT}
+	$ENV{GDAL_DIR}
+	$ENV{GDAL_ROOT}
+	${_gdal_libpath}
+	PATH_SUFFIXES lib
+	PATHS
+	~/Library/Frameworks/gdal.framework
+	/Library/Frameworks/gdal.framework
+	/sw # Fink
+	/opt/local # DarwinPorts
+	/opt/csw # Blastwave
+	/opt
+	/usr/local
+)
+
+# find all libs that gdal-config --dep-libs reports
+foreach (_extralib ${_gdal_dep_lib})
+	find_library (_found_lib_${_extralib}
+		NAMES ${_extralib}
+		HINTS
+		${HDF5_ROOT}
+		$ENV{HDF5_ROOT}
+		${ZLIB_ROOT}
+		$ENV{ZLIB_ROOT}
+		${CURL_ROOT}
+		$ENV{CURL_ROOT}
+		PATH_SUFFIXES lib
+		PATHS 
+		${_gdal_dep_libpath}
+	)
+	list (APPEND GDAL_LIBRARY ${_found_lib_${_extralib}})
+endforeach (_extralib)
+
+# append manually-supplied libs
+# find all manually-supplied libs
+if (GDAL_EXTRA_LIBS)
+	# Ensure -l is precedeced by whitespace to not match
+	# '-l' in '-L/usr/lib/x86_64-linux-gnu/hdf5/serial'
+	string (REGEX MATCHALL "(^| )-l[^ ]+" _gdal_extra_lib_dashl ${GDAL_EXTRA_LIBS})
+	string (REGEX REPLACE "(^| )-l" "" _gdal_extra_lib "${_gdal_extra_lib_dashl}")
+	string (REGEX MATCHALL "(^| )-L[^ ]+" _gdal_extra_lib_dashL ${GDAL_EXTRA_LIBS})
+	string (REGEX REPLACE "(^| )-L" "" _gdal_extra_libpath "${_gdal_extra_lib_dashL}")
+	foreach (_extralib ${_gdal_extra_lib})
+		find_library (_found_lib_${_extralib}
+			NAMES ${_extralib}
+			PATH_SUFFIXES lib
+			PATHS 
+			${_gdal_extra_libpath}
+		)
+		list (APPEND GDAL_LIBRARY ${_found_lib_${_extralib}})
+	endforeach (_extralib)
+endif (GDAL_EXTRA_LIBS)
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (GDAL DEFAULT_MSG GDAL_LIBRARY GDAL_INCLUDE_DIR)
+
+set (GDAL_LIBRARIES ${GDAL_LIBRARY})
+set (GDAL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR})
Index: /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/modules/FindGSHHG.cmake
===================================================================
--- /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/modules/FindGSHHG.cmake	(revision 25243)
+++ /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/modules/FindGSHHG.cmake	(revision 25243)
@@ -0,0 +1,95 @@
+#
+#
+# Locate GSHHG shorelines
+#
+# This module accepts the following environment variables:
+#
+#  GSHHG_ROOT, GSHHGDIR - Specify the location of GSHHG
+#
+# This module defines the following CMake variables:
+#
+#    GSHHG_FOUND        - True if GSHHG is found
+#    GSHHG_PATH         - A variable pointing to the GSHHG path
+#    GSHHG_VERSION      - String of the GSHHG version found
+#    GSHHG_MIN_REQUIRED_VERSION_{MAJOR, MINOR, PATCH}
+#                       - Major, minor, and patch version required
+
+# get GSHHG path
+find_path (GSHHG_PATH
+	NAMES binned_GSHHS_c.nc
+	HINTS ${GSHHG_ROOT} $ENV{GSHHG_ROOT} $ENV{GSHHGDIR}
+	PATH_SUFFIXES
+	gmt-gshhg
+	gshhg
+	gshhg-gmt
+	gshhg-gmt-nc4
+	share/gmt/gshhg
+	share/gmt-gshhg
+	share/gshhg
+	share/gshhg-gmt
+	share/gshhg-gmt-nc4
+	PATHS
+	${CMAKE_SOURCE_DIR}
+	/sw # Fink
+	/opt/local # DarwinPorts
+	/opt/csw # Blastwave
+	/opt
+	/usr/local
+	DOC "Global Self-consistent Hierarchical High-resolution Geography"
+)
+
+# get GSHHG file
+if (GSHHG_PATH)
+	find_file (_GSHHG_FILE
+		NAMES binned_GSHHS_c.nc
+		HINTS ${GSHHG_PATH})
+endif (GSHHG_PATH)
+
+# The minimum required GSHHG version
+set (GSHHG_MIN_REQUIRED_VERSION_MAJOR 2 CACHE INTERNAL "GSHHG required version major")
+set (GSHHG_MIN_REQUIRED_VERSION_MINOR 2 CACHE INTERNAL "GSHHG required version minor")
+set (GSHHG_MIN_REQUIRED_VERSION_PATCH 0 CACHE INTERNAL "GSHHG required version patch")
+set (GSHHG_MIN_REQUIRED_VERSION
+	"${GSHHG_MIN_REQUIRED_VERSION_MAJOR}.${GSHHG_MIN_REQUIRED_VERSION_MINOR}.${GSHHG_MIN_REQUIRED_VERSION_PATCH}")
+
+# Temporary hack to bypass failure of compilation of code to find GSHHG
+set (GSHHG_FOUND TRUE)
+set (GSHHG_VERSION "2.3.4" CACHE INTERNAL "GSHHG version")
+
+# check GSHHG version
+if (_GSHHG_FILE AND NOT GSHHG_FOUND)
+	try_run (_EXIT_GSHHG_VERSION _COMPILED_GSHHG_VERSION
+		${CMAKE_BINARY_DIR}/CMakeTmp
+		${CMAKE_CURRENT_SOURCE_DIR}/gshhg_version.c
+		CMAKE_FLAGS
+		-DINCLUDE_DIRECTORIES=${NETCDF_INCLUDE_DIR}
+		-DLINK_LIBRARIES=${NETCDF_LIBRARIES}
+		COMPILE_DEFINITIONS -DSTANDALONE
+		COMPILE_OUTPUT_VARIABLE _GSHHG_VERSION_COMPILE_OUT
+		RUN_OUTPUT_VARIABLE _GSHHG_VERSION_STRING
+		ARGS \"${_GSHHG_FILE}\" ${GSHHG_MIN_REQUIRED_VERSION})
+
+	if (NOT _COMPILED_GSHHG_VERSION OR _EXIT_GSHHG_VERSION STREQUAL FAILED_TO_RUN)
+		message(FATAL_ERROR "Cannot determine GSHHG version:\n
+		${_GSHHG_VERSION_COMPILE_OUT}\n
+		${_GSHHG_VERSION_STRING}")
+	endif ()
+
+	# check version string
+	if (_COMPILED_GSHHG_VERSION)
+		# strip whitespace
+		string (STRIP ${_GSHHG_VERSION_STRING} GSHHG_VERSION)
+		if (_EXIT_GSHHG_VERSION EQUAL 0)
+			# found GSHHG of required version or higher
+			set (GSHHG_VERSION ${GSHHG_VERSION} CACHE INTERNAL "GSHHG version")
+		elseif (_EXIT_GSHHG_VERSION EQUAL -1)
+			# found GSHHG but version is too old
+			message (WARNING "GSHHG found but it is too old (${GSHHG_VERSION}). "
+				"Need at least ${GSHHG_MIN_REQUIRED_VERSION}.")
+		endif (_EXIT_GSHHG_VERSION EQUAL 0)
+	endif (_COMPILED_GSHHG_VERSION)
+endif (_GSHHG_FILE AND NOT GSHHG_FOUND)
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (GSHHG DEFAULT_MSG
+	GSHHG_PATH GSHHG_VERSION)
Index: /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/modules/FindNETCDF.cmake
===================================================================
--- /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/modules/FindNETCDF.cmake	(revision 25243)
+++ /issm/trunk-jpl/externalpackages/gmt/configs/6.0/static/cmake/modules/FindNETCDF.cmake	(revision 25243)
@@ -0,0 +1,170 @@
+#
+#
+# Locate netcdf
+#
+# This module accepts the following environment variables:
+#
+#    NETCDF_DIR or NETCDF_ROOT - Specify the location of NetCDF
+#
+# This module defines the following CMake variables:
+#
+#    NETCDF_FOUND - True if libnetcdf is found
+#    NETCDF_LIBRARY - A variable pointing to the NetCDF library
+#    NETCDF_INCLUDE_DIR - Where to find the headers
+#    NETCDF_INCLUDE_DIRS - Where to find the headers
+#    NETCDF_DEFINITIONS - Extra compiler flags
+
+#=============================================================================
+# Inspired by FindGDAL
+#
+# Distributed under the OSI-approved bsd license (the "License")
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See COPYING-CMAKE-SCRIPTS for more information.
+#=============================================================================
+
+# This makes the presumption that you are include netcdf.h like
+#
+#include "netcdf.h"
+
+if (UNIX AND NOT NETCDF_FOUND)
+	# Use nc-config to obtain the libraries
+	find_program (NETCDF_CONFIG nc-config
+		HINTS
+		${NETCDF_DIR}
+		${NETCDF_ROOT}
+		$ENV{NETCDF_DIR}
+		$ENV{NETCDF_ROOT}
+		PATH_SUFFIXES bin
+		PATHS
+		/sw # Fink
+		/opt/local # DarwinPorts
+		/opt/csw # Blastwave
+		/opt
+		/usr/local
+	)
+
+	if (NETCDF_CONFIG)
+		execute_process (COMMAND ${NETCDF_CONFIG} --cflags
+			ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
+			OUTPUT_VARIABLE NETCDF_CONFIG_CFLAGS)
+		if (NETCDF_CONFIG_CFLAGS)
+			string (REGEX MATCHALL "(^| )-I[^ ]+" _netcdf_dashI ${NETCDF_CONFIG_CFLAGS})
+			string (REGEX REPLACE "(^| )-I" "" _netcdf_includepath "${_netcdf_dashI}")
+			string (REGEX REPLACE "(^| )-I[^ ]+" "" _netcdf_cflags_other ${NETCDF_CONFIG_CFLAGS})
+		endif (NETCDF_CONFIG_CFLAGS)
+		execute_process (COMMAND ${NETCDF_CONFIG} --libs
+			ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
+			OUTPUT_VARIABLE NETCDF_CONFIG_LIBS)
+		if (NETCDF_CONFIG_LIBS)
+			# Ensure -l is precedeced by whitespace to not match
+			# '-l' in '-L/usr/lib/x86_64-linux-gnu/hdf5/serial'
+			string (REGEX MATCHALL "(^| )-l[^ ]+" _netcdf_dashl ${NETCDF_CONFIG_LIBS})
+			string (REGEX REPLACE "(^| )-l" "" _netcdf_lib "${_netcdf_dashl}")
+			string (REGEX MATCHALL "(^| )-L[^ ]+" _netcdf_dashL ${NETCDF_CONFIG_LIBS})
+			string (REGEX REPLACE "(^| )-L" "" _netcdf_libpath "${_netcdf_dashL}")
+		endif (NETCDF_CONFIG_LIBS)
+	endif (NETCDF_CONFIG)
+	if (_netcdf_lib)
+		list (REMOVE_DUPLICATES _netcdf_lib)
+		list (REMOVE_ITEM _netcdf_lib netcdf)
+	endif (_netcdf_lib)
+endif (UNIX AND NOT NETCDF_FOUND)
+
+find_path (NETCDF_INCLUDE_DIR netcdf.h
+	HINTS
+	${_netcdf_includepath}
+	${NETCDF_DIR}
+	${NETCDF_ROOT}
+	$ENV{NETCDF_DIR}
+	$ENV{NETCDF_ROOT}
+	PATH_SUFFIXES
+	include/netcdf
+	include/netcdf-4
+	include/netcdf-3
+	include
+	PATHS
+	/sw # Fink
+	/opt/local # DarwinPorts
+	/opt/csw # Blastwave
+	/opt
+	/usr/local
+)
+
+find_library (NETCDF_LIBRARY
+	NAMES netcdf
+	HINTS
+	${_netcdf_libpath}
+	${NETCDF_DIR}
+	${NETCDF_ROOT}
+	$ENV{NETCDF_DIR}
+	$ENV{NETCDF_ROOT}
+	PATH_SUFFIXES lib
+	PATHS
+	/sw
+	/opt/local
+	/opt/csw
+	/opt
+	/usr/local
+)
+
+# find all libs that nc-config reports
+foreach (_extralib ${_netcdf_lib})
+	find_library (_found_lib_${_extralib}
+		NAMES ${_extralib}
+		HINTS
+		${HDF5_ROOT}
+		$ENV{HDF5_ROOT}
+		${ZLIB_ROOT}
+		$ENV{ZLIB_ROOT}
+		${CURL_ROOT}
+		$ENV{CURL_ROOT}
+		PATH_SUFFIXES lib
+		PATHS 
+		${_netcdf_libpath}
+	)
+	list (APPEND NETCDF_LIBRARY ${_found_lib_${_extralib}})
+endforeach (_extralib)
+
+# find all manually-supplied libs
+if (NETCDF_EXTRA_LIBS)
+	# Ensure -l is precedeced by whitespace to not match
+	# '-l' in '-L/usr/lib/x86_64-linux-gnu/hdf5/serial'
+	string (REGEX MATCHALL "(^| )-l[^ ]+" _netcdf_extra_lib_dashl ${NETCDF_EXTRA_LIBS})
+	string (REGEX REPLACE "(^| )-l" "" _netcdf_extra_lib "${_netcdf_extra_lib_dashl}")
+	string (REGEX MATCHALL "(^| )-L[^ ]+" _netcdf_extra_lib_dashL ${NETCDF_EXTRA_LIBS})
+	string (REGEX REPLACE "(^| )-L" "" _netcdf_extra_libpath "${_netcdf_extra_lib_dashL}")
+	foreach (_extralib ${_netcdf_extra_lib})
+		find_library (_found_lib_${_extralib}
+			NAMES ${_extralib}
+			PATH_SUFFIXES lib
+			PATHS 
+			${_netcdf_extra_libpath}
+		)
+		list (APPEND NETCDF_LIBRARY ${_found_lib_${_extralib}})
+	endforeach (_extralib)
+endif (NETCDF_EXTRA_LIBS)
+
+if (NETCDF_LIBRARY AND NETCDF_INCLUDE_DIR AND NOT HAVE_NETCDF4)
+	# Ensure that NetCDF with version 4 extensions is installed
+	include (CMakePushCheckState)
+	include (CheckSymbolExists)
+	cmake_push_check_state() # save state of CMAKE_REQUIRED_*
+	set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${NETCDF_INCLUDE_DIR})
+	set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${NETCDF_LIBRARY})
+	set (HAVE_NETCDF4 HAVE_NETCDF4) # to force check_symbol_exists again
+	check_symbol_exists (nc_def_var_deflate netcdf.h HAVE_NETCDF4)
+	cmake_pop_check_state() # restore state of CMAKE_REQUIRED_*
+	if (NOT HAVE_NETCDF4)
+		message (SEND_ERROR "Library found but netCDF-4/HDF5 format unsupported. Do not configure netCDF-4 with --disable-netcdf-4.")
+	endif (NOT HAVE_NETCDF4)
+endif (NETCDF_LIBRARY AND NETCDF_INCLUDE_DIR AND NOT HAVE_NETCDF4)
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (NETCDF
+	DEFAULT_MSG NETCDF_LIBRARY NETCDF_INCLUDE_DIR HAVE_NETCDF4)
+
+set (NETCDF_LIBRARIES ${NETCDF_LIBRARY})
+set (NETCDF_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR})
+string (REPLACE "-DNDEBUG" "" NETCDF_DEFINITIONS "${_netcdf_cflags_other}")
Index: /issm/trunk-jpl/externalpackages/gmt/install-6.0-linux-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/gmt/install-6.0-linux-static.sh	(revision 25242)
+++ /issm/trunk-jpl/externalpackages/gmt/install-6.0-linux-static.sh	(revision 25243)
@@ -2,4 +2,9 @@
 set -eu
 
+
+# TODO:
+# - Apply changes made to ./install-6.0-mac-static.sh and customized 
+#	configuration files to this file.
+#
 
 ## Constants
@@ -17,5 +22,5 @@
 ZLIB_ROOT="${PETSC_ROOT}"
 
-GDAL_LIBRARY="${GDAL_ROOT}/lib/libgdal.a;${NETCDF_ROOT}/lib/libnetcdf.a;${HDF5_ROOT}/lib/libhdf5_hl.a;${HDF5_ROOT}/lib/libhdf5.a;${PROJ_ROOT}/lib/libproj.a;${ZLIB_ROOT}/lib/libz.a;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libdl.so;${CURL_ROOT}/lib/libcurl.a;/usr/lib/x86_64-linux-gnu/libssl.a;/usr/lib/x86_64-linux-gnu/libcrypto.a;/usr/lib/x86_64-linux-gnu/libsqlite3.a;/usr/lib/x86_64-linux-gnu/libexpat.a;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25;" # Determined by running `$GDAL_ROOT/bin/gdal-config --dep-libs`, removing duplicate libs, then adding libmpicxx as, otherwise, various symbols in libgdal are undefined (compiled with mpicxx)
+GDAL_LIBRARY="${GDAL_ROOT}/lib/libgdal.a;${NETCDF_ROOT}/lib/libnetcdf.a;${HDF5_ROOT}/lib/libhdf5_hl.a;${HDF5_ROOT}/lib/libhdf5.a;${PROJ_ROOT}/lib/libproj.a;${ZLIB_ROOT}/lib/libz.a;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libdl.so;${CURL_ROOT}/lib/libcurl.a;/usr/lib/x86_64-linux-gnu/libssl.a;/usr/lib/x86_64-linux-gnu/libcrypto.a;/usr/lib/x86_64-linux-gnu/libsqlite3.a;/usr/lib/x86_64-linux-gnu/libexpat.a;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25;" # Determined by running `$GDAL_ROOT/bin/gdal-config --dep-libs` then removing duplicate libs
 NETCDF_LIBRARY="${NETCDF_ROOT}/lib/libnetcdf.a;/usr/lib/x86_64-linux-gnu/libm.so;${CURL_ROOT}/lib/libcurl.a;${HDF5_ROOT}/lib/libhdf5_hl.a;${HDF5_ROOT}/lib/libhdf5.a;${ZLIB_ROOT}/lib/libz.a;/usr/lib/x86_64-linux-gnu/libssl.a;/usr/lib/x86_64-linux-gnu/libcrypto.a;/usr/lib/x86_64-linux-gnu/libdl.so" # Determined by running `$NETCDF_ROOT/bin/nc-config --libs`
 
@@ -39,6 +44,6 @@
 
 # Copy custom configuration files
-cp ./configs/6.0/linux/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
-cp ./configs/6.0/linux/static/cmake/modules/FindGSHHG.cmake ./src/cmake/modules
+cp ./configs/6.0/static/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
+cp ./configs/6.0/static/cmake/modules/FindGSHHG.cmake ./src/cmake/modules
 
 # Configure
Index: /issm/trunk-jpl/externalpackages/gmt/install-6.0-linux.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/gmt/install-6.0-linux.sh	(revision 25242)
+++ /issm/trunk-jpl/externalpackages/gmt/install-6.0-linux.sh	(revision 25243)
@@ -28,5 +28,5 @@
 
 # Copy custom configuration files
-cp ./configs/6.0/linux/cmake/ConfigUser.cmake ./src/cmake
+cp ./configs/6.0/cmake/ConfigUser.cmake ./src/cmake
 
 # Configure
Index: /issm/trunk-jpl/externalpackages/gmt/install-6.0-mac-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/gmt/install-6.0-mac-static.sh	(revision 25243)
+++ /issm/trunk-jpl/externalpackages/gmt/install-6.0-mac-static.sh	(revision 25243)
@@ -0,0 +1,78 @@
+#!/bin/bash
+set -eu
+
+
+# TODO:
+# - Apply changes to this file and customized configuration files to 
+#	./install-6.0-linux-static.sh
+#
+
+## Constants
+#
+VER="6.0.0"
+
+PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+
+BLASLAPACK_ROOT="${PETSC_ROOT}"
+HDF5_ROOT="${PETSC_ROOT}"
+
+# Find libgfortran and libgcc so we do not have to hardcode them
+#
+# Should retrieve a copy of gfortran that is compiled from source before returning one that is installed via package manager
+#
+# TODO:
+# - Test if -static-libgfortran flag will avoid all of this.
+# - Otherwise, refactor this to work with other gfortran installations.
+#
+LIBGFORTRAN=$(mdfind -onlyin /usr -name libgfortran | grep -n libgfortran.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
+LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
+LIBGCC=$(mdfind -onlyin ${LIBGFORTRAN_ROOT} -name libgcc | grep -n libgcc.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
+
+GDAL_EXTRA_LIBS="-lc++" # `$GDAL_ROOT/bin/gdal-config --dep-libs` does not report need to link to libc++ (see also customized configuration file ./configs/6.0/static/cmake/modules/FindGDAL.cmake)
+NETCDF_EXTRA_LIBS="-lsqlite3 -lpthread -ldl -lidn2 -lldap -liconv" # `$NETCDF_ROOT/bin/nc-config --libs` does not report certain dependencies of certain static libraries (see also customized configuration file ./configs/6.0/static/cmake/modules/FindNETCDF.cmake)
+
+# Environment
+#
+export CC=mpicc
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmt-${VER}.tar.gz" "gmt-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf gmt-${VER}.tar.gz
+
+# Cleanup
+rm -rf install src
+mkdir install src
+
+# Move source to 'src' directory
+mv gmt-${VER}/* src
+rm -rf gmt-${VER}
+
+# Copy custom configuration files
+cp ./configs/6.0/static/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
+cp ./configs/6.0/static/cmake/modules/FindGDAL.cmake ./src/cmake/modules
+cp ./configs/6.0/static/cmake/modules/FindGSHHG.cmake ./src/cmake/modules
+cp ./configs/6.0/static/cmake/modules/FindNETCDF.cmake ./src/cmake/modules
+
+# Configure
+cd src
+mkdir build
+cd build
+
+cmake \
+	-DBLAS_LIBRARIES="${BLASLAPACK_ROOT}/lib/libfblas.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
+	-DGDAL_EXTRA_LIBS="${GDAL_EXTRA_LIBS}" \
+	-DHDF5_ROOT="${HDF5_ROOT}" \
+	-DLAPACK_LIBRARIES="${BLASLAPACK_ROOT}/lib/libflapack.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
+	-DNETCDF_EXTRA_LIBS="${NETCDF_EXTRA_LIBS}" \
+	..
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
Index: /issm/trunk-jpl/externalpackages/gmt/install-6.0-mac.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/gmt/install-6.0-mac.sh	(revision 25242)
+++ /issm/trunk-jpl/externalpackages/gmt/install-6.0-mac.sh	(revision 25243)
@@ -28,5 +28,5 @@
 
 # Copy custom configuration files
-cp ./configs/6.0/linux/cmake/ConfigUser.cmake ./src/cmake
+cp ./configs/6.0/cmake/ConfigUser.cmake ./src/cmake
 
 # Configure
Index: /issm/trunk-jpl/externalpackages/netcdf/install-4.7-mac-parallel-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/netcdf/install-4.7-mac-parallel-static.sh	(revision 25243)
+++ /issm/trunk-jpl/externalpackages/netcdf/install-4.7-mac-parallel-static.sh	(revision 25243)
@@ -0,0 +1,74 @@
+#!/bin/bash
+set -eu
+
+
+# Dependencies
+# - MPI implementation (for parallel I/O support)
+# - hdf5 (1.8.9 / 1.10.1 or later, for netCDF-4 support)
+# - zlib (1.2.5 or later, for netCDF-4 compression)
+# - curl (7.18.0 or later, for DAP remote access client support)
+#
+# For most ISSM installations, only hdf5 will be necessary
+#
+# Sources:
+# - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
+#
+
+# NOTE:
+# - Certain configuration tests fail if libraries are not supplied explicitly
+
+# Constants
+#
+VER="4.7.2"
+
+CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
+HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+
+# Environment
+#
+export CC=mpicc
+export CPPFLAGS="-I${CURL_ROOT}/include -I${HDF5_ROOT}/include -I${ZLIB_ROOT}/include"
+
+export CURLLIB="${CURL_ROOT}/lib/libcurl.a"
+export HDF5LIB="${HDF5_ROOT}/lib/libhdf5_hl.a ${HDF5_ROOT}/lib/libhdf5.a"
+export ZLIB="${ZLIB_ROOT}/lib/libz.a"
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf netcdf-c-$VER.tar.gz
+
+# Cleanup
+rm -rf install src
+mkdir install src
+
+# Move source to 'src' directory
+mv netcdf-c-$VER/* src/
+rm -rf netcdf-c-$VER
+
+# Configure
+cd src
+./configure \
+	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
+	--disable-shared \
+	--disable-dependency-tracking \
+	--enable-fast-install \
+	--disable-doxygen \
+	--enable-netcdf4 \
+	--disable-testsets \
+	--disable-examples \
+	--disable-filter-testing
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+
+# Return to initial directory
+cd ..
Index: /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh	(revision 25242)
+++ /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh	(revision 25243)
@@ -21,4 +21,5 @@
 #
 VER="4.7.2"
+
 CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
 HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
@@ -29,5 +30,9 @@
 export CC=mpicc
 export CPPFLAGS="-I${CURL_ROOT}/include -I${HDF5_ROOT}/include -I${ZLIB_ROOT}/include"
-export LIBS="${CURL_ROOT}/lib/libcurl.a ${HDF5_ROOT}/lib/libhdf5_hl.a ${HDF5_ROOT}/lib/libhdf5.a ${ZLIB_ROOT}/lib/libz.a /usr/lib/x86_64-linux-gnu/libssl.a /usr/lib/x86_64-linux-gnu/libcrypto.a -L/usr/lib/x86_64-linux-gnu -ldl"
+export LIBS="/usr/lib/x86_64-linux-gnu/libssl.a /usr/lib/x86_64-linux-gnu/libcrypto.a -L/usr/lib/x86_64-linux-gnu -ldl"
+
+export CURLLIB="${CURL_ROOT}/lib/libcurl.a"
+export HDF5LIB="${HDF5_ROOT}/lib/libhdf5_hl.a ${HDF5_ROOT}/lib/libhdf5.a"
+export ZLIB="${ZLIB_ROOT}/lib/libz.a"
 
 # Download source
@@ -55,5 +60,6 @@
 	--enable-netcdf4 \
 	--disable-testsets \
-	--disable-examples
+	--disable-examples \
+	--disable-filter-testing
 
 # Compile and install
