-
Notifications
You must be signed in to change notification settings - Fork 126
/
.travis.yml
239 lines (229 loc) · 6.42 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
language: cpp
os:
- osx
osx_image:
- xcode10
compiler:
- clang
env:
global:
- DEPS_DIR="${HOME}/deps"
- DATASET_DIR="${HOME}/dataset"
before_cache:
- brew cleanup
cache:
ccache: true
directories:
- ${HOME}/Library/Caches/Homebrew
- ${DEPS_DIR}/DBoW2
- ${DEPS_DIR}/g2o
- ${DEPS_DIR}/Pangolin
- ${DEPS_DIR}/socket.io-client-cpp
- ${DATASET_DIR}
addons:
homebrew:
update: true
packages:
- ccache
- pkg-config
- cmake
- git
- suite-sparse
- eigen
- ffmpeg
- opencv
- yaml-cpp
- glog
- gflags
- glew
- protobuf
- clang-format
before_install:
- ccache -s
- mkdir -p ${DEPS_DIR}
- |
cd ${DEPS_DIR}
if [ ! -d DBoW2 ]; then
echo "clone DBoW2"
git clone https://github.com/shinsumicco/DBoW2.git
elif [ -z "$(ls DBoW2)" ]; then
echo "reclone DBoW2"
rm -rf DBoW2
git clone https://github.com/shinsumicco/DBoW2.git
fi
cd DBoW2
mkdir -p build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
..
make -j 3
make install
- |
cd ${DEPS_DIR}
if [ ! -d g2o ]; then
echo "clone g2o"
git clone https://github.com/RainerKuemmerle/g2o.git
elif [ -z "$(ls g2o)" ]; then
echo "reclone g2o"
rm -rf g2o
git clone https://github.com/RainerKuemmerle/g2o.git
fi
cd g2o
mkdir -p build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_CXX_FLAGS=-std=c++11 \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_UNITTESTS=OFF \
-DBUILD_WITH_MARCH_NATIVE=ON \
-DG2O_BUILD_EXAMPLES=OFF \
-DG2O_BUILD_APPS=OFF \
-DG2O_USE_CHOLMOD=OFF \
-DG2O_USE_CSPARSE=ON \
-DG2O_USE_OPENGL=OFF \
-DG2O_USE_OPENMP=ON \
..
make -j 3
make install
- |
cd ${DEPS_DIR}
if [ ! -d Pangolin ]; then
echo "clone Pangolin"
git clone https://github.com/stevenlovegrove/Pangolin.git
elif [ -z "$(ls Pangolin)" ]; then
echo "reclone Pangolin"
rm -rf Pangolin
git clone https://github.com/stevenlovegrove/Pangolin.git
fi
cd Pangolin
mkdir -p build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_PANGOLIN_LIBOPENEXR=OFF \
..
make -j 3
make install
- |
cd ${DEPS_DIR}
if [ ! -d socket.io-client-cpp ]; then
echo "clone socket.io-client-cpp"
git clone https://github.com/shinsumicco/socket.io-client-cpp.git
elif [ -z "$(ls socket.io-client-cpp)" ]; then
echo "reclone socket.io-client-cpp"
rm -rf socket.io-client-cpp
git clone https://github.com/shinsumicco/socket.io-client-cpp.git
fi
cd socket.io-client-cpp
git submodule init
git submodule update
mkdir -p build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_UNIT_TESTS=OFF \
..
make -j 3
make install
install:
- |
cd ${TRAVIS_BUILD_DIR}
DIRS_TO_EXCLUDE=".git 3rd cmake docs build .idea cmake-build-debug cmake-build-release"
for DIR in ${DIRS_TO_EXCLUDE}; do
EXCLUDE_CMD="${EXCLUDE_CMD} -type d -name ${DIR} -prune -o"
done
FILES=$(find -E . ${EXCLUDE_CMD} -type f -regex ".*\.(c|h|cc|hh|cpp|hpp)" -print)
for FILE in ${FILES}; do
RET=$(diff ${FILE} <(clang-format -style=file ${FILE}) 2>&1 || true)
if [ -n "${RET}" ]; then
FILES_TO_FORMAT="${FILES_TO_FORMAT} ${FILE}"
fi
done
- |
if [ -n "${FILES_TO_FORMAT}" ]; then
echo "Please apply clang-format to following files:"
for FILE in ${FILES_TO_FORMAT}; do echo "* ${FILE}"; done
travis_terminate 1
fi
echo "There is no file which needs clang-format"
- |
cd ${TRAVIS_BUILD_DIR}
mkdir -p build && cd build
cmake \
-DBUILD_WITH_MARCH_NATIVE=ON \
-DUSE_PANGOLIN_VIEWER=ON \
-DUSE_SOCKET_PUBLISHER=OFF \
-DUSE_STACK_TRACE_LOGGER=ON \
-DBOW_FRAMEWORK=DBoW2 \
-DBUILD_TESTS=ON \
..
make -j 3
- |
cd ${TRAVIS_BUILD_DIR}
mkdir -p build && cd build
cmake \
-DBUILD_WITH_MARCH_NATIVE=ON \
-DUSE_PANGOLIN_VIEWER=OFF \
-DUSE_SOCKET_PUBLISHER=ON \
-DUSE_STACK_TRACE_LOGGER=ON \
-DBOW_FRAMEWORK=DBoW2 \
-DBUILD_TESTS=ON \
..
make -j 3
- |
cd ${TRAVIS_BUILD_DIR}
mkdir -p build && cd build
cmake \
-DBUILD_WITH_MARCH_NATIVE=ON \
-DUSE_PANGOLIN_VIEWER=OFF \
-DUSE_SOCKET_PUBLISHER=OFF \
-DUSE_STACK_TRACE_LOGGER=ON \
-DBOW_FRAMEWORK=DBoW2 \
-DBUILD_TESTS=ON \
..
make -j 3
before_script:
- mkdir -p ${DATASET_DIR}
- |
cd ${DATASET_DIR}
if [ -z "$(ls orb_vocab)" ]; then
FILE_ID="1wUPb328th8bUqhOk-i8xllt5mgRW4n84"
curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${FILE_ID}" > /dev/null
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
curl -sLb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=${FILE_ID}" -o orb_vocab.zip
unzip orb_vocab.zip
rm orb_vocab.zip
fi
- |
cd ${DATASET_DIR}
if [ -z "$(ls video_for_ci_1)" ]; then
FILE_ID="1TXjREzkht3iRz__qVx4oYRW1GXsv37ct"
curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${FILE_ID}" > /dev/null
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
curl -sLb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=${FILE_ID}" -o video_for_ci_1.zip
unzip video_for_ci_1.zip
rm video_for_ci_1.zip
fi
script:
- |
cd ${TRAVIS_BUILD_DIR}
cd build
ctest -V
- |
cd ${TRAVIS_BUILD_DIR}
cd build
./run_video_slam \
-v ${DATASET_DIR}/orb_vocab/orb_vocab.dbow2 \
-m ${DATASET_DIR}/video_for_ci_1/video.mp4 \
-c ${DATASET_DIR}/video_for_ci_1/config.yaml \
--frame-skip 3 --no-sleep --map-db map.msg --debug
- |
cd ${TRAVIS_BUILD_DIR}
cd build
./run_video_localization \
-v ${DATASET_DIR}/orb_vocab/orb_vocab.dbow2 \
-m ${DATASET_DIR}/video_for_ci_1/video.mp4 \
-c ${DATASET_DIR}/video_for_ci_1/config.yaml \
--frame-skip 3 --no-sleep --map-db map.msg --debug