Repository: incubator-singa Updated Branches: refs/heads/master f6cf8f5d6 -> 6fbc4e902
SINGA-302 - Extend the travis config for building SINGA on OSX Updated the .travis.yml file and added scripts in tool/travis folder. Test on osx and linux TODO: add conda scripts for building conda packages for SINGA on Travis (linux and osx). Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/6fbc4e90 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/6fbc4e90 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/6fbc4e90 Branch: refs/heads/master Commit: 6fbc4e90254b485027b6d6850e68d8529f629e67 Parents: f6cf8f5 Author: wangwei <wang...@comp.nus.edu.sg> Authored: Tue Feb 21 23:57:05 2017 +0800 Committer: Wei Wang <wang...@comp.nus.edu.sg> Committed: Wed Feb 22 15:23:13 2017 +0800 ---------------------------------------------------------------------- .travis.yml | 36 ++++++++++++++++++++---------------- tool/travis/build.sh | 32 ++++++++++++++++++++++++++++++++ tool/travis/conda.sh | 28 ++++++++++++++++++++++++++++ tool/travis/depends.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/6fbc4e90/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index 1516cca..c8d98fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,25 +15,29 @@ # limitations under the License. # - +# to use container for building sudo: required language: cpp -compiler: gcc -dist: trusty -before_install: - - sudo apt-get -qq update - - sudo apt-get install -qq -y libopenblas-dev libprotobuf-dev protobuf-compiler - - sudo apt-get install -qq -y opencl-headers ocl-icd-* -#- wget https://github.com/KhronosGroup/OpenCL-CLHPP/releases/download/v2.0.9/cl2.hpp -#- sudo mv cl2.hpp /usr/include/CL/ -#- sudo apt-get install -qq libgtest-dev +matrix: + include: + - os: osx + compiler: clang + osx_image: xcode7.3 + - os: linux + dist: trusty + compiler: gcc + +# +#addons: +# apt: +# packages: +# - libopenblas-dev +# - libprotobuf-dev +# - protobuf-compiler -before_script: - - mkdir build && cd build - - cmake .. -DUSE_CUDA=OFF -DUSE_CUDNN=OFF -DUSE_PYTHON=OFF +install: + - bash -ex tool/travis/depends.sh script: - - make - - ./bin/test_singa --gtest_output=xml:./../gtest.xml - + - bash -ex tool/travis/build.sh http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/6fbc4e90/tool/travis/build.sh ---------------------------------------------------------------------- diff --git a/tool/travis/build.sh b/tool/travis/build.sh new file mode 100644 index 0000000..3f13bce --- /dev/null +++ b/tool/travis/build.sh @@ -0,0 +1,32 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +if [[ "$TRAVIS_SECURE_ENV_VARS" == "false" ]]; +then + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; + then + export CMAKE_LIBRARY_PATH=/usr/local/opt/openblas/lib:$CMAKE_LIBRARY_PATH; + export CMAKE_INCLUDE_PATH=/usr/local/opt/openblas/include:$CMAKE_INCLUDE_PATH; + fi + mkdir build && cd build; + cmake -DUSE_CUDA=OFF -DUSE_PYTHON=OFF ..; + make; + ./bin/test_singa --gtest_output=xml:./../gtest.xml; +else + bash tool/travis/conda.sh; +fi http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/6fbc4e90/tool/travis/conda.sh ---------------------------------------------------------------------- diff --git a/tool/travis/conda.sh b/tool/travis/conda.sh new file mode 100644 index 0000000..6f961eb --- /dev/null +++ b/tool/travis/conda.sh @@ -0,0 +1,28 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# to build SINGA package and upload it to anaconda + +USER=nusdbsystem +OS=$TRAVIS_OS_NAME-64 + +mkdir ~/conda-bld +conda config --set anaconda_upload no +suffix=`TZ=Asia/Singapore date +%Y-%m-%d-%H-%M-%S` +export CONDA_BLD_PATH=~/conda-bld-$suffix +conda build tool/conda/ +anaconda -t $ANACONDA_UPLOAD_TOKEN upload -u $USER -l nightly $CONDA_BLD_PATH/$OS/singa-*.tar.bz2 --force http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/6fbc4e90/tool/travis/depends.sh ---------------------------------------------------------------------- diff --git a/tool/travis/depends.sh b/tool/travis/depends.sh new file mode 100644 index 0000000..8702c52 --- /dev/null +++ b/tool/travis/depends.sh @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +if [[ "$TRAVIS_SECURE_ENV_VARS" == "false" ]]; +then + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; + then + sudo apt-get -qq update; + sudo apt-get -qq -y install libopenblas-dev libprotobuf-dev protobuf-compiler; + else + brew update; + brew tap homebrew/science; + brew install openblas protobuf260; + fi +else + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; + then + wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; + else + wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh; + fi + bash miniconda.sh -b -p $HOME/miniconda + export PATH="$HOME/miniconda/bin:$PATH" + hash -r + conda config --set always_yes yes --set changeps1 no + conda update -q conda + conda install conda-build + conda install anaconda-client +fi