Ignore:
Timestamp:
12/08/20 08:45:53 (4 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 25834

Location:
issm/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/externalpackages/netcdf-python/install.sh

    r24313 r25836  
    22set -eu
    33
    4 #Some cleanup
    5 rm -rf install netCDF4-1.0
    6 mkdir install
    74
    8 #Download from ISSM server
    9 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netCDF4-1.0.tar.gz" "netCDF4-1.0.tar.gz"
     5# Constants
     6#
     7VER="1.5.3"
    108
    11 #Untar
    12 tar -zxvf  netCDF4-1.0.tar.gz
     9# Environment
     10#
     11export HDF5_DIR="${ISSM_DIR}/externalpackages/petsc/install"
     12export MPIINC_DIR="${ISSM_DIR}/externalpackages/petsc/install/include"
     13export NETCDF_DIR="${ISSM_DIR}/externalpackages/netcdf/install"
     14export PYTHONUSERBASE="${ISSM_DIR}/externalpackages/netcdf-python/install" # This variable and '--user' option supplied to 'setup.py install' are required to install to custom location (source: https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations)
    1315
    14 #for later:
    15 rm -rf ISSMDIR
    16 echo $ISSM_DIR | sed 's/\//\\\//g' > ISSMDIR
    17 ISSMDIR=`cat ISSMDIR` && rm -rf ISSMDIR
     16# Download source
     17$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf4-python-${VER}rel.tar.gz" "netcdf4-python-${VER}rel.tar.gz"
    1818
    19 #Move netCDF4 to install directory
    20 rm -rf install/*
    21 mv netCDF4-1.0/* install/
    22 rm -rf netCDF4-1.0
     19# Unpack source
     20tar -zxvf netcdf4-python-${VER}rel.tar.gz
    2321
    24 #Configur and compile
    25 cd install
    26 #edit setup.cfg to point to hdf5 and netcdf
    27 cat setup.cfg.template  | sed "s/\#netCDF4_dir = \/usr\/local/netCDF4_dir = $ISSMDIR\/externalpackages\/netcdf\/install/g"  | sed "s/\#HDF5_dir = \/usr\/local/HDF5_DIR = $ISSMDIR\/externalpackages\/hdf5\/install/g" > setup.cfg
     22# Cleanup
     23rm -rf install src
     24mkdir install src
    2825
    29 python setup.py build
    30 python setup.py install
     26# Move source to 'src' directory
     27mv netcdf4-python-${VER}rel/* src/
     28rm -rf netcdf4-python-${VER}rel
     29
     30# Compile and install
     31cd src
     32python setup.py build
     33python setup.py install --user
     34
     35# Unzip eggs
     36for egg in $(find "${PYTHONUSERBASE}/lib" -name *.egg); do
     37        parent_dir=$(dirname ${egg})
     38        filename=$(basename -- ${egg})
     39        extension="${filename##*.}"
     40        filename="${filename%.*}"
     41        src_dir="${parent_dir}/${filename}"
     42        unzip ${egg} -d ${src_dir}
     43done
Note: See TracChangeset for help on using the changeset viewer.