Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
145 lines (113 sloc) 6.07 KB
language: cpp
os:
- linux
- osx
dist: trusty
compiler:
- gcc
- clang
env:
- TEST_SUITE=unit
- TEST_SUITE=sandbox
- TEST_SUITE=paper
- TEST_SUITE=elliptic_drop
- TEST_SUITE=nair_jablonowski_2008
- TEST_SUITE=UWLCM
- TEST_SUITE=pbl
matrix:
exclude:
- os: osx
compiler: gcc
- os: osx
env: TEST_SUITE=pbl # pbl not tested on osx
- compiler: clang
env: TEST_SUITE=UWLCM # UWLCM is not tested on clang yet
addons:
apt:
packages:
- g++-6
- clang-4.0
sources: &sources
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
before_install:
# define a compiler variable for use in if statements
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'clang++' ]]; then export COMPILER=clang++; fi
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'g++' ]]; then export COMPILER=g++; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export COMPILER=clang++; fi # only clang on osx
# to avoid python lib/interpreter mismatch; https://github.com/travis-ci/travis-ci/issues/5326
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse"; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t trusty -y"; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi
# Workaround for upgrading gcc, see https://github.com/travis-ci/travis-ci/issues/8826
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew cask uninstall oclint; fi
# https://github.com/travis-ci/travis-ci/issues/10165
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm get stable; fi
# fixing broken OSX gzip tools
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export PATH=/usr/local/bin:$PATH; fi # so that brew-installed ones are first
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gzip; fi
# to avoid problems with plotting by paraview on Travis
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then unset DISPLAY; fi
# you may not believe it, but GCC (4.8.2) is giving ICEs otherwise!
- export make_j="make -j 2"
- if [[ $COMPILER == 'g++' ]]; then export make_j="make"; fi
# testing both Python 2 and 3 on Linux (unrelated to compiler choice!)
- export PY3DEB=""
- if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then PY3DEB=3; fi
- if [[ $PY3DEB != '' ]]; then sudo apt-get install python3-dev; fi
# upgrade pip
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install --upgrade pip; fi
install:
# silence the gazillion warnings coming from blitz headers when using the osx clang
- if [[ $TRAVIS_OS_NAME == 'osx' && $COMPILER == 'clang++' ]]; then export CXXFLAGS="-Wno-parentheses ${CXXFLAGS}"; fi
# redefine CXX to the actual version used
- if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'clang++' ]]; then export CXX=clang++-4.0; fi
- if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then export CXX=g++-6; fi
# boost
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost1.55-all-dev; fi
# cmake
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install cmake; fi
# blitz
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install blitz; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libblitz0-dev; fi
# hdf5
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" libpango-1.0-0 libpangocairo-1.0-0 libhdf5-dev; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install hdf5-tools; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install hdf5 --with-cxx; fi
# gnuplot-iostream
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install gnuplot-nox; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gnuplot; fi
- sudo wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h
# h5py
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-h5py; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install h5py; fi
# scipy
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-scipy; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install scipy; fi
# matplotlib
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-matplotlib; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install matplotlib; fi
# make Python 3 the default if requested
- if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi
script:
# libmpdata++
- cd libmpdata++
- mkdir build
- cd build
- cmake ..
- cd ../..
# compiling and running all unit tests in Debug & Release modes
- if [[ $TEST_SUITE == 'unit' ]]; then . ./.travis_scripts/unit.sh; fi
# compiling and running selected paper tests in Debug mode
- if [[ $TEST_SUITE == 'paper' ]]; then . ./.travis_scripts/paper.sh; fi
# compiling all sandbox tests in Release mode
- if [[ $TEST_SUITE == 'sandbox' ]]; then . ./.travis_scripts/sandbox.sh; fi
- if [[ $TEST_SUITE == 'elliptic_drop' ]]; then . ./.travis_scripts/elliptic_drop.sh; fi
# running tests from UWLCM in Release mode
- if [[ $TEST_SUITE == 'UWLCM' ]]; then . ./.travis_scripts/UWLCM.sh; fi # with '.' to pass env vars
# compiling and running tests from Nair & Jablonowski 2008 MWR paper in Release mode
- if [[ $TEST_SUITE == 'nair_jablonowski_2008' ]]; then . ./.travis_scripts/nair_jablonowski_2008.sh; fi
# running pbl tests in Release mode
- if [[ $TEST_SUITE == 'pbl' ]]; then . ./.travis_scripts/pbl.sh; fi