Changeset 25836 for issm/trunk/externalpackages/netcdf-python/install.sh
- Timestamp:
- 12/08/20 08:45:53 (4 years ago)
- Location:
- issm/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
-
issm/trunk/externalpackages/netcdf-python/install.sh
r24313 r25836 2 2 set -eu 3 3 4 #Some cleanup5 rm -rf install netCDF4-1.06 mkdir install7 4 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 # 7 VER="1.5.3" 10 8 11 #Untar 12 tar -zxvf netCDF4-1.0.tar.gz 9 # Environment 10 # 11 export HDF5_DIR="${ISSM_DIR}/externalpackages/petsc/install" 12 export MPIINC_DIR="${ISSM_DIR}/externalpackages/petsc/install/include" 13 export NETCDF_DIR="${ISSM_DIR}/externalpackages/netcdf/install" 14 export 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) 13 15 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" 18 18 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 20 tar -zxvf netcdf4-python-${VER}rel.tar.gz 23 21 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 23 rm -rf install src 24 mkdir install src 28 25 29 python setup.py build 30 python setup.py install 26 # Move source to 'src' directory 27 mv netcdf4-python-${VER}rel/* src/ 28 rm -rf netcdf4-python-${VER}rel 29 30 # Compile and install 31 cd src 32 python setup.py build 33 python setup.py install --user 34 35 # Unzip eggs 36 for 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} 43 done
Note:
See TracChangeset
for help on using the changeset viewer.