forked from kyamagu/mexopencv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
171 lines (151 loc) · 5.82 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
#
# Travis CI build script.
# https://travis-ci.org/kyamagu/mexopencv
#
language: cpp
compiler:
- gcc
#- clang
os:
- linux
#- osx
# Ubuntu 14.04 LTS Server Edition 64-bit (trusty)
#dist: trusty
# Ubuntu 12.04 LTS Server Edition 64-bit (precise)
sudo: required
# whitelisted branches to build
branches:
only:
- master
# global environment variables
env:
global:
- MCV_ROOT=$(pwd)
- OCTAVERC=$HOME/.octaverc
- OCTAVE_OPTS="--no-gui --no-window-system"
# whether to install Octave Forge packages. They are optional, tests will
# simply skip if needed packages are not detected. Note that the latest
# octave-image fails to compile with gcc-4.6 as it needs C++11 support.
- OCT_STATS=yes
- OCT_IMAGE=no
# common options for make
- MAKE_OPTS="NO_CV_PKGCONFIG_HACK=1 TEST_CONTRIB=true WITH_OCTAVE=1"
# Extra make arguments
# (avoid using too many parallel jobs, as it could starve memory!)
- MAKE_EXTRA=-j2
# whether to generate doxygen HTML documentation
- DOXY=yes
# path where OpenCV is installed
- INSTALL_PREFIX=/usr/local
# CMake generator, one of:
# - Unix Makefiles: GNU Make
# - Ninja: usually faster than make
- CMAKE_GEN=Ninja
install:
# add PPAs
- sudo add-apt-repository -y ppa:octave/stable
- sudo add-apt-repository -y ppa:kalakris/cmake
- sudo apt-get update -qq
# install Octave 4.0.0
- sudo apt-get install -y octave liboctave-dev
# install image and statistics packages used by some tests
- if [ "$OCT_STATS" = "yes" ]; then octave $OCTAVE_OPTS --eval "try, pkg install -forge -local io statistics, end" ; fi
- if [ "$OCT_IMAGE" = "yes" ]; then octave $OCTAVE_OPTS --eval "try, pkg install -forge -local image, end" ; fi
# install build tools (CMake, Ninja, pkg-config, Doxygen)
- sudo apt-get install -y cmake pkg-config
- if [ "$CMAKE_GEN" = "Ninja" ]; then sudo apt-get install -y ninja-build ; fi
- if [ "$DOXY" = "yes" ]; then sudo apt-get install -y doxygen ; fi
# show info about build tools
- printenv
- lsb_release -a
- uname -a
- $CXX --version
- make --version
- if [ "$CMAKE_GEN" = "Ninja" ]; then ninja --version ; fi
- cmake --version
- pkg-config --version
- dpkg -s octave liboctave-dev
- octave $OCTAVE_OPTS --version
- octave $OCTAVE_OPTS --eval "pkg list"
- if [ "$DOXY" = "yes" ]; then doxygen --version ; fi
# install some dependencies for OpenCV
- sudo apt-get install -y zlib1g-dev libjpeg8-dev libpng12-dev libtiff4-dev libjasper-dev libopenexr-dev libgdal-dev
- sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
- sudo apt-get install -y libxine-dev libv4l-dev libdc1394-22-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
- sudo apt-get install -y libgtk2.0-dev libtbb-dev libeigen3-dev
# build OpenCV 3.1.0 from source (opencv + opencv_contrib)
- mkdir $HOME/cv && pushd $HOME/cv
- wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.1.0.zip
- wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.1.0.zip
- unzip opencv.zip > /dev/null
- unzip opencv_contrib.zip > /dev/null
- mkdir build && cd build
- cmake -G "$CMAKE_GEN" -Wno-dev
-DWITH_CUDA:BOOL=OFF
-DWITH_CUFFT:BOOL=OFF
-DWITH_OPENCL:BOOL=OFF
-DWITH_VTK:BOOL=OFF
-DINSTALL_C_EXAMPLES:BOOL=OFF
-DINSTALL_PYTHON_EXAMPLES:BOOL=OFF
-DBUILD_DOCS:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_PACKAGE:BOOL=OFF
-DBUILD_PERF_TESTS:BOOL=OFF
-DBUILD_TESTS:BOOL=OFF
-DBUILD_opencv_apps:BOOL=OFF
-DBUILD_opencv_cuda:BOOL=OFF
-DBUILD_opencv_java:BOOL=OFF
-DBUILD_opencv_python2:BOOL=OFF
-DBUILD_opencv_python3:BOOL=OFF
-DBUILD_opencv_ts:BOOL=OFF
-DBUILD_opencv_world:BOOL=OFF
-DBUILD_opencv_contrib_world:BOOL=OFF
-DBUILD_opencv_aruco:BOOL=OFF
-DBUILD_opencv_ccalib:BOOL=OFF
-DBUILD_opencv_cvv:BOOL=OFF
-DBUILD_opencv_datasets:BOOL=OFF
-DBUILD_opencv_dnn:BOOL=OFF
-DBUILD_opencv_hdf:BOOL=OFF
-DBUILD_opencv_matlab:BOOL=OFF
-DBUILD_opencv_sfm:BOOL=OFF
-DBUILD_opencv_structured_light:BOOL=OFF
-DBUILD_opencv_surface_matching:BOOL=OFF
-DBUILD_opencv_tracking:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=RELEASE
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
-DOPENCV_EXTRA_MODULES_PATH:PATH=$HOME/cv/opencv_contrib-3.1.0/modules $HOME/cv/opencv-3.1.0
- cmake --build .
- sudo cmake --build . --target install
- popd
#
- export PATH=$PATH:$INSTALL_PREFIX/bin
- export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$INSTALL_PREFIX/lib/pkgconfig
- sudo sh -c 'echo "$INSTALL_PREFIX/lib" > /etc/ld.so.conf.d/opencv.conf'
- sudo ldconfig
# show cv pkg info
- pkg-config --modversion opencv
- pkg-config --cflags --libs opencv
before_script:
# create .octaverc file (where we setup path and load required packages on start)
# (due to bug in Octave, we must also add private directories on path)
- touch $OCTAVERC
- echo "crash_dumps_octave_core(false);" >> $OCTAVERC
- echo "more off" >> $OCTAVERC
- if [ "$OCT_STATS" = "yes" ]; then echo "try, pkg load statistics, end" >> $OCTAVERC ; fi
- if [ "$OCT_IMAGE" = "yes" ]; then echo "try, pkg load image, end" >> $OCTAVERC ; fi
- echo "cd('$MCV_ROOT');" >> $OCTAVERC
- echo "addpath('$MCV_ROOT');" >> $OCTAVERC
- echo "addpath(fullfile('$MCV_ROOT','+cv','private'));" >> $OCTAVERC
- echo "addpath(fullfile('$MCV_ROOT','opencv_contrib'));" >> $OCTAVERC
- echo "addpath(fullfile('$MCV_ROOT','opencv_contrib','+cv','private'));" >> $OCTAVERC
- cat $OCTAVERC
script:
# compile mexopencv
- cd $MCV_ROOT
- make $MAKE_OPTS $MAKE_EXTRA all contrib
# build docs
- if [ "$DOXY" = "yes" ]; then make $MAKE_OPTS doc ; fi
# print cv build info
- octave $OCTAVE_OPTS --eval "path, disp(cv.getBuildInformation())"
# run test suite
- make $MAKE_OPTS test