|
Last change
on this file since 26744 was 26744, checked in by Mathieu Morlighem, 4 years ago |
|
merged trunk-jpl and trunk for revision 26742
|
-
Property svn:executable
set to
*
|
|
File size:
1.7 KB
|
| Line | |
|---|
| 1 | #!/bin/bash
|
|---|
| 2 | set -eu
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 | # Dependencies
|
|---|
| 6 | # - MPI implementation (for parallel I/O support)
|
|---|
| 7 | # - hdf5 (1.8.9 / 1.10.1 or later, for netCDF-4 support)
|
|---|
| 8 | # - zlib (1.2.5 or later, for netCDF-4 compression)
|
|---|
| 9 | # - curl (7.18.0 or later, for DAP remote access client support)
|
|---|
| 10 | #
|
|---|
| 11 | # Sources:
|
|---|
| 12 | # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
|
|---|
| 13 | #
|
|---|
| 14 | # NOTE:
|
|---|
| 15 | # - Certain configuration tests fail if libraries are not supplied explicitly
|
|---|
| 16 | #
|
|---|
| 17 | # TODO:
|
|---|
| 18 | # - Compile and link curl statically (issue with DAP and system libs on macOS
|
|---|
| 19 | # with more restirctive Gatekeeper; see also --disable-dap option in
|
|---|
| 20 | # configuration)
|
|---|
| 21 | #
|
|---|
| 22 |
|
|---|
| 23 | # Constants
|
|---|
| 24 | #
|
|---|
| 25 | VER="4.7.2"
|
|---|
| 26 |
|
|---|
| 27 | PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
|
|---|
| 28 |
|
|---|
| 29 | # Environment
|
|---|
| 30 | #
|
|---|
| 31 | export CC=mpicc
|
|---|
| 32 | export CPPFLAGS="-I${ZLIB_ROOT}/include"
|
|---|
| 33 |
|
|---|
| 34 | export HDF5LIB="${HDF5_ROOT}/lib/libhdf5_hl.a ${HDF5_ROOT}/lib/libhdf5.a"
|
|---|
| 35 | export ZLIB="${ZLIB_ROOT}/lib/libz.a"
|
|---|
| 36 |
|
|---|
| 37 | # Download source
|
|---|
| 38 | $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
|
|---|
| 39 |
|
|---|
| 40 | # Unpack source
|
|---|
| 41 | tar -zxvf netcdf-c-${VER}.tar.gz
|
|---|
| 42 |
|
|---|
| 43 | # Cleanup
|
|---|
| 44 | rm -rf ${PREFIX} src
|
|---|
| 45 | mkdir -p ${PREFIX} src
|
|---|
| 46 |
|
|---|
| 47 | # Move source to 'src' directory
|
|---|
| 48 | mv netcdf-c-${VER}/* src
|
|---|
| 49 | rm -rf netcdf-c-${VER}
|
|---|
| 50 |
|
|---|
| 51 | # Configure
|
|---|
| 52 | cd src
|
|---|
| 53 | ./configure \
|
|---|
| 54 | --prefix="${PREFIX}" \
|
|---|
| 55 | --disable-shared \
|
|---|
| 56 | --disable-dependency-tracking \
|
|---|
| 57 | --enable-fast-install \
|
|---|
| 58 | --disable-doxygen \
|
|---|
| 59 | --enable-netcdf4 \
|
|---|
| 60 | --disable-dap \
|
|---|
| 61 | --disable-testsets \
|
|---|
| 62 | --disable-examples \
|
|---|
| 63 | --disable-filter-testing
|
|---|
| 64 |
|
|---|
| 65 | # Compile and install
|
|---|
| 66 | if [ $# -eq 0 ]; then
|
|---|
| 67 | make
|
|---|
| 68 | make install
|
|---|
| 69 | else
|
|---|
| 70 | make -j $1
|
|---|
| 71 | make -j $1 install
|
|---|
| 72 | fi
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.