-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
103 lines (82 loc) · 4.17 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
language: cpp
os: linux
dist: bionic
compiler: gcc
env:
global:
# Dependencies
- DEPS_DIR="`readlink -f $TRAVIS_BUILD_DIR/..`"
- OPENCV_BUILD_DIR=$DEPS_DIR/opencv/build
before_install:
- which python
- python --version
# OpenCV
#-------------
# Anaconda doesn't support conda install opencv & binstart wasn't working
# so instead we download and build from source. The only other trick is making
# sure we move the correct files to the correct Python installation, which is
# done via specifying PYTHON_PACKAGES_PATH
# - @JimHokanson
#
# References:
# https://github.com/kevin-brown/blog.kevin-brown.com/blob/
# 2d5296a8c1ac76dc5cbd2b98d765749c043fc521/_posts/
# 2014-09-27-building-and-installing-opencv-3.markdown
# https://github.com/kashefy/elm/blob/
# 76dbd0214dbab91a7de3bdd94767ef08aa67d0f4/.travis.yml
# 1) Get from source, currently master is v3.0.0 (supporting Python 3)
- travis_retry git clone --depth 1 https://github.com/Itseez/opencv.git $DEPS_DIR/opencv
- mkdir $OPENCV_BUILD_DIR && cd $OPENCV_BUILD_DIR
# https://scivision.co/anaconda-python-opencv3/
# ------------------------------------------
- cmake -DBUILD_TIFF=ON -DBUILD_opencv_java=OFF -DWITH_CUDA=OFF -DENABLE_AVX=ON -DWITH_OPENGL=ON -DWITH_OPENCL=ON -DWITH_IPP=ON -DWITH_TBB=ON -DWITH_EIGEN=ON -DWITH_V4L=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") -DPYTHON_EXECUTABLE=$(which python3) -DPYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") ..
- make -j4
- sudo make install
- cd / #return to home dir 0824
- pwd
# https://gist.github.com/itguy51/4239282
# ------------------------------------------
- echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/opencv.conf
- sudo ldconfig
- echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig" | sudo tee -a /etc/bash.bashrc
- echo "export PKG_CONFIG_PATH" | sudo tee -a /etc/bash.bashrc
- export PYTHONPATH=$OPENCV_BUILD_DIR/lib/python3.3/site-packages:$PYTHONPATH
# configure opencv.pc add Jack
#cd /usr/local/lib
# CICD ENV INSTALL LIB IN DIFFERENT DIR!!!SO CHANGE TO TEST.
- cd /usr/lib/x86_64-linux-gnu
#containing the dir
# sudo mkdir pkgconfig
- cd pkgconfig
- sudo touch opencv.pc
- echo "prefix=/usr/lib/x86_64-linux-gnu exec_prefix=${prefix}" | sudo tee -a opencv.pc
- echo "libdir=/usr/lib/x86_64-linux-gnu" | sudo tee -a opencv.pc
# echo "libdir=/usr/local/lib" | sudo tee -a opencv.pc
- echo "includedir_old=/usr/include/opencv4" | sudo tee -a opencv.pc
- echo "includedir_new=/usr/include" | sudo tee -a opencv.pc
- echo "Name:OpenCV" | sudo tee -a opencv.pc
#must add Version ,否则会报Package 'opencv' has no Name: field ,然后编译会出错!!
- echo "Description:Open Source Computer Vision Library" | sudo tee -a opencv.pc
- echo "Version:4.1.0" | sudo tee -a opencv.pc
- echo "Libs:-L/usr/lib/x86_64-linux-gnu -lopencv_gapi -lopencv_stitching -lopencv_dnn -lopencv_video -lopencv_ml -lopencv_objdetect -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_flann -lopencv_photo -lopencv_imgproc -lopencv_core" | sudo tee -a opencv.pc
#echo "Libs: -L${exec_prefix}/lib -lopencv_world" | sudo tee -a opencv.pc
#- echo "Libs.private: -ldl -lm -lpthread -lrt" | sudo tee -a opencv.pc
#- echo "Cflags: -I${includedir_old} -I${includedir_new}" | sudo tee -a opencv.pc
- cd /usr/include/opencv4/opencv2
- ls -alh
- cd /usr/lib/x86_64-linux-gnu
- ls -alh
- cd /usr/lib/x86_64-linux-gnu/pkgconfig
- ls -alh
- cat opencv.pc
- pkg-config --modversion opencv
#Name: OpenCV
#Description: Open Source Computer Vision Library
#Version: 4.1.0
script:
# chmod +x opencv_install.sh
# ./opencv_install.sh
- cd $TRAVIS_BUILD_DIR/videoRecord
- make
- cd $TRAVIS_BUILD_DIR/cam10min_OPENCV4
- make