diff --git a/README.md b/README.md index 041f03b8a..0e5f9a8a7 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ For a description of our design decisions, see 2. sudo apt-get install git 3. git clone https://github.com/amplab/ray.git 4. cd ray -5. bash setup.sh +5. ./setup.sh diff --git a/setup.sh b/setup.sh old mode 100644 new mode 100755 index d0ef95df9..61bee8917 --- a/setup.sh +++ b/setup.sh @@ -1,15 +1,49 @@ -sudo apt-get update -sudo apt-get install -y git cmake build-essential autoconf libtool python-dev python-numpy python-pip libboost-all-dev unzip +#!/bin/bash + +platform="unknown" +unamestr=`uname` +if [[ "$unamestr" == "Linux" ]]; then + echo "Platform is linux." + platform="linux" +elif [[ "$unamestr" == "Darwin" ]]; then + echo "Platform is macosx." + platform="macosx" +else + echo "Unrecognized platform." + exit 1 +fi + +if [[ $platform == "macosx" ]]; then + # check that brew is installed + which -s brew + if [[ $? != 0 ]]; then + echo "Could not find brew, please install brew (see http://brew.sh/)." + exit 1 + else + echo "Updating brew." + brew update + fi +fi + + +if [[ $platform == "linux" ]]; then + sudo apt-get update + sudo apt-get install -y git cmake build-essential autoconf libtool python-dev python-numpy python-pip libboost-all-dev unzip +elif [[ $platform == "macosx" ]]; then + brew install git cmake autoconf libtool boost + sudo easy_install pip + sudo pip install numpy +fi sudo pip install -r requirements.txt cd thirdparty -bash download_thirdparty.sh -bash build_thirdparty.sh +./download_thirdparty.sh +./build_thirdparty.sh cd numbuf cd python sudo python setup.py install mkdir -p ../../../build cd ../../../build cmake .. -sudo make install +make install cd ../lib/python sudo python setup.py install diff --git a/thirdparty/build_thirdparty.sh b/thirdparty/build_thirdparty.sh old mode 100644 new mode 100755 diff --git a/thirdparty/download_thirdparty.sh b/thirdparty/download_thirdparty.sh old mode 100644 new mode 100755