diff --git a/scripts/osx/install_brew.sh b/scripts/osx/install_brew.sh index f5b7628e65f4259521e9ec2b1c962cc59122492f..b278933829b4a2704aa48528756a062559cbaa6b 100755 --- a/scripts/osx/install_brew.sh +++ b/scripts/osx/install_brew.sh @@ -1,3 +1,4 @@ -xcode-select --install +# In case the command line have already been installed, "true" will make it return a non-zero error code to avoid stopping the scripts +xcode-select --install || true bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" brew update diff --git a/scripts/osx/install_deps.sh b/scripts/osx/install_deps.sh index f794506b7ebf113c35eb0922be8b0f6c0e01c2a0..3d53d4062d16049a5f3ccd5f5a3a82e78ce50e66 100755 --- a/scripts/osx/install_deps.sh +++ b/scripts/osx/install_deps.sh @@ -1,12 +1,19 @@ -brew install openblas -brew install -vd snappy leveldb gflags glog szip lmdb -brew install hdf5 opencv +#!/bin/bash +brew_packages="openblas snappy leveldb gflags glog szip lmdb hdf5 opencv protobuf boost cmake viennacl" +for pkg in $brew_packages +do + echo "brew install $pkg || brew upgrade $pkg" + brew install "$pkg" || brew upgrade "$pkg" +done + # with Python pycaffe needs dependencies built from source #brew install --build-from-source --with-python -vd protobuf #brew install --build-from-source -vd boost boost-python # without Python the usual installation suffices -brew install protobuf boost -brew install cmake -brew install viennacl -sudo pip install numpy -sudo pip install opencv-python + +pip_packages="numpy<1.17 opencv-python<4.3" +for pkg in $pip_packages +do + echo "sudo -H python2 -m pip install $pkg" + sudo -H python2 -m pip install "$pkg" +done diff --git a/scripts/travis/install_deps_osx.sh b/scripts/travis/install_deps_osx.sh index 8779622e4fc50a588bf40f4052576e4bcf0454a1..c1430497db160653f524ed5d2df78f6ee0641e9a 100755 --- a/scripts/travis/install_deps_osx.sh +++ b/scripts/travis/install_deps_osx.sh @@ -6,5 +6,8 @@ echo "Running on Mac OS." BASEDIR=$(dirname $0) source $BASEDIR/defaults.sh -bash scripts/osx/install_brew.sh -bash scripts/osx/install_deps.sh +# To fix linking issue in CI during install of python as dep of opencv +[[ -f /usr/local/bin/2to3 ]] && rm -f /usr/local/bin/2to3 + +source ./scripts/osx/install_brew.sh +source ./scripts/osx/install_deps.sh