-
Notifications
You must be signed in to change notification settings - Fork 88
/
.travis.yml
148 lines (135 loc) · 5.48 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
dist: trusty
language: cpp
sudo: required
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise
packages:
- g++-4.8
- clang-3.8
- libpng-dev
- libjpeg8-dev
- libtiff4-dev
- libtbb-dev
- libatlas-base-dev
matrix:
include:
- compiler: gcc
env: CXX_COMPILER=g++-4.8 C_COMPILER=gcc-4.8 TOOLSET=gcc CCTAG_WITH_CUDA=ON CUDA_VERSION_MAJOR="7" CUDA_VERSION_MINOR="0" CUDA_PKG_LONGVERSION="${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}-28" CUDA_PKG_VERSION="${CUDA_VERSION_MAJOR}-${CUDA_VERSION_MINOR}"
- compiler: gcc
env: CXX_COMPILER=g++-4.8 C_COMPILER=gcc-4.8 TOOLSET=gcc CCTAG_WITH_CUDA=ON CUDA_VERSION_MAJOR="7" CUDA_VERSION_MINOR="5" CUDA_PKG_LONGVERSION="${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}-18" CUDA_PKG_VERSION="${CUDA_VERSION_MAJOR}-${CUDA_VERSION_MINOR}"
- compiler: gcc
env: CXX_COMPILER=g++-4.8 C_COMPILER=gcc-4.8 TOOLSET=gcc CCTAG_WITH_CUDA=ON CUDA_VERSION_MAJOR="8" CUDA_VERSION_MINOR="0" CUDA_PKG_LONGVERSION="${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}.61-1" CUDA_PKG_VERSION="${CUDA_VERSION_MAJOR}-${CUDA_VERSION_MINOR}"
- compiler: gcc
env: CXX_COMPILER=g++-4.8 C_COMPILER=gcc-4.8 TOOLSET=gcc CCTAG_WITH_CUDA=OFF
- compiler: clang
# clang 3.8 is supported in cuda >= 8.0
env: CXX_COMPILER=clang++-3.8 C_COMPILER=clang-3.8 TOOLSET=clang CCTAG_WITH_CUDA=ON CUDA_VERSION_MAJOR="8" CUDA_VERSION_MINOR="0" CUDA_PKG_LONGVERSION="${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}.61-1" CUDA_PKG_VERSION="${CUDA_VERSION_MAJOR}-${CUDA_VERSION_MINOR}"
- compiler: clang
env: CXX_COMPILER=clang++-3.8 C_COMPILER=clang-3.8 TOOLSET=clang CCTAG_WITH_CUDA=OFF
env:
global:
- NUM_CPU="`grep processor /proc/cpuinfo | wc -l`"; echo $NUM_CPU
- BUILD_TYPE="RELEASE"
- BUILD_SYSTEM="`uname -s`"
- BUILD_PROCESSOR="`uname -p`"
- DEPS_INSTALL_PATH=${TRAVIS_BUILD_DIR}/../AliceVisionDependencies/install-deps
- CCTAG_SOURCE=${TRAVIS_BUILD_DIR}
- CCTAG_BUILD=${TRAVIS_BUILD_DIR}/build
- CCTAG_INSTALL=${CCTAG_BUILD}/install
- CCTAG_BUILD_VARIANT=${TRAVIS_BUILD_DIR}/build
- CCTAG_INSTALL_VARIANT=${CCTAG_BUILD_VARIANT}/install
- CCTAG_SOURCE_APP=$CCTAG_SOURCE/src/applications
- CCTAG_BUILD_APP=${CCTAG_SOURCE_APP}/build
before_install:
- date -u
- uname -a
- if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
lsb_release -a;
elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
sw_vers -productVersion;
fi
- ccache -s
- gem install coveralls-lcov
install:
# CUDA (only if needed)
- >
if [ "${CCTAG_WITH_CUDA}" = "ON" ]; then
CUDA_REPO_PKG=cuda-repo-ubuntu1404_${CUDA_PKG_LONGVERSION}_amd64.deb
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/$CUDA_REPO_PKG
sudo dpkg -i $CUDA_REPO_PKG
rm $CUDA_REPO_PKG
sudo apt-get -y update
sudo apt-get install -y --no-install-recommends cuda-core-$CUDA_PKG_VERSION cuda-cudart-dev-$CUDA_PKG_VERSION cuda-cublas-dev-$CUDA_PKG_VERSION cuda-curand-dev-$CUDA_PKG_VERSION
sudo ln -s /usr/local/cuda-${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} /usr/local/cuda
fi
- ./ci/install-cmake.sh
- ./ci/install-dependencies.sh
before_script:
- . ./ci/env.sh
- export CMAKE_PREFIX_PATH="${DEPS_INSTALL_PATH}"
- export CTEST_OUTPUT_ON_FAILURE=1
# patch tbb
# https://software.intel.com/en-us/forums/intel-threading-building-blocks/topic/431422
- sudo sed -i '345s/.*/\#if \(__GNUC__==4 \&\& __GNUC_MINOR__>=4 \&\& __GXX_EXPERIMENTAL_CXX0X__\) || __clang_major__ >= 3/' /usr/include/tbb/pipeline.h
# Create build folder
- mkdir --parent $CCTAG_BUILD
- cd $CCTAG_BUILD
# Classic release build
- >
cmake \
-DCMAKE_CXX_COMPILER=$CXX_COMPILER \
-DCMAKE_C_COMPILER=$C_COMPILER \
-DCMAKE_INSTALL_PREFIX:PATH=$CCTAG_INSTALL \
-DCCTAG_WITH_CUDA:BOOL=$CCTAG_WITH_CUDA \
-DCMAKE_BUILD_TYPE:BOOL=$BUILD_TYPE \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DOpenCV_DIR:PATH="${DEPS_INSTALL_PATH}/share/OpenCV" \
-DEIGEN_INCLUDE_DIR_HINTS="${DEPS_INSTALL_PATH}" \
. $CCTAG_SOURCE
script:
# classic make install
- make install -j 2 VERBOSE=1
- make test
# Test if it compiles as third party
- cd $CCTAG_SOURCE_APP
- mkdir --parent $CCTAG_BUILD_APP
- cd $CCTAG_BUILD_APP
- >
cmake -DCMAKE_CXX_COMPILER=$CXX_COMPILER \
-DCMAKE_C_COMPILER=$C_COMPILER \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCCTag_DIR:PATH=/$CCTAG_INSTALL/lib/cmake/CCTag/ \
-DOpenCV_DIR:PATH=$OPENCV_INSTALL/share/OpenCV \
-DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install \
. $CCTAG_SOURCE_APP
- make install -j 2 VERBOSE=1
# For builds without cuda test also another variant with
# CCTAG_VISUAL_DEBUG and CCTAG_SERIALIZE
- >
if [ "${CCTAG_WITH_CUDA}" = "OFF" ]; then
mkdir --parent $CCTAG_BUILD_VARIANT
cd $CCTAG_BUILD_VARIANT
cmake \
-DCMAKE_CXX_COMPILER=$CXX_COMPILER \
-DCMAKE_C_COMPILER=$C_COMPILER \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_INSTALL_PREFIX:PATH=$CCTAG_INSTALL_VARIANT \
-DCCTAG_WITH_CUDA:BOOL=$CCTAG_WITH_CUDA \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCCTAG_VISUAL_DEBUG:BOOL=ON \
-DCCTAG_SERIALIZE:BOOL=ON \
-DOpenCV_DIR:PATH=$OPENCV_INSTALL/share/OpenCV \
. $CCTAG_SOURCE
make install -j 2 VERBOSE=1
make test
fi
after_success:
- du -hs $OPENCV_INSTALL
# Before uploading the new cache archive
before_cache:
- ccache -s
cache:
ccache: true