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

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

CHG: Jenkins config for new Intel-based Mac Mini; cleanup

  • Property svn:executable set to *
File size: 1.7 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="-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# Apply patches to source
37patch src/frmts/vrt/pixelfunctions.cpp < configs/3/frmts/vrt/pixelfunctions.cpp.patch
38
39# Configure
40cd src
41./configure \
42 --prefix="${PREFIX}" \
43 --enable-fast-install \
44 --disable-shared \
45 --without-ld-shared \
46 --enable-static \
47 --with-pic \
48 --with-curl="${CURL_ROOT}/bin/curl-config" \
49 --with-hdf5="${HDF5_ROOT}" \
50 --with-jpeg=internal \
51 --with-libz="${ZLIB_ROOT}" \
52 --with-netcdf="${NETCDF_ROOT}" \
53 --with-pcre=no \
54 --with-pg=no \
55 --with-png=internal \
56 --with-proj="${PROJ_ROOT}" \
57 --with-zstd=no
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
Note: See TracBrowser for help on using the repository browser.