From 2b98fbe86c2d539fafa7613fe523161cc8a66e71 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Fri, 15 Jan 2021 17:01:01 +0100 Subject: [PATCH] OSX working again on GitHub actions - Fix CI (#1840) --- scripts/osx/install_brew.sh | 3 ++- scripts/osx/install_deps.sh | 23 +++++++++++++++-------- scripts/travis/install_deps_osx.sh | 7 +++++-- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/scripts/osx/install_brew.sh b/scripts/osx/install_brew.sh index f5b7628e..b2789338 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 f794506b..3d53d406 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 8779622e..c1430497 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 -- GitLab