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
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#
[27541]11VER="3.5.3"
[25745]12
13## Environment
14#
15export CC=mpicc
[27541]16export CXXFLAGS="-std=c++11"
[25745]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
[27565]19export LIBS="-lsqlite3 -lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
[25860]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.
[25745]21
22# Cleanup
[25860]23rm -rf ${PREFIX} src
24mkdir -p ${PREFIX} src
[25745]25
26# Download source
[25967]27$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
[25745]28
29# Unpack source
[25860]30tar -zxvf gdal-${VER}.tar.gz
[25745]31
32# Move source into 'src' directory
[25860]33mv gdal-${VER}/* src
34rm -rf gdal-${VER}
[25745]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 \
[27149]45 --with-curl="${CURL_ROOT}/bin/curl-config" \
46 --with-hdf5="${HDF5_ROOT}" \
[27152]47 --with-jpeg=internal \
[25745]48 --with-libz="${ZLIB_ROOT}" \
49 --with-netcdf="${NETCDF_ROOT}" \
[27152]50 --with-pcre=no \
[27149]51 --with-pg=no \
[27152]52 --with-png=internal \
53 --with-proj="${PROJ_ROOT}" \
54 --with-zstd=no
[25745]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.