Skip to content

Instantly share code, notes, and snippets.

@cpelley
Last active September 26, 2016 13:07
Show Gist options
  • Save cpelley/5a89f44cf9288308be3f to your computer and use it in GitHub Desktop.
Save cpelley/5a89f44cf9288308be3f to your computer and use it in GitHub Desktop.
Conda Iris user build script
# THE FOLLOWING SCRIPT IS TO BE PLACED AND RUN IN THE DOWNLOADED
# IRIS SOURCE DIRECTORY - https://github.com/SciTools/iris
#
# The script is for simply installing iris. For iris development
# see: https://gist.github.com/cpelley/35020289a28253116a82
#
# Assumes user is working with conda, if not please change
# 'ENVIRONMENT_PATH' to point to the directory of your choosen
# python interpreter.
set -e
# By default the Python environment is populated with an activated
# conda environment path (similarly the path to any path could be
# specified here).
ENVIRONMENT_PATH=${CONDA_PREFIX}
# Clean the subfolders
if [[ -f .git ]]; then
git clean -xdf docs/
git clean -xdf lib/
fi
# Create site config
cat > lib/iris/etc/site.cfg <<EOL
[System]
udunits2_path = ${ENVIRONMENT_PATH}/lib/libudunits2.so
EOL
# Build Iris
python setup.py --with-unpack build_ext --include-dirs=${ENVIRONMENT_PATH}/include --library-dirs=${ENVIRONMENT_PATH}/lib --rpath=${ENVIRONMENT_PATH}/lib
python setup.py --with-unpack build
python setup.py --with-unpack install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment