kimyoungjin06 The following set up works for GMT + GMSH on Linux systems. Note that these installation scripts will be available in trunk/
after our next public release.
External Packages
I suggest that you use the following scripts, in order, to install the required external packages to their respective subdirectories under $ISSM_DIR/externalpackages/
. As always, run source $ISSM_DIR/etc/environment.sh
after each successful installation.
mpich/install.sh (if you are not using a different MPI implementation)
#!/bin/bash
set -eu
## Constants
#
VER="3.3"
# Download source
$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/mpich-${VER}.tar.gz" "mpich-${VER}.tar.gz"
# Unpack source
tar -zxvf mpich-$VER.tar.gz
# Cleanup
rm -rf install src
mkdir install src
# Move source into 'src' directory
mv mpich-$VER/* src
rm -rf mpich-$VER
# Configure
cd src
./configure \
--prefix="${ISSM_DIR}/externalpackages/mpich/install" \
--enable-shared
# Compile and install
if [ $# -eq 0 ]; then
make
make install
else
make -j $1
make -j $1 install
fi
lapack/install.sh
#!/bin/bash
set -eu
# NOTE: This installation script will build both BLAS and LAPACK libraries
#
## Constants
#
VER="3.8.0"
# Download source
$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/lapack-${VER}.tar.gz" "lapack-${VER}.tar.gz"
# Unpack source
tar -zxvf lapack-$VER.tar.gz
# Cleanup
rm -rf build install src
mkdir build install install/lib src
# Move source to 'src' directory
mv lapack-$VER/* src
rm -rf lapack-$VER
# Configure
#
cd build
cmake \
-DBUILD_SHARED_LIBS=ON \
../src
# Compile
make
# Install
cd ..
cp ./build/lib/* ./install/lib
petsc/install.sh
#!/bin/bash
set -eu
## Constants
#
VER="3.7.6"
# Download source
$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
# Unpack source
tar -zxvf petsc-$VER.tar.gz
# Cleanup
rm -rf install src
mkdir install src
# Move source to 'src' directory
mv petsc-$VER/* src/
rm -rf petsc-$VER
# Configure
cd src
./config/configure.py \
--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
--with-mpi-dir="${ISSM_DIR}/externalpackages/mpich/install" \
--with-blas-lib="-L${ISSM_DIR}/externalpackages/lapack/install/lib -lblas" \
--with-lapack-lib="-L${ISSM_DIR}/externalpackages/lapack/install/lib -llapack" \
--with-debugging=0 \
--with-valgrind=0 \
--with-x=0 \
--with-ssl=0 \
--with-shared-libraries=1 \
--download-metis=1 \
--download-parmetis=1 \
--download-scalapack=1 \
--download-mumps=1
# Compile and install
if [ $# -eq 0 ]; then
make
make install
else
make -j $1
make -j $1 install
fi
boost/install.sh
#!/bin/bash
#set -eu
#unhook set -eu because some target do fail and it is not a big deal
#Note of caution: stop after boostrap phase, and run
#bjam --debug-configuration, to figure out which paths boost is using to include
#python. make sure everyone of these paths is covered by python. If not, just make
#symlinks in externalpackages/python to what boost is expecting. Ther is NO WAY
#to get the boost library to include python support without doing that.
#Some cleanup
rm -rf install boost_1_55_0 src
mkdir install src
#Download from ISSM server
$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
#Untar
tar -zxvf boost_1_55_0.tar.gz
#Move boost into install directory
mv boost_1_55_0/* src
rm -rf boost_1_55_0
#Setting CXXFLAGS to deal with C++11 incompatibility with Matlab's Boost
export CXXFLAGS='-std=c++98'
#Configure and compile
cd src
./bootstrap.sh \
--prefix="$ISSM_DIR/externalpackages/boost/install" \
--with-python=python2.7 \
--with-python-root="$ISSM_DIR/externalpackages/python/install"
#Compile boost
./bjam install
#put bjam into install also:
mkdir ../install/bin
cp bjam ../install/bin
zlib/install.sh
#!/bin/bash
set -eu
# Constants
#
VER="1.2.11"
# Download source
$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/zlib-${VER}.tar.gz" "zlib-${VER}.tar.gz"
# Unpack source
tar -zxvf zlib-$VER.tar.gz
# Cleanup
rm -rf install src
mkdir install src
# Move source to 'src' directory
mv zlib-$VER/* src/
rm -rf zlib-$VER
# Configure
cd src
./configure \
--prefix="${ISSM_DIR}/externalpackages/zlib/install"
# Compile and install
if [ $# -eq 0 ]; then
make
make install
else
make -j $1
make -j $1 install
fi
hdf5/install.sh
#!/bin/bash
set -eu
## Constants
#
VER="1.10.5"
ZLIB_ROOT="${ISSM_DIR}/externalpackages/zlib/install"
# Download source
$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/hdf5-${VER}.tar.gz" "hdf5-${VER}.tar.gz"
# Untar source
tar -zxvf hdf5-$VER.tar.gz
# Cleanup
rm -rf install src
mkdir install src
# Move source to 'src' directory
mv hdf5-$VER/* src/
rm -rf hdf5-$VER
# Configure
cd src
./configure \
--prefix="${ISSM_DIR}/externalpackages/hdf5/install" \
--with-zlib=${ZLIB_ROOT} \
--enable-hl
# Compile and install
#
if [ $# -eq 0 ]; then
make
make install
else
make -j $1
make -j $1 install
fi
curl/install.sh
#!/bin/bash
set -eu
## Constants
#
VER="7.67.0"
# Download source
$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/curl-${VER}.tar.gz" "curl-${VER}.tar.gz"
# Unpack source
tar -zxvf curl-$VER.tar.gz
# Cleanup
rm -rf install src
mkdir install src
# Move source to 'src' directory
mv curl-$VER/* src
rm -rf curl-$VER
# Configure
cd src
./configure \
--prefix="${ISSM_DIR}/externalpackages/curl/install" \
--disable-manual \
--disable-verbose
# Compile and install
if [ $# -eq 0 ]; then
make
make install
else
make -j $1
make -j $1 install
fi
netcdf/install.sh
#!/bin/bash
set -eu
# Dependencies
# - 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
#
# Constants
#
VER="4.7.2"
CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
HDF5_ROOT="${ISSM_DIR}/externalpackages/hdf5/install"
ZLIB_ROOT="${ISSM_DIR}/externalpackages/zlib/install"
# Environment
#
export CPPFLAGS="-I${HDF5_ROOT}/include -I${ZLIB_ROOT}/include -I${CURL_ROOT}/include"
export LDFLAGS="-L${HDF5_ROOT}/lib -L${ZLIB_ROOT}/lib -L${CURL_ROOT}/lib"
# 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-doxygen
# Compile and install
if [ $# -eq 0 ]; then
make
make install
else
make -j $1
make -j $1 install
fi
proj/install.sh
#!/bin/bash
set -eu
# Constants
#
VER="6.2.1"
## Environnment
#
# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
# requires,
#
# SQLITE3_LIBS="-lsqlite3".
#
# On Ubuntu Linux, install the SQLite3 binary, libraries and headers
# with,
#
# `apt-get install sqlite3 libsqlite3-dev`
#
export SQLITE3_LIBS="-lsqlite3"
# Cleanup
rm -rf install src
mkdir install src
# Download source
$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
# Unpack source
tar -zxvf proj-$VER.tar.gz
# Move source into 'src' directory
mv proj-$VER/* src
rm -rf proj-$VER
# Configure
cd src
./configure \
--prefix="${ISSM_DIR}/externalpackages/proj/install"
# Compile and install
if [ $# -eq 0 ]; then
make
make install
else
make -j $1
make -j $1 install
fi
gdal/install.sh
#!/bin/bash
set -eu
## TODO
# - May want to supply path to Python instead of, effectively, using result of `which python`
#
## Constants
#
VER="3.0.2"
HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
NETCDF_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
# Cleanup
rm -rf install src
mkdir install src
# Download source
$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
# Unpack source
tar -zxvf gdal-$VER.tar.gz
# Move source into 'src' directory
mv gdal-$VER/* src
rm -rf gdal-$VER
# Configure
cd src
./configure \
--prefix="${ISSM_DIR}/externalpackages/gdal/install" \
--with-python \
--with-hdf5="${HDF5_ROOT}" \
--with-netcdf="${NETCDF_ROOT}" \
--with-proj="${PROJ_ROOT}"
# Compile and install
if [ $# -eq 0 ]; then
make
make install
else
make -j $1
make -j $1 install
fi
gshhg/install.sh
#!/bin/bash
set -eu
## Constants
#
VER="2.3.4"
# Cleanup
rm -rf install
# Download source
$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gshhg-gmt-${VER}.tar.gz" "gshhg-gmt-${VER}.tar.gz"
# Unpack source
tar -zxvf gshhg-gmt-${VER}.tar.gz
# Install
mv gshhg-gmt-${VER} install
gmt/configs/5.1/linux/cmake/ConfigUser.cmake
#
# $Id: ConfigUserTemplate.cmake 12904 2014-02-17 20:52:35Z fwobbe $
#
# Copyright (c) 1991-2014 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
# 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: gmt.soest.hawaii.edu
# ----------------------------------------------------------------------------
# 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 svn:ignore property)
#
# 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.
# ============================================================================
# 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) [TRUE]:
#set (GMT_INSTALL_RELOCATABLE FALSE)
# ============================================================================
# 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 PDF and 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 path to GSHHG Shoreline Database [auto]:
set (GSHHG_ROOT "$ENV{ISSM_DIR}/externalpackages/gshhg/install")
# Copy GSHHG files to $/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 $/dcw [FALSE]:
#set (COPY_DCW TRUE)
# 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")
# 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/zlib/install")
##
## 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)
# 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):
#set (BUILD_SHARED_LIBS FALSE)
# Build GMT shared lib with supplemental modules [TRUE]:
#set (BUILD_SUPPLEMENTS 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)
# 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 gmtextension project).
#set (EXTRA_BUILD_DIRS apidemo)
# 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:
#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_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized") # check uninitialized variables
#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE) # debug link dependencies
#
# 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)
#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)
# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2
gmt/install.sh
#!/bin/bash
set -eu
# Constants
#
VER="5.1.1"
# 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 source customizations
cp configs/5.1/linux/cmake/ConfigUser.cmake src/cmake
# Configure
cd src
mkdir build
cd build
cmake ..
# Install
if [ $# -eq 0 ]; then
make install
else
make -j $1 install
fi
gmsh/install.sh
#!/bin/bash
set -eu
## Constants
#
VER="3.0.5"
# Cleanup
rm -rf install src
mkdir install src
# Download source
$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
# Untar source
tar -xvzf gmsh-$VER-source.tgz
# Move source to src directory
mv gmsh-$VER-source/* src
rm -rf gmsh-$VER-source
# Configure
cd install
cmake ../src \
-DCMAKE_INSTALL_PREFIX="$ISSM_DIR/externalpackages/gmsh/install" \
-DENABLE_MPI=1
# Compile and install
if [ $# -eq 0 ]; then
make
make install
else
make -j $1
make -j $1 install
fi
Configuration
Then, your configuration options would look something like,
--prefix=$ISSM_DIR \
--with-matlab-dir=$MATLAB_PATH \
--with-python-dir=/usr \
--with-python-numpy-dir=/usr/local/lib/python2.7/dist-packages/numpy \
--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/8 -lgfortran" \
--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include \
--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/mpich/install/lib -lmpi -lmpicxx -lmpifort" \
--with-blas-lapack-dir=$ISSM_DIR/externalpackages/lapack/install \
--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
--with-boost-dir=$ISSM_DIR/externalpackages/boost/install
Let me know if you run into any further issues.