This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 319
/
.travis.yml
157 lines (139 loc) · 5.58 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
#
# Travis CI build script.
# https://travis-ci.org/kyamagu/mexopencv
#
language: cpp
compiler: gcc
os: linux
# Ubuntu image: 14.04 (Trusty) LTS Server Edition 64-bit
dist: trusty
# full Ubuntu VM (sudo enabled) vs. container-based environment
sudo: required
# shallow-ish clone (default 50)
git:
depth: 3
# whitelisted branches to build
branches:
only:
- master
# global environment variables
env:
global:
# OpenCV build options
# (CMake generators: "Unix Makefiles", "Ninja")
- CMAKE_GEN=Ninja
- INSTALL_PREFIX=/usr/local
# Octave options + optional Octave-Forge packages to install
# (Note: latest image/stats packages require a C++11 compiler to build,
# Trusty has gcc-4.8 and must explicitly pass -std=c++11)
- OCTAVE_OPTS="--no-gui --no-window-system --no-init-file --quiet"
- OCT_IMAGE=yes
- OCT_STATS=yes
- CXXFLAGS="-std=c++11"
# mexopencv options
# (Note: dont use too many Make parallel jobs on VM)
- MCV_ROOT=$(pwd)
- MAKE_OPTS="WITH_OCTAVE=true WITH_CONTRIB=true"
- MAKE_EXTRA=-j2
- WITH_DOXY=yes
install:
#HACK: Travis adds a PPA for Redis, but it also contains GraphicsMagick lib
# which conflicts with the one Octave was compiled against, so we remove it
- sudo rm -f /etc/apt/sources.list.d/rwky-redis.list
# third-party PPA with Octave 4.2.2
- sudo add-apt-repository -y ppa:octave/stable
- sudo apt-get update -qq
# 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 [ "$WITH_DOXY" = "yes" ]; then sudo apt-get install -y doxygen ; fi
# install Octave + optional statistics/image packages
- sudo apt-get install -y octave liboctave-dev
- if [ "$OCT_IMAGE" = "yes" ]; then sudo apt-get install -y octave-image ; fi
- if [ "$OCT_STATS" = "yes" ]; then octave-cli $OCTAVE_OPTS --eval "try, pkg install -forge -local io statistics, end" ; fi
# install some OpenCV dependencies
- sudo apt-get install -y zlib1g-dev libjpeg8-dev libpng12-dev libtiff5-dev libjasper-dev libopenexr-dev
- sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
- sudo apt-get install -y libv4l-dev libdc1394-22-dev libxine2-dev libgphoto2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
- sudo apt-get install -y libgtk2.0-dev libtbb-dev libeigen3-dev libblas-dev liblapack-dev liblapacke-dev libatlas-base-dev
- sudo apt-get install -y libhdf5-dev libprotobuf-dev libgflags-dev libgoogle-glog-dev
#- sudo apt-get install -y tesseract-ocr libtesseract-dev libleptonica-dev
#- sudo apt-get install -y libgdcm2-dev libgdal-dev
#- sudo apt-get install -y libgtk-3-dev libvtk6-dev libopenblas-dev
# build OpenCV 3.4.1 from source (opencv + opencv_contrib)
- mkdir $HOME/cv && pushd $HOME/cv
- wget -O opencv-3.4.1.zip https://github.com/opencv/opencv/archive/3.4.1.zip
- wget -O opencv_contrib-3.4.1.zip https://github.com/opencv/opencv_contrib/archive/3.4.1.zip
- unzip opencv-3.4.1.zip > /dev/null
- unzip opencv_contrib-3.4.1.zip > /dev/null
- mkdir build && cd build
- cmake -G "$CMAKE_GEN" -Wno-dev
-DBUILD_DOCS:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_PACKAGE:BOOL=OFF
-DBUILD_PERF_TESTS:BOOL=OFF
-DBUILD_TESTS:BOOL=OFF
-DBUILD_WITH_DEBUG_INFO:BOOL=OFF
-DBUILD_ITT:BOOL=OFF
-DBUILD_JAVA:BOOL=OFF
-DCV_TRACE:BOOL=OFF
-DENABLE_PYLINT:BOOL=OFF
-DENABLE_CXX11:BOOL=ON
-DWITH_CUDA:BOOL=OFF
-DWITH_CUBLAS:BOOL=OFF
-DWITH_CUFFT:BOOL=OFF
-DWITH_NVCUVID:BOOL=OFF
-DWITH_ITT:BOOL=OFF
-DWITH_MATLAB:BOOL=OFF
-DWITH_OPENCL:BOOL=OFF
-DWITH_VTK:BOOL=OFF
-DBUILD_opencv_apps:BOOL=OFF
-DBUILD_opencv_cudaarithm:BOOL=OFF
-DBUILD_opencv_cudabgsegm:BOOL=OFF
-DBUILD_opencv_cudacodec:BOOL=OFF
-DBUILD_opencv_cudafeatures2d:BOOL=OFF
-DBUILD_opencv_cudafilters:BOOL=OFF
-DBUILD_opencv_cudaimgproc:BOOL=OFF
-DBUILD_opencv_cudalegacy:BOOL=OFF
-DBUILD_opencv_cudaobjdetect:BOOL=OFF
-DBUILD_opencv_cudaoptflow:BOOL=OFF
-DBUILD_opencv_cudastereo:BOOL=OFF
-DBUILD_opencv_cudawarping:BOOL=OFF
-DBUILD_opencv_cudev:BOOL=OFF
-DBUILD_opencv_java:BOOL=OFF
-DBUILD_opencv_java_bindings_generator:BOOL=OFF
-DBUILD_opencv_js:BOOL=OFF
-DBUILD_opencv_python2:BOOL=OFF
-DBUILD_opencv_python3:BOOL=OFF
-DBUILD_opencv_python_bindings_generator:BOOL=OFF
-DBUILD_opencv_ts:BOOL=OFF
-DBUILD_opencv_viz:BOOL=OFF
-DBUILD_opencv_world:BOOL=OFF
-DBUILD_opencv_matlab:BOOL=OFF
-DBUILD_opencv_ccalib:BOOL=OFF
-DBUILD_opencv_cvv:BOOL=OFF
-DBUILD_opencv_hdf:BOOL=OFF
-DBUILD_opencv_ovis:BOOL=OFF
-DBUILD_opencv_sfm:BOOL=OFF
-DBUILD_opencv_structured_light:BOOL=OFF
-DBUILD_opencv_surface_matching:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
-DOPENCV_ENABLE_NONFREE:BOOL=ON
-DOPENCV_EXTRA_MODULES_PATH:PATH=$HOME/cv/opencv_contrib-3.4.1/modules $HOME/cv/opencv-3.4.1
- cmake --build .
- sudo cmake --build . --target install
- popd
# finish OpenCV installation
- 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
script:
# compile mexopencv
- cd $MCV_ROOT
- make $MAKE_OPTS $MAKE_EXTRA all contrib
# build docs
- if [ "$WITH_DOXY" = "yes" ]; then make $MAKE_OPTS doc ; fi
# run test suite
- make $MAKE_OPTS test