Skip to content

Instantly share code, notes, and snippets.

@mprentice
Created June 5, 2013 01:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mprentice/5710992 to your computer and use it in GitHub Desktop.
Save mprentice/5710992 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Currently works for Mac OS X 10.8: Mountain Lion
set -e
venvbin="`which virtualenv`"
if [ "$venvbin" = "" ] ; then
echo "Aborting (cannot find virtualenv)" >&2
exit 1;
fi
brewbin="`which brew`"
swigbin="`which swig`"
if [ "$swigbin" = "" ] ; then
if [ "$brewbin" = "" ] ; then
echo "Aborting (cannot find swig or homebrew)" >&2
exit 1;
fi
"$brewbin" install swig
fi
fortranbin="`which gfortran`" || true
fortranver="`\"$fortranbin\" --version | head -1`"
if [[ ! "$fortranver" =~ " 4\\.2" ]] ; then
if [ "$brewbin" = "" ] ; then
echo "Aborting (cannot find homebrew)" >&2
exit 1;
fi
gforver="4.2.4-5666.3"
echo "Switching to gfortran $gforver for scipy ..."
"$brewbin" switch gfortran $gforver
fi
if [ ! -d VIRT ] ; then
"$venvbin" VIRT
fi
source VIRT/bin/activate
pip install numpy
pip install Cython
pip install -e git+https://github.com/scipy/scipy#egg=scipy-dev
pip install git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib-dev
easy_install readline
pip install ipython
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment