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

Last change on this file since 27406 was 27406, checked in by jdquinn, 2 years ago

CHG: Print message that we’re looking for libgfortran; new patch file for latest version of Gmsh; testing if we still need patch file for Gmsh static

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