forked from alicevision/AliceVision
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
139 lines (125 loc) · 4.86 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
# http://travis-ci.org configuration file for AliceVision
language: cpp
dist: trusty
sudo: false
compiler:
- gcc
#- clang: #Consider clang later, since cereal does not build fine on the clang CI version
# - "3.3"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
#- cmake # Manually install latest version (>=3.0)
- lcov
- libpng-dev
- libjpeg8-dev
- libtiff4-dev
- libxxf86vm1
- libxxf86vm-dev
- x11proto-xf86vidmode-dev
- libxrandr-dev
- g++-4.8
- libatlas-base-dev
- libsuitesparse-dev
env:
global:
- NUM_CPU="`grep processor /proc/cpuinfo | wc -l`"; echo $NUM_CPU
- BUILD_TYPE="Release"
- BUILD_SYSTEM="`uname -s`"
- BUILD_PROCESSOR="`uname -p`"
# NOTE: we need to install the dependencies in install-deps because for those ones using the cmake config file,
# some of their dependencies are linked with hard-coded paths to the place where they where installed when said
# dependency was built. E.g. Alembic depends on openExr and the AlembicConfig.cmake contains hard-coded links to
# the path /home/travis/build/alicevision/AliceVisionDependencies/install-deps, which was where openExr was installed
# when Alembic was built (see AliceVisionDependencies repository).
- DEPS_INSTALL_PATH=${TRAVIS_BUILD_DIR}/../AliceVisionDependencies/install-deps
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:
- ./ci/install-cmake.sh
- ./ci/install-dependencies.sh
before_script:
- . ./ci/env.sh
- export CXX="g++-4.8"
- export CTEST_OUTPUT_ON_FAILURE=1
- export CMAKE_PREFIX_PATH="${DEPS_INSTALL_PATH}"
- mkdir $ALICEVISION_BUILD
- cd $ALICEVISION_BUILD
- >
cmake \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX:PATH=${ALICEVISION_INSTALL} \
-DTARGET_ARCHITECTURE=core \
-DALICEVISION_BUILD_TESTS:BOOL=ON \
-DALICEVISION_BUILD_EXAMPLES:BOOL=ON \
-DALICEVISION_USE_OPENCV:BOOL=ON \
-DALICEVISION_USE_CUDA:BOOL=OFF \
-DOpenCV_DIR:PATH="${DEPS_INSTALL_PATH}/share/OpenCV" \
-DALICEVISION_USE_OPENGV:BOOL=ON \
-DOPENGV_DIR:PATH="${DEPS_INSTALL_PATH}" \
-DBOOST_NO_CXX11:BOOL=ON \
-DCeres_DIR:PATH="${DEPS_INSTALL_PATH}/share/Ceres" \
-DEIGEN_INCLUDE_DIR_HINTS:PATH="${DEPS_INSTALL_PATH}" \
-DALICEVISION_USE_CCTAG:BOOL=OFF \
-DALICEVISION_USE_ALEMBIC:BOOL=ON \
-DAlembic_DIR:PATH="${DEPS_INSTALL_PATH}/lib/cmake/Alembic" \
. $ALICEVISION_SOURCE
# Build for code coverage evaluation
#- cmake -DALICEVISION_BUILD_COVERAGE=ON -DALICEVISION_BUILD_TESTS=ON -DALICEVISION_BUILD_EXAMPLES=ON . ../AliceVision
script:
# limit GCC builds to a reduced number of thread for the virtual machine
- make install -j 2 VERBOSE=1
- export OMP_NUM_THREADS=2
# Perform unit tests only on GCC builds
- if [ "$CC" = "gcc" ]; then make test; fi
- mkdir -p ${ALICEVISION_BUILD_AS3RDPARTY}
- cd ${ALICEVISION_BUILD_AS3RDPARTY}
- cmake -DCMAKE_PREFIX_PATH:PATH="${ALICEVISION_INSTALL};${DEPS_INSTALL_PATH}" ${ALICEVISION_SAMPLE_AS3RDPARTY}
- make
# Perform benchmark through ground truth tests with different scenes
- >
if [ -n "$TRAVIS_PULL_REQUEST" ]; then # limit to PR builds
if folder_not_empty "$GT_TEST_SOURCE"; then
echo "Evaluation benchmark found in cache.";
cd $GT_TEST_SOURCE
git pull # ensure that we are up-to-date
else
git clone --branch master https://github.com/alicevision/SfM_quality_evaluation.git $GT_TEST_SOURCE;
fi
cd $GT_TEST_SOURCE
git checkout 1828a5076ccca86fd523c92a768f1d518dfdbb91 # checkout a specific commit to ensure repeatability
python EvaluationLauncher.py -s "$ALICEVISION_BUILD/$BUILD_SYSTEM-$BUILD_PROCESSOR" -i Benchmarking_Camera_Calibration_2008/ -o ${GT_TEST_OUTPUT} -r ${GT_TEST_RESULTS} --limit 3
cat ${GT_TEST_RESULTS}
# Return to root and remove GT huge files to avoid cache problems
cd $TRAVIS_BUILD_DIR
rm -rf $GT_TEST_SOURCE
rm -rf $GT_TEST_OUTPUT
fi
#after_success:
# - cd ../AliceVision
# # If GCC: compute code coverage and export it to coveralls
# - if [ "$CC" = "gcc" ];
# then
# lcov --directory ../build/AliceVision --base-directory=. --capture --output-file=coverage.info;
# lcov --remove coverage.info '/usr*' -o coverage.info;
# lcov --remove coverage.info '*_test.cpp*' -o coverage.info;
# lcov --remove coverage.info '*/third_party/*' -o coverage.info;
# lcov --remove coverage.info '*/src/dependencies/*' -o coverage.info;
# coveralls-lcov coverage.info;
# fi
# Before uploading the new cache archive
before_cache:
- ccache -s
cache:
# Enable compiler cache
ccache: true