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

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

BUG: Reverting to previous working version of GDAL

  • Property svn:executable set to *
File size: 1.5 KB
RevLine 
[25745]1#!/bin/bash
2set -eu
3
4
[25860]5## TODO
6# - May want to supply path to Python instead of, effectively, using result of `which python`
[25745]7#
8
9## Constants
10#
[27364]11VER="3.1.1"
[25745]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
[25860]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.
[25745]20
21# Cleanup
[25860]22rm -rf ${PREFIX} src
23mkdir -p ${PREFIX} src
[25745]24
25# Download source
[25967]26$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
[25745]27
28# Unpack source
[25860]29tar -zxvf gdal-${VER}.tar.gz
[25745]30
31# Move source into 'src' directory
[25860]32mv gdal-${VER}/* src
33rm -rf gdal-${VER}
[25745]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 \
[27149]44 --with-curl="${CURL_ROOT}/bin/curl-config" \
45 --with-hdf5="${HDF5_ROOT}" \
[27152]46 --with-jpeg=internal \
[25745]47 --with-libz="${ZLIB_ROOT}" \
48 --with-netcdf="${NETCDF_ROOT}" \
[27152]49 --with-pcre=no \
[27149]50 --with-pg=no \
[27152]51 --with-png=internal \
52 --with-proj="${PROJ_ROOT}" \
53 --with-zstd=no
[25745]54
55# Compile and install
56if [ $# -eq 0 ]; then
57 make
58 make install
59else
60 make -j $1
61 make -j $1 install
62fi
Note: See TracBrowser for help on using the repository browser.