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

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

CHG: Various fixes for static and shared versions of ext pkg install scripts; fixing EsaGRACE example

  • Property svn:executable set to *
File size: 1.6 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.5.3"
12
13## Environment
14#
15export CC=mpicc
16export CXXFLAGS="-std=c++11"
17export CXX=mpicxx
18export LDFLAGS="-L${HDF5_ROOT}/lib" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
19export LIBS="-lsqlite3 -lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
20export 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.
21
22# Cleanup
23rm -rf ${PREFIX} src
24mkdir -p ${PREFIX} src
25
26# Download source
27$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
28
29# Unpack source
30tar -zxvf gdal-${VER}.tar.gz
31
32# Move source into 'src' directory
33mv gdal-${VER}/* src
34rm -rf gdal-${VER}
35
36# Configure
37cd src
38./configure \
39 --prefix="${PREFIX}" \
40 --enable-fast-install \
41 --disable-shared \
42 --without-ld-shared \
43 --enable-static \
44 --with-pic \
45 --with-curl="${CURL_ROOT}/bin/curl-config" \
46 --with-hdf5="${HDF5_ROOT}" \
47 --with-jpeg=internal \
48 --with-libz="${ZLIB_ROOT}" \
49 --with-netcdf="${NETCDF_ROOT}" \
50 --with-pcre=no \
51 --with-pg=no \
52 --with-png=internal \
53 --with-proj="${PROJ_ROOT}" \
54 --with-zstd=no
55
56# Compile and install
57if [ $# -eq 0 ]; then
58 make
59 make install
60else
61 make -j $1
62 make -j $1 install
63fi
Note: See TracBrowser for help on using the repository browser.