forked from igfuw/libmpdataxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
171 lines (137 loc) · 7.24 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
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=pbl
- TEST_SUITE=osx_local_clang
- TEST_SUITE=UWLCM_MT
- TEST_SUITE=UWLCM_unit_iles
- TEST_SUITE=UWLCM_unit_smg
matrix:
exclude:
- os: osx
compiler: gcc
- os: osx
env: TEST_SUITE=pbl # pbl not tested on osx
- compiler: clang
env: TEST_SUITE=UWLCM_MT
- compiler: clang
env: TEST_SUITE=UWLCM_unit_iles
- compiler: clang
env: TEST_SUITE=UWLCM_unit_smg
# local clang tests on osx
- os: linux
env: TEST_SUITE=osx_local_clang
- compiler: gcc
env: TEST_SUITE=osx_local_clang
addons:
apt:
packages:
- g++-6
- clang-4.0
- boost1.61
sources: &sources
- sourceline: 'ppa:rakhimov/boost'
- 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
# Seems like this is now done by Travis, but leaving it (commented out) for now
#- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew cask uninstall oclint; fi
# needed to get rvm, see below
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then \curl -sSL https://get.rvm.io | bash -s -- --branch stable; fi
# https://github.com/travis-ci/travis-ci/issues/10165
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm reload; fi
# locally installed stuff comes first
- export PATH=/usr/local/bin:$PATH
# fixing broken OSX gzip tools
- 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
# downloads and setups local clang on osx
- if [[ $TEST_SUITE == 'osx_local_clang' ]]; then . ./.travis_scripts/setup_local_clang.sh; fi
# latest boost is installed using addons functionality
# cmake
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then wget https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.sh; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo sh cmake-3.13.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir; 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; 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
# UWLCM
- if [[ $TEST_SUITE == 'UWLCM_MT' ]]; then . ./.travis_scripts/UWLCM.sh moist_thermal; fi
- if [[ $TEST_SUITE == 'UWLCM_unit_iles' ]]; then . ./.travis_scripts/UWLCM.sh unit_iles; fi
- if [[ $TEST_SUITE == 'UWLCM_unit_smg' ]]; then . ./.travis_scripts/UWLCM.sh unit_smg; fi
# 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
# testing local clang on osx
- if [[ $TEST_SUITE == 'osx_local_clang' ]]; then . ./.travis_scripts/unit.sh; fi # with '.' to pass env vars