source: issm/trunk-jpl/externalpackages/gmt/install-6-linux.sh@ 25860

Last change on this file since 25860 was 25860, checked in by jdquinn, 4 years ago

CHG: Simplification of installation script customization needs: should be able to simply set PREFIX in most cases

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/bash
2set -eu
3
4
5## Constants
6#
7VER="6.0.0"
8
9# Environment
10#
11export CC=mpicc
12export PREFIX="${ISSM_DIR}/externalpackages/gmt/install" # NOTE: Need to export this to be picked up by customized ConfigUser.cmake (see below). Set to location where external package should be installed.
13
14# Download source
15$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmt-${VER}.tar.gz" "gmt-${VER}.tar.gz"
16
17# Unpack source
18tar -zxvf gmt-${VER}.tar.gz
19
20# Cleanup
21rm -rf ${PREFIX} src
22mkdir -p ${PREFIX} src
23
24# Move source to 'src' directory
25mv gmt-${VER}/* src
26rm -rf gmt-${VER}
27
28# Copy custom configuration files
29cp ./configs/6/cmake/ConfigUser.cmake ./src/cmake
30
31# Configure
32cd src
33mkdir build
34cd build
35
36# NOTE:
37# - There is a CMake variable named CURL_ROOT in src/cmake/ConfigUser.cmake
38# that, ostensibly, allows for supplying the path to curl when it is in a
39# non-standard location. That said, newer versions of CMake will ignore said
40# variable and instead try to find curl itself. Passing in the two options
41# below overrides this behavior.
42#
43cmake \
44 -DCURL_LIBRARY="${CURL_ROOT}/lib" \
45 -DCURL_INCLUDE_DIR="${CURL_ROOT}/include" \
46 ..
47
48# Compile and install
49if [ $# -eq 0 ]; then
50 make
51 make install
52else
53 make -j $1
54 make -j $1 install
55fi
Note: See TracBrowser for help on using the repository browser.