forked from repu1sion/odp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
449 lines (433 loc) · 20.2 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# Copyright (c) 2016-2018, Linaro Limited
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Please update xxxx for your coverity token and notification email if required
# pushing to github/master will run make check
# pushing to github/coverity_scan will also launch a static analysis
# See https://scan.coverity.com/travis_ci
language: c
sudo: required
dist: trusty
group: deprecated-2017Q2
stages:
- "build only"
- test
addons:
apt:
packages:
- gcc
- clang-3.8
- automake autoconf libtool libssl-dev graphviz mscgen
- libconfig-dev
- codespell
- libpcap-dev
- libnuma-dev
# coverity_scan:
# project:
# name: "$TRAVIS_REPO_SLUG"
# notification_email: xxxx
# build_command_prepend: "./bootstrap && ./configure --enable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-user-guides --enable-test-perf-proc --enable-test-example"
# build_command: "make"
# branch_pattern: coverity_scan
cache:
ccache: true
pip: true
directories:
- dpdk
- netmap
- $HOME/cunit-install
- $HOME/doxygen-install
env:
global:
#
# By default Linaro CODECOV_TOKEN token is used. It's ok to use it to see
# for individual commit validation. But you you want to track tests history
# you need generated new one at https://codecov.io specific for your repo.
- CODECOV_TOKEN=a733c34c-5f5c-4ff1-af4b-e9f5edb1ab5e
- DPDK_VERS="17.11"
matrix:
- CONF=""
- CONF="--disable-abi-compat"
- CONF="--enable-deprecated"
- CONF="--enable-dpdk-zero-copy"
- CONF="--disable-static-applications"
- CONF="--disable-host-optimization"
- CONF="--disable-host-optimization --disable-abi-compat"
- DPDK_SHARED="y" CONF="--disable-static-applications"
compiler:
- gcc
- clang-3.8
before_install:
# Install cross toolchains, etc
# apt-get update may fail thanks to Ubuntu removing Packages/indices while not removing relevant parts of Release file
- if [ -n "$CROSS_ARCH" ] ;
then
BUILD_GNU_TYPE=`dpkg-architecture -a"$CROSS_ARCH" -qDEB_BUILD_GNU_TYPE` ;
CROSS_GNU_TYPE=`dpkg-architecture -a"$CROSS_ARCH" -qDEB_HOST_GNU_TYPE` ;
CROSS_MULTIARCH=`dpkg-architecture -a"$CROSS_ARCH" -qDEB_HOST_MULTIARCH` ;
CROSS="--host="$CROSS_GNU_TYPE" --build="$BUILD_GNU_TYPE"" ;
sudo dpkg --add-architecture "$CROSS_ARCH" ;
sudo -E apt-add-repository -y "deb http://ports.ubuntu.com trusty main" ;
sudo -E apt-add-repository -y "deb http://ports.ubuntu.com trusty-updates main" ;
sudo -E apt-get -y update || true ;
PKGS="build-essential libc6-dev:$CROSS_ARCH libssl-dev:$CROSS_ARCH zlib1g-dev:$CROSS_ARCH libconfig-dev:$CROSS_ARCH libstdc++-4.8-dev:$CROSS_ARCH libpcap0.8-dev:$CROSS_ARCH" ;
if [ "$CROSS_ARCH" = "i386" ] ;
then
PKGS="$PKGS g++-multilib" ;
else
PKGS="$PKGS g++-$CROSS_GNU_TYPE" ;
fi ;
if [ "$CROSS_ARCH" != "armhf" ] ;
then
PKGS="$PKGS libnuma-dev:$CROSS_ARCH" ;
fi ;
sudo -E apt-get -y --no-install-suggests --no-install-recommends --force-yes install $PKGS || exit 1 ;
export PKG_CONFIG_PATH=/usr/lib/${CROSS_MULTIARCH}/pkgconfig:/usr/${CROSS_MULTIARCH}/lib/pkgconfig ;
fi
- if [ "${CC#clang}" != "${CC}" ] ;
then
if [ -n "$CROSS_ARCH" ] ;
then
export CC="${CC} --target=$CROSS_GNU_TYPE" ;
if [ "$CROSS_ARCH" = "i386" ] ;
then
DPDK_CFLAGS="-m32" ;
else
DPDK_CROSS="$CROSS_GNU_TYPE-" ;
DPDK_CFLAGS="--target=$CROSS_GNU_TYPE" ;
fi
fi ;
export CXX="${CC/clang/clang++}";
elif [ "$CROSS_ARCH" = "i386" ] ;
then
export CC="gcc -m32" ;
export CXX="g++ -m32" ;
DPDK_CFLAGS="-m32" ;
elif [ -n "$CROSS_ARCH" ] ;
then
export CC="$CROSS_GNU_TYPE"-gcc ;
export CXX="$CROSS_GNU_TYPE"-g++ ;
DPDK_CROSS="$CROSS_GNU_TYPE-" ;
fi
- if test ! -L /usr/lib/ccache/${CC%% *} ; then sudo ln -s -t /usr/lib/ccache/ `which ${CC%% *}` ; fi
- ccache -s
# Install cunit for the validation tests because distro version is too old and fails C99 compile
- sudo apt-get remove libcunit1-dev libcunit1
- export LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH"
- |
if [ ! -f "$HOME/cunit-install/$CROSS_ARCH/lib/libcunit.a" ]; then
export CUNIT_VERSION=2.1-3
curl -sSOL https://github.com/Linaro/libcunit/releases/download/${CUNIT_VERSION}/CUnit-${CUNIT_VERSION}.tar.bz2
tar -jxf *.bz2
pushd CUnit*
libtoolize --force --copy
aclocal
autoheader
automake --add-missing --include-deps --copy
autoconf
./configure --prefix=$HOME/cunit-install/$CROSS_ARCH --enable-debug --enable-automated --enable-basic --enable-console --enable-examples --enable-test $CROSS || cat config.log
make -j $(nproc)
sudo make install
popd
fi
- export PKG_CONFIG_PATH="$HOME/cunit-install/$CROSS_ARCH/lib/pkgconfig:${PKG_CONFIG_PATH}"
- find $HOME/cunit-install
install:
- echo 1000 | sudo tee /proc/sys/vm/nr_hugepages
- sudo mkdir -p /mnt/huge
- sudo mount -t hugetlbfs nodev /mnt/huge
- if [ -z "$CROSS_ARCH" ] ;
then
sudo apt-get -qq update ;
sudo apt-get install linux-headers-`uname -r` ;
fi
- gem install asciidoctor
# DPDK pktio. Note that cache must be purged if dpdk version changes.
- |
CACHED_DPDK_VERS=`fgrep Version dpdk/pkg/dpdk.spec | cut -d " " -f 2`
if [ "${CACHED_DPDK_VERS}" != "${DPDK_VERS}" ]; then
rm -rf dpdk
fi
- |
case "$CROSS_ARCH" in
"arm64")
DPDK_TARGET="arm64-armv8a-linuxapp-"
;;
"armhf")
DPDK_TARGET="arm-armv7a-linuxapp-"
;;
"i386")
DPDK_TARGET="i686-native-linuxapp-"
;;
"")
DPDK_TARGET="x86_64-native-linuxapp-"
DPDK_MACHINE=snb
;;
esac
- |
if [ -n "$DPDK_TARGET" ] ; then
if [ "${CC#clang}" != "${CC}" ] ; then
DPDKCC=clang ;
else
DPDKCC=gcc ;
fi
if [ -n "$DPDK_SHARED" ] ; then
TARGET="${DPDK_TARGET}$DPDKCC"-shared
LIBDPDKEXT=so
export LD_LIBRARY_PATH="`pwd`/${TARGET}:$LD_LIBRARY_PATH"
echo $LD_LIBRARY_PATH
else
TARGET="${DPDK_TARGET}$DPDKCC"
LIBDPDKEXT=a
fi
DPDK_TARGET="${DPDK_TARGET}gcc"
if [ ! -f "dpdk/${TARGET}/usr/local/lib/libdpdk.$LIBDPDKEXT" ]; then
git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=${DPDK_VERS} http://dpdk.org/git/dpdk-stable dpdk
pushd dpdk
git log --oneline --decorate
# AArch64 && ARMv7 fixup
sed -i -e 's/40900/40800/g' lib/librte_eal/common/include/arch/arm/rte_vect.h
sed -i -e 's/!(/!(defined(__arm__) \&\& defined(__clang__) || /g' lib/librte_eal/common/include/arch/arm/rte_byteorder.h
sed -i -e 's/__GNUC__/defined(__arm__) \&\& defined(__clang__) || __GNUC__/' lib/librte_eal/common/include/generic/rte_byteorder.h
sed -i -e 's,\$(CC),\0 $(EXTRA_CFLAGS),g' lib/librte_acl/Makefile
make config T=${DPDK_TARGET} O=${TARGET}
pushd ${TARGET}
sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
# OCTEON TX driver includes ARM v8.1 instructions
sed -ri 's,(CONFIG_RTE_LIBRTE_OCTEONTX_PMD=).*,\1n,' .config
sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF=).*,\1n,' .config
sed -ri 's,(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL=).*,\1n,' .config
if test -n "${DPDK_MACHINE}" ; then
sed -ri 's,(CONFIG_RTE_MACHINE=).*,\1"'${DPDK_MACHINE}'",' .config
fi
if test -n "${DPDK_SHARED}" ; then
sed -ri 's,(CONFIG_RTE_BUILD_SHARED_LIB=).*,\1y,' .config
fi
if test -n "$CROSS_ARCH" ; then
sed -ri -e 's,(CONFIG_RTE_EAL_IGB_UIO=).*,\1n,' .config
sed -ri -e 's,(CONFIG_RTE_KNI_KMOD=).*,\1n,' .config
fi
sed -ri -e 's,(CONFIG_RTE_TOOLCHAIN=).*,\1"'${DPDKCC}'",' .config
sed -ri -e '/CONFIG_RTE_TOOLCHAIN_.*/d' .config
echo CONFIG_RTE_TOOLCHAIN_${DPDKCC^^}=y >> .config
popd
make build O=${TARGET} EXTRA_CFLAGS="-fPIC $DPDK_CFLAGS" CROSS="$DPDK_CROSS" CC="$CC" HOSTCC=gcc -j $(nproc)
make install O=${TARGET} DESTDIR=${TARGET}
rm -r ./doc ./${TARGET}/app ./${TARGET}/build
popd
fi
EXTRA_CONF="$EXTRA_CONF --with-dpdk-path=`pwd`/dpdk/${TARGET}/usr/local"
fi
# Netmap pktio
- |
if [ -z "$CROSS_ARCH" ]; then
if [ ! -f "netmap/LINUX/netmap.ko" ]; then
git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v11.2 https://github.com/luigirizzo/netmap.git
pushd netmap/LINUX
./configure
make -j $(nproc)
popd
fi
sudo insmod ./netmap/LINUX/netmap.ko
EXTRA_CONF="$EXTRA_CONF --with-netmap-path=`pwd`/netmap"
fi
script:
- ./bootstrap
- ./configure --prefix=$HOME/odp-install
--enable-user-guides
--enable-debug=full
--enable-helper-linux
$CROSS $EXTRA_CONF $CONF
- make -j $(nproc)
- mkdir /dev/shm/odp
# Run all tests only for default configuration
- if [ -z "$CROSS_ARCH" ] ; then
if [ -n "$CONF" ] ; then
sudo ODP_CONFIG_FILE="`pwd`/config/odp-linux-generic.conf" LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" ODP_SHM_DIR=/dev/shm/odp make check ;
else
sudo ODP_SCHEDULER=basic LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" ODP_SHM_DIR=/dev/shm/odp make check ;
sudo ODP_SCHEDULER=sp LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" ODP_SHM_DIR=/dev/shm/odp make check ;
sudo ODP_SCHEDULER=iquery LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" ODP_SHM_DIR=/dev/shm/odp make check ;
sudo ODP_SCHEDULER=scalable LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" ODP_SHM_DIR=/dev/shm/odp make check ;
fi
fi
- make install
- echo "Checking linking and run from install..."
- pushd $HOME
- echo "Dynamic link.."
- ${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst_dynamic `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux`
- if [ -z "$CROSS_ARCH" ] ; then
LD_LIBRARY_PATH="${HOME}/odp-install/lib:$LD_LIBRARY_PATH" ./odp_hello_inst_dynamic ;
fi
- |
# it is not possible to do static linking if we only have shared DPDK library. Compiler complains about missing -ldpdk
if [ -z "$TARGET" -o -z "$DPDK_SHARED" ] ; then
echo "Static link.."
${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst_static `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux --static` -static || exit 1
if [ -z "$CROSS_ARCH" ] ; then
./odp_hello_inst_static;
fi
fi
- popd
- ccache -s
jobs:
include:
- stage: test
env: TEST=coverage
compiler: gcc
script:
- sudo pip install coverage
- ./bootstrap
- ./configure --prefix=$HOME/odp-install
--enable-user-guides
--with-dpdk-path=`pwd`/dpdk/${TARGET}/usr/local
--with-netmap-path=`pwd`/netmap CFLAGS="-O0 -coverage"
CXXFLAGS="-O0 -coverage" LDFLAGS="--coverage"
--enable-debug=full
--enable-helper-linux
- CCACHE_DISABLE=1 make -j $(nproc)
- sudo CCACHE_DISABLE=1 ODP_SCHEDULER=basic LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make check
- sudo CCACHE_DISABLE=1 ODP_SCHEDULER=sp LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make check
- sudo CCACHE_DISABLE=1 ODP_SCHEDULER=iquery LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make check
- sudo CCACHE_DISABLE=1 ODP_SCHEDULER=scalable LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make check
- find . -type f -iname '*.[ch]' -not -path ".git/*" -execdir gcov {} \; ; bash <(curl -s https://codecov.io/bash) -X coveragepy
- stage: test
env: TEST=distcheck
compiler: gcc
script:
- ./bootstrap
- ./configure --prefix=$HOME/odp-install
--enable-user-guides
- sudo PATH="$PATH" LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make distcheck
- stage: test
env: TEST=distcheck-non-abi
compiler: gcc
script:
- ./bootstrap
- ./configure --prefix=$HOME/odp-install
--enable-user-guides
- sudo PATH="$PATH" LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make distcheck DISTCHECK__CONFIGURE_FLAGS=--disable-abi-compat
- stage: "build only"
env: TEST=doxygen
compiler: gcc
install:
# Updated Doxygen
- |
if [ ! -f "$HOME/doxygen-install/bin/doxygen" ]; then
wget https://github.com/doxygen/doxygen/archive/Release_1_8_13.tar.gz
tar xpvf Release_1_8_13.tar.gz
pushd doxygen-Release_1_8_13
cmake -DCMAKE_INSTALL_PREFIX=$HOME/doxygen-install .
make -j $(nproc)
make install
popd
fi
- export PATH=$HOME/doxygen-install/bin:$PATH
script:
- ./bootstrap
- ./configure
# doxygen does not trap on warnings, check for them here.
- make doxygen-doc 2>&1 |tee doxygen.log
- |
fgrep -rq warning ./doxygen.log
if [ $? -eq 0 ]; then
false
else
true
fi
- stage: "build only"
env: CONF=""
compiler: gcc
install: true
script:
- ./bootstrap
- ./configure --enable-helper-linux
- make -j $(nproc)
- stage: "build only"
env: CONF=""
compiler: clang-3.8
install: true
script:
- ./bootstrap
- ./configure --enable-helper-linux
- make -j $(nproc)
- stage: "build only"
env: CROSS_ARCH="i386"
compiler: gcc
install: true
script:
- ./bootstrap
- ./configure --enable-helper-linux $CROSS
- make -j $(nproc)
- stage: "build only"
env: CROSS_ARCH="arm64"
compiler: gcc
install: true
script:
- ./bootstrap
- ./configure --enable-helper-linux $CROSS
- make -j $(nproc)
- stage: test
compiler: gcc
env: CROSS_ARCH="arm64"
- stage: test
compiler: clang-3.8
env: CROSS_ARCH="arm64"
- stage: test
compiler: gcc
env: CROSS_ARCH="armhf" CFLAGS="-march=armv7-a"
- stage: test
compiler: clang-3.8
env: CROSS_ARCH="armhf" CFLAGS="-march=armv7-a"
- stage: test
compiler: gcc
env: CROSS_ARCH="powerpc"
- stage: test
compiler: clang-3.8
env: CROSS_ARCH="powerpc"
- stage: test
compiler: gcc
env: CROSS_ARCH="i386"
- stage: test
compiler: clang-3.8
env: CROSS_ARCH="i386"
- stage: test
compiler: gcc
env: CROSS_ARCH="arm64" CONF="--disable-abi-compat"
- stage: test
compiler: clang-3.8
env: CROSS_ARCH="arm64" CONF="--disable-abi-compat"
- stage: test
compiler: gcc
env: CROSS_ARCH="armhf" CFLAGS="-march=armv7-a" CONF="--disable-abi-compat"
- stage: test
compiler: clang-3.8
env: CROSS_ARCH="armhf" CFLAGS="-march=armv7-a" CONF="--disable-abi-compat"
- stage: test
compiler: gcc
env: CROSS_ARCH="powerpc" CONF="--disable-abi-compat"
- stage: test
compiler: clang-3.8
env: CROSS_ARCH="powerpc" CONF="--disable-abi-compat"
- stage: test
compiler: gcc
env: CROSS_ARCH="i386" CONF="--disable-abi-compat"
- stage: test
compiler: clang-3.8
env: CROSS_ARCH="i386" CONF="--disable-abi-compat"
- stage: test
canfail: yes
env: TEST=checkpatch
compiler: gcc
install:
- true
script:
- echo ${TRAVIS_COMMIT_RANGE};
- ODP_PATCHES=`echo ${TRAVIS_COMMIT_RANGE} | sed 's/\.//'`;
- ./scripts/ci-checkpatches.sh ${ODP_PATCHES};
allow_failures:
- canfail: yes
after_failure:
- cat config.log
- find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done