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

Last change on this file since 27202 was 27202, checked in by jdquinn, 3 years ago

CHG: Varied clean up

  • Property svn:executable set to *
File size: 1.8 KB
RevLine 
[25745]1#!/bin/bash
2set -eu
3
4
5## Constants
6#
[27202]7VER="6.4.0"
[25745]8
[27202]9# Find libgfortran so that we do not have to hardcode it.
10#
11# TODO:
12# - Move this to etc/environment.sh
13#
14LIBGFORTRAN=$(find /usr -name libgfortran* | egrep -n libgfortran.a | sed "s/[0-9]*://g" | head -1)
15LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
16
[25745]17# Environment
18#
19export CC=mpicc
[25860]20export 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.
[25745]21
22# Download source
23$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmt-${VER}.tar.gz" "gmt-${VER}.tar.gz"
24
25# Unpack source
26tar -zxvf gmt-${VER}.tar.gz
27
28# Cleanup
[25860]29rm -rf ${PREFIX} src
30mkdir -p ${PREFIX} src
[25745]31
32# Move source to 'src' directory
33mv gmt-${VER}/* src
34rm -rf gmt-${VER}
35
36# Copy custom configuration files
[26246]37cp ./configs/6/linux/cmake/ConfigUser.cmake ./src/cmake
[25745]38
39# Configure
40cd src
41mkdir build
42cd build
43
44# NOTE:
45# - There is a CMake variable named CURL_ROOT in src/cmake/ConfigUser.cmake
46# that, ostensibly, allows for supplying the path to curl when it is in a
47# non-standard location. That said, newer versions of CMake will ignore said
48# variable and instead try to find curl itself. Passing in the two options
49# below overrides this behavior.
50#
51cmake \
[27202]52 -DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib;-lfblas;-L${LIBGFORTRAN_ROOT};-lgfortran" \
[25745]53 -DCURL_INCLUDE_DIR="${CURL_ROOT}/include" \
[27202]54 -DCURL_LIBRARY="-L${CURL_ROOT}/lib;-lcurl" \
55 -DLAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib;-lflapack;-L${LIBGFORTRAN_ROOT};-lgfortran" \
[25745]56 ..
57
58# Compile and install
59if [ $# -eq 0 ]; then
60 make
61 make install
62else
63 make -j $1
64 make -j $1 install
65fi
[25989]66
67# Make necessary link on RHEL
68if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
69 cd ${PREFIX}
70 ln -s ./lib64 ./lib
71fi
Note: See TracBrowser for help on using the repository browser.