source: trunk/anuga_core/tools/install_conda.sh @ 9712

Last change on this file since 9712 was 9712, checked in by steve, 9 years ago

Error in comparison in travis.yml

File size: 2.3 KB
Line 
1#!/bin/bash
2# This script is meant to be called by the "install" step defined in
3# .travis.yml. See http://docs.travis-ci.com/ for more details.
4# The behavior of the script is controlled by environment variabled defined
5# in the .travis.yml in the top level folder of the project.
6
7# License: 3-clause BSD
8
9
10set -e
11
12
13[ -z "$PYTHON_VERSION" ] && PYTHON_VERSION="2.7"
14[ -z "$PARALLEL" ] && PARALLEL="mpich2"
15
16sudo apt-get update -q
17sudo apt-get install gfortran
18
19##########################################################
20# Setup various versions of MPI
21if [[ "$PARALLEL" == "mpich2" ]]; then
22    sudo apt-get -y install mpich2;
23fi
24
25if [[ "$PARALLEL" == "openmpi" ]]; then
26    sudo apt-get install -y libopenmpi-dev openmpi-bin;
27fi
28
29
30##########################################################
31
32# Deactivate the travis-provided virtual environment and setup a
33# conda-based environment instead
34deactivate || echo "deactivate failed"
35
36# Use the miniconda installer for faster download
37# install of conda itself
38wget http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh \
39    -O miniconda.sh
40chmod +x miniconda.sh && ./miniconda.sh -b
41
42export PATH=$HOME/miniconda/bin:$PATH
43conda update --yes conda
44
45# Configure the conda environment and put it in the path using the
46# provided versions
47conda create -n anuga_env --yes python=$PYTHON_VERSION pip numpy scipy netcdf4 \
48    nose matplotlib
49source activate anuga_env
50
51# python 2.6 doesn't have argparse by default
52if [[ "$PYTHON_VERSION" == "2.6" ]]; then conda install --yes argparse; fi
53
54if [[ "$PYTHON_VERSION" == "2.7" ]]; then
55    conda install --yes -c pingucarsti gdal
56fi
57
58if [[ "$PYTHON_VERSION" == "2.6" ]]; then
59    conda install --yes  gdal geos
60fi
61
62export GDAL_DATA=`gdal-config --datadir`;
63
64# Install more software to deal with geographical projections
65pip install pyproj
66
67# Install pypar if parallel set
68if [[ "$PARALLEL" == "mpich2" || "$PARALLEL" == "openmpi" ]]; then
69    git clone https://github.com/daleroberts/pypar.git;
70    pushd pypar;
71    python setup.py install;
72    popd;
73fi
74
75# Useful for debugging any issues with conda
76conda info -a
77
78########################################################
79if [[ "$COVERAGE" == "--coverage" ]]; then
80    pip install coverage coveralls
81fi
82
83########################################################
84# build and install anuga
85
86python setup.py build
87python setup.py install
Note: See TracBrowser for help on using the repository browser.