forked from broeckho/stride
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
191 lines (169 loc) · 7.11 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# HEAD
language: cpp
dist: xenial
env:
global:
secure: EROUAjbfrAVF4dwimkwN5wvrDqQVkFpHKOl2eGHNKR79GDGIVZqtfeAC8O2WlzHSvIuB+8HOdkQV+FQ39pjrfWtLwLDuUd31Qeye0HxFo+h+gnP+6n/I/TGfo2dUcUSVVOH3FsHZ8qfsBSsU+qoTt1TbaUnp7qdjNIT1mE7mX1D9g1bwoZyBDJCbd3+NBUzhyBtKfNDmW7iTzRKFeHN/bWXQ5FT2bkt+QwARL08nNl1BLh+EqhhiLnMusqmmPPtCgG2FqYva0ADFVQ2UK7sm/xL61WsvRMzps2CJoVedGrUKHBj/gOSBpO7yEjk27cECvnP3Xw149e4bofV36wAYY3kC6hvBiHT/+8v1HqJf0jyAK5I3SqQfzspOlc4rYdI5kuRP4gYCWIW8PE+8bADaP/q71DSX54KOdVDgXy2oQAuSiNXoPLP/vNHHfmljavL4krw4uKVXSh7AMfUfKgpT0F1/92OW1z+s/w37wVIxoBFFGCaq7ZQeG0MzN6j/WrJFR9A4iZ6kUd0pl1z78ziZylCzD4+WpAf00ufiUL40gwER0f1wO58IcKj1b8l3JwR0LFAWZOfG/SlN6VkY5AJx16JK33KjknWzl/CCUPl4ee/xDRdIWA6mSeyXN8wzVM0mUUN29+OIul7to2YVlYYwKZObPX0nFUYhjLtkYddMTnM=
cache:
directories:
- $HOME/.ccache
- $HOME/deps
addons:
apt:
update: true
sources: &default_sources
- ubuntu-toolchain-r-test
- boost-latest
packages: &default_packages
- doxygen
- graphviz
matrix:
include:
- os: linux
compiler: gcc
env: MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CMAKE_BUILD_TYPE=Debug"
addons: {apt: { packages: [*default_packages, g++-7], sources: [*default_sources]}}
- os: linux
compiler: gcc
env: MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && MAKE_TEST=true"
addons: {apt: { packages: [*default_packages, g++-7], sources: [*default_sources]}}
- os: linux
compiler: gcc
env: MATRIX_EVAL="CC=gcc-8 && CXX=g++-8 && TRAVIS_BUILD_DOCS=true"
addons: {apt: { packages: [*default_packages, g++-8], sources: [*default_sources]}}
- os: linux
compiler: clang
env: MATRIX_EVAL="CC=clang && CXX=clang++ && MAKE_TEST=true"
addons: {apt: { packages: [*default_packages], sources: [*default_sources]}}
#- os: osx
# osx_image: xcode10.1
# compiler: clang
# env: MATRIX_EVAL="CXX_ID=clang6 && CC=clang && CXX=clang++"
- os: osx
osx_image: xcode10.1
compiler: clang
env: MATRIX_EVAL="CXX_ID=clang7 && CC=clang && CXX=clang++ && MAKE_TEST=true"
- os: osx
osx_image: xcode10.1
compiler: gcc
env: MATRIX_EVAL="CXX_ID=gcc && CC=gcc-8 && CXX=g++-8"
- os: osx
osx_image: xcode10.1
compiler: clang
env: MATRIX_EVAL="CXX_ID=apple && CC=cc && CXX=c++"
before_install:
- eval "${MATRIX_EVAL}"
# OpenMP issue with linux+clang
#- export LD_LIBRARY_PATH=/usr/local/clang/lib:$LD_LIBRARY_PATH
# Check commit matches expected commit (because of Travis bug)
- |
if [[ "$TRAVIS_COMMIT" != "$(git rev-parse HEAD)" ]]; then
echo "Commit doesn't match expected $TRAVIS_COMMIT";
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CXX_ID" == "clang6" ]]; then
brew install llvm@6 libomp
# brew link --force --overwrite llvm@6
export PATH="$(brew --prefix llvm@6)/bin:$PATH"
ls
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CXX_ID" == "clang7" ]]; then
brew install llvm@7 libomp
# brew link --force --overwrite llvm@7
export PATH="$(brew --prefix llvm@7)/bin:$PATH"
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CXX_ID" == "gcc" ]]; then
brew install gcc@8
export PATH="/usr/local/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export STRIDE_FORCE_NO_PROTOC=ON
export STRIDE_FORCE_NO_HDF5=ON
fi
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CC" == "clang" ]]; then
export LD_LIBRARY_PATH="/usr/local/clang/lib:$LD_LIBRARY_PATH"
fi
install:
#--------- Linux
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
SWIGHOME=$HOME/deps/swig_3.0.12
if [[ -z "$(ls -A $SWIGHOME)" ]]; then
cd /tmp/;
curl -s -J -O -k -L 'https://sourceforge.net/projects/swig/files/swig/swig-3.0.12/swig-3.0.12.tar.gz/download'
tar xf swig-3.0.12.tar.gz > /dev/null 2>&1
cd swig-3.0.12 && ./configure --prefix $SWIGHOME
make && make install
cd $TRAVIS_BUILD_DIR
else
echo "Already have swig cache"
fi
export CMAKE_PREFIX_PATH=$SWIGHOME:$CMAKE_PREFIX_PATH
# QT 5.12.1 installation
# SOURCE: Stephan Binner, Laurens
# open gl for QT
sudo apt-get install libgl-dev
# # Stephan Binner packages
sudo add-apt-repository ppa:beineri/opt-qt-5.12.1-xenial -y
sudo apt-get update -qq
sudo apt-get install -y -q qt512base
sudo apt-get install -y -q qt512svg
sudo apt-get install -y -q qt512quickcontrols
sudo apt-get install -y -q qt512graphicaleffects
sudo apt-get install -y -q qt512tools
sudo apt-get install -y -q qt512quickcontrols2
sudo apt-get install -y -q qt512location
source /opt/qt512/bin/qt512-env.sh # not really needed, but recommended by Stephan Binner
#--- HDF5 --- SOURCE "https://stackoverflow.com/questions/31719451/install-hdf5-and-pytables-in-ubuntu"
sudo apt-get install libhdf5-serial-dev
fi
#--------- OSX
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew upgrade python cmake
# stride dependencies
brew install ccache
brew install swig
# install qt5 for brew # SOURCE: https://github.com/pcolby/aws-sdk-qt/blob/master/.travis.yml, laurens
brew install qt
brew link --force qt
# install HDF5
brew install hdf5
fi
#--------- All platforms
- |
# STRIDE_FORCE_NO_BOOST: do not use bjam to build boost (mac+gcc problems)
# STRIDE_BOOST_ROOT: specify where the correct version of boost can be found
# STRIDE_BOOST_NO_SYSTEM_PATHS: should be ON to prevent mixing different versions of boost
if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CXX_ID" == "gcc" ]]; then
export STRIDE_FORCE_NO_BOOST=ON
export STRIDE_BOOST_NO_SYSTEM_PATHS=ON
else
export BOOST_ROOT=$HOME/deps/boost_1_69_0
if [[ -z "$(ls -A $BOOST_ROOT)" ]]; then
cd /tmp/
wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz -q
tar xf boost_1_69_0.tar.gz > /dev/null 2>&1
cd boost_1_69_0/
./bootstrap.sh --prefix=$BOOST_ROOT --with-libraries=chrono,date_time,filesystem,iostreams,locale,regex,system,thread
./b2 -q -a -j2 -d0 --disable-filesystem2 cxxflags="-v -std=c++11" threading=multi install
cd $TRAVIS_BUILD_DIR;
else
echo "Already have boost cache"
fi
export LD_LIBRARY_PATH=$BOOST_ROOT/lib:$LD_LIBRARY_PATH
sudo rm -f /usr/local/lib/libboost*.dylib*
sudo ln -s $BOOST_ROOT/lib/*.{so,dylib}* /usr/local/lib
fi
script:
- make all && if [[ "$MAKE_TEST" = "true" ]]; then make test; fi
after_success:
# Generate the docs only if master, the travis_build_docs is true and we can use secure variables
- |
if [[ "$TRAVIS_BRANCH" = "master" && "$TRAVIS_BUILD_DOCS" = "true" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then
cd $TRAVIS_BUILD_DIR
chmod +x resources/sh/generate-doxygen.sh
resources/sh/generate-doxygen.sh
fi