-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
209 lines (188 loc) · 7.95 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
dist: trusty
sudo: required
language: c++
#compiler:
# - clang++
# - g++
addons:
apt:
sources: &sources
- ubuntu-toolchain-r-test
packages:
- g++-6
- g++-7
- build-essential
- autoconf
- libtool
- git
- curl
- fswatch
cache:
apt: true
ccache: true
directories:
- ${TRAVIS_BUILD_DIR}/deps/boost-1.65.1
- ${TRAVIS_BUILD_DIR}/deps/grpc-v1.6.6
matrix:
include:
#- os: linux
# env: COMPILER=g++-6 BOOST_VERSION=1.65.1 DOCUMENTATION=false
# compiler: gcc
- os: linux
env: COMPILER=g++-7 BOOST_VERSION=1.65.1 DOCUMENTATION=false GRPC_VERSION=v1.7.2 PROTOBUF_VERSION=3.0.2
compiler: gcc
before_install:
- pwd
- eval "${MATRIX_EVAL}"
install:
## install dependencies in ${TRAVIS_BUILD_DIR}/deps/
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
## setup default versions and override compiler if needed
- if [[ "${LLVM_VERSION}" == "default" ]]; then LLVM_VERSION=3.9.0; fi
- if [[ "${BOOST_VERSION}" == "default" ]]; then BOOST_VERSION=1.63.0; fi
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
# install protobuf
- |
if [[ "${PROTOBUF_VERSION}" != "" ]]; then
PROTOBUF_DIR=${DEPS_DIR}/protobuf-v${PROTOBUF_VERSION}
if [[ -z "$(ls -A ${PROTOBUF_DIR})" ]]; then
mkdir -p ${PROTOBUF_DIR} && cd ${PROTOBUF_DIR}
#travis_retry wget https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
#unzip protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
travis_retry git clone -b v${PROTOBUF_VERSION} https://github.com/google/protobuf.git .
./autogen.sh
./configure
make
fi
export PATH=${PROTOBUF_DIR}/src:${PATH}
export LDFLAGS="-L ${PROTOBUF_DIR}/src/.libs"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${PROTOBUF_DIR}/src/.libs"
CMAKE_OPTIONS+=" -DPROTOBUF_LIBRARY=${PROTOBUF_DIR}/src/.libs -DPROTOBUF_INCLUDE_DIR=${PROTOBUF_DIR}/src"
protoc --version
fi
## install grpc
- |
if [[ "${GRPC_VERSION}" != "" ]]; then
GRPC_DIR=${DEPS_DIR}/grpc-${GRPC_VERSION}
if [[ -z "$(ls -A ${GRPC_DIR})" ]]; then
travis_retry git clone -b ${GRPC_VERSION} https://github.com/grpc/grpc ${GRPC_DIR}
(cd ${GRPC_DIR} && git submodule update --init && make -j2 -i && ls -R bins)
# PROTOBUF_DIR = ${GRPC_DIR}/third_party/protobuf/src
# cd ${PROTOBUF_DIR}
# ./autogen.sh && ./configure && make -j2
fi
CMAKE_OPTIONS+=" -DGRPC_CPP_PLUGIN=${GRPC_DIR}/bins/opt/grpc_cpp_plugin"
export PATH=${GRPC_DIR}/bins/opt:${PATH}
export LDFLAGS="-L ${GRPC_DIR}/libs/opt"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GRPC_DIR}/libs/opt"
fi
## install protobuf
#- |
# if [[ "${PROTOBUF_VERSION}" != "" ]]; then
# PROTOBUF_DIR=${DEPS_DIR}/protobuf-v${PROTOBUF_VERSION}
# if [[ -z "$(ls -A ${PROTOBUF_DIR})" ]]; then
# mkdir -p ${PROTOBUF_DIR} && cd ${PROTOBUF_DIR}
# #travis_retry wget https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
# #unzip protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
# travis_retry git clone -b ${PROTOBUF_VERSION} https://github.com/google/protobuf.git .
# fi
# export PATH=${PROTOBUF_DIR}/bin:${PATH}
# protoc --version
# fi
## install boost headers
- |
if [[ "${BOOST_VERSION}" != "" ]]; then
BOOST_DIR=${DEPS_DIR}/boost-${BOOST_VERSION}
if [[ -z "$(ls -A ${BOOST_DIR})" ]]; then
if [[ "${BOOST_VERSION}" == "trunk" ]]; then
BOOST_URL="http://github.com/boostorg/boost.git"
travis_retry git clone --depth 1 --recursive ${BOOST_URL} ${BOOST_DIR} || exit 1
(cd ${BOOST_DIR} && ./bootstrap.sh --with-libraries=log,thread,system,program_options && ./b2 headers) || exit 1
else
BOOST_URL="http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION//\./_}.tar.gz"
mkdir -p ${BOOST_DIR}
{ travis_retry wget -O - ${BOOST_URL} | tar --strip-components=1 -xz -C ${BOOST_DIR}; } || exit 1
fi
fi
CMAKE_OPTIONS+=" -DBOOST_ROOT=${BOOST_DIR}"
fi
## install recent cmake
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew upgrade cmake || brew install cmake
fi
- cmake --version
## install boost libraries
- |
(cd ${BOOST_DIR} && ./bootstrap.sh --prefix=${DEPS_DIR} && ./b2 --with-log --with-thread --with-system --with-program_options -j2 install --prefix=${DEPS_DIR})
export PATH=${DEPS_DIR}/b2/bin:${PATH}
export LDFLAGS="-L ${BOOST_DIR}/lib"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BOOST_DIR}/lib"
## install boost.build
- |
if [[ "${BOOST_BUILD}" == "true" ]]; then
(cd ${BOOST_DIR}/tools/build && ./bootstrap.sh && ./b2 install --prefix=${DEPS_DIR}/b2)
export PATH=${DEPS_DIR}/b2/bin:${PATH}
fi
## install clang libc++ and libc++abi
- |
if [[ "${LLVM_VERSION}" != "" ]]; then
LLVM_DIR=${DEPS_DIR}/llvm-${LLVM_VERSION}
if [[ -z "$(ls -A ${LLVM_DIR})" ]]; then
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
CLANG_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
mkdir -p ${LLVM_DIR} ${LLVM_DIR}/build ${LLVM_DIR}/projects/libcxx ${LLVM_DIR}/projects/libcxxabi ${LLVM_DIR}/clang
travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}
travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxx
travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxxabi
travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/clang
(cd ${LLVM_DIR}/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_DIR}/install -DCMAKE_CXX_COMPILER=clang++)
(cd ${LLVM_DIR}/build/projects/libcxx && make install -j2)
(cd ${LLVM_DIR}/build/projects/libcxxabi && make install -j2)
fi
export CXXFLAGS="-nostdinc++ -isystem ${LLVM_DIR}/install/include/c++/v1"
export LDFLAGS="-L ${LLVM_DIR}/install/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_DIR}/install/lib"
export PATH="${LLVM_DIR}/clang/bin:${PATH}"
fi
- ${CXX} --version
## install recent doxygen
- |
if [[ "${DOCUMENTATION}" == "true" ]]; then
DOXYGEN_URL="http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.11.linux.bin.tar.gz"
mkdir doxygen && travis_retry wget --quiet -O - ${DOXYGEN_URL} | tar --strip-components=1 -xz -C doxygen
export PATH=${DEPS_DIR}/doxygen/bin:${PATH}
doxygen --version
fi
# - echo "building grpc" && cd
# - git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc
# - cd grpc
# - git submodule update --init
# - make CFLAGS='-Wno-implicit-fallthrough -w' CXXFLAGS='-Wno-implicit-fallthrough -w' -j2
# - sudo make install
# - echo "building protobuf"
# - cd third_party/protobuf
# - ./autogen.sh
# - ./configure && make -j2
# - sudo make install
before_script:
- protoc --version
- cd ${TRAVIS_BUILD_DIR}
script:
- |
mkdir build
cd build
cmake .. ${CMAKE_OPTIONS}
cmake --build .
ctest --V
notifications:
email:
on_success: change
on_failure: always