source: issm/trunk-jpl/externalpackages/gdal/install-3-static.sh@ 27149

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

BUG: Correcting some static linking in distributables; syntax of sed call under Linux in packaging scripts

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/bash
2set -eu
3
4
5## TODO
6# - May want to supply path to Python instead of, effectively, using result of `which python`
7#
8
9## Constants
10#
11VER="3.1.1"
12
13## Environment
14#
15export CC=mpicc
16export CXX=mpicxx
17export LDFLAGS="-L${HDF5_ROOT}/lib" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
18export LIBS="-lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
19export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # NOTE: Need to export this to properly set destination root for Python libraries on macOS (should not affect Linux build). Set to location where external package should be installed.
20
21# Cleanup
22rm -rf ${PREFIX} src
23mkdir -p ${PREFIX} src
24
25# Download source
26$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
27
28# Unpack source
29tar -zxvf gdal-${VER}.tar.gz
30
31# Move source into 'src' directory
32mv gdal-${VER}/* src
33rm -rf gdal-${VER}
34
35# Configure
36cd src
37./configure \
38 --prefix="${PREFIX}" \
39 --enable-fast-install \
40 --disable-shared \
41 --without-ld-shared \
42 --enable-static \
43 --with-pic \
44 --with-curl="${CURL_ROOT}/bin/curl-config" \
45 --with-hdf5="${HDF5_ROOT}" \
46 --with-libz="${ZLIB_ROOT}" \
47 --with-netcdf="${NETCDF_ROOT}" \
48 --with-pg=no \
49 --with-proj="${PROJ_ROOT}"
50
51# Compile and install
52if [ $# -eq 0 ]; then
53 make
54 make install
55else
56 make -j $1
57 make -j $1 install
58fi
Note: See TracBrowser for help on using the repository browser.