#contents
*概要 [#sd5f2748]
-[[Tinker Board]]がリリースされたので[[:OpenCV 3.2]]をビルドしてみた
*前提準備 [#beec8b17]
-[[Tinker Board]]を参照
*今回のターゲット [#b81794a5]
-Tinker Board
-Debian 8.7
-Arm Cortex A17 1.8GHz Quad-core
-OpenCV 3.2.0
-cmake 3.6.2
-gcc 4.9.2
*OpenCV の取得 [#s3278870]
-gitでcloneして
-3.2.0をチェックアウトする
-パスは適宜合わせて
linaro@linaro-alip:~$ cd opencv-fork/
linaro@linaro-alip:~/opencv-fork$ time git checkout -b Branch_3_2_0 3.2.0
Switched to a new branch 'Branch_3_2_0'
-詳細は割愛
*OpenCV3.2.0のビルド [#f2539c90]
-NEONの有効性も検証したいので -DENABLE_NEON:BOOL=ON する
-TBW
-cmakeのfull logは[[こちら>https://gist.github.com/tomoaki0705/b4db85f91d7dcb62e2ca7e1d8cce54d6]]
-make allのfull logは[[こちら>https://gist.github.com/tomoaki0705/13e1f7104d96413dcf4b9129324bfd0e]]
**cmake [#b3b59d38]
-[[ODROID-X2でOpenCV 3.1.0をビルド]]同様、out of source buildする
linaro@linaro-alip:~/opencv-fork$ mkdir build
linaro@linaro-alip:~/opencv-fork$ cd build/
linaro@linaro-alip:~/opencv-fork/build$ time cmake -DENABLE_NEON:BOOL=ON ../
(中略)
real 0m50.448s
user 0m33.530s
sys 0m5.060s
**make all [#sc26828e]
-Armの4coreをフルに使う
linaro@linaro-alip:~/opencv-fork/build$ time make -j4 all
(中略)
real 31m24.178s
user 104m26.310s
sys 2m46.940s
-31分でビルド終了
**make install [#a291de04]
-installにはsudoをつける
linaro@linaro-alip:~/opencv-fork/build$ time sudo make install
(割愛)
*OpenCVビルド時のコンフィグなど [#obba1eb6]
**cvconfig.h [#vbd91d2b]
#geshi(c++){{
/* OpenCV compiled as static or dynamic libs */
#define BUILD_SHARED_LIBS
/* Compile for 'real' NVIDIA GPU architectures */
#define CUDA_ARCH_BIN ""
/* Create PTX or BIN for 1.0 compute capability */
/* #undef CUDA_ARCH_BIN_OR_PTX_10 */
/* NVIDIA GPU features are used */
#define CUDA_ARCH_FEATURES ""
/* Compile for 'virtual' NVIDIA PTX architectures */
#define CUDA_ARCH_PTX ""
/* AVFoundation video libraries */
/* #undef HAVE_AVFOUNDATION */
/* V4L capturing support */
/* #undef HAVE_CAMV4L */
/* V4L2 capturing support */
#define HAVE_CAMV4L2
/* Carbon windowing environment */
/* #undef HAVE_CARBON */
/* AMD's Basic Linear Algebra Subprograms Library*/
/* #undef HAVE_CLAMDBLAS */
/* AMD's OpenCL Fast Fourier Transform Library*/
/* #undef HAVE_CLAMDFFT */
/* Clp support */
/* #undef HAVE_CLP */
/* Cocoa API */
/* #undef HAVE_COCOA */
/* C= */
/* #undef HAVE_CSTRIPES */
/* NVidia Cuda Basic Linear Algebra Subprograms (BLAS) API*/
/* #undef HAVE_CUBLAS */
/* NVidia Cuda Runtime API*/
/* #undef HAVE_CUDA */
/* NVidia Cuda Fast Fourier Transform (FFT) API*/
/* #undef HAVE_CUFFT */
/* IEEE1394 capturing support */
/* #undef HAVE_DC1394 */
/* IEEE1394 capturing support - libdc1394 v2.x */
/* #undef HAVE_DC1394_2 */
/* DirectX */
/* #undef HAVE_DIRECTX */
/* #undef HAVE_DIRECTX_NV12 */
/* #undef HAVE_D3D11 */
/* #undef HAVE_D3D10 */
/* #undef HAVE_D3D9 */
/* DirectShow Video Capture library */
/* #undef HAVE_DSHOW */
/* Eigen Matrix & Linear Algebra Library */
/* #undef HAVE_EIGEN */
/* FFMpeg video library */
/* #undef HAVE_FFMPEG */
/* Geospatial Data Abstraction Library */
/* #undef HAVE_GDAL */
/* GStreamer multimedia framework */
/* #undef HAVE_GSTREAMER */
/* GTK+ 2.0 Thread support */
#define HAVE_GTHREAD
/* GTK+ 2.x toolkit */
#define HAVE_GTK
/* Define to 1 if you have the <inttypes.h> header file. */
/* #undef HAVE_INTTYPES_H */
/* Intel Perceptual Computing SDK library */
/* #undef HAVE_INTELPERC */
/* Intel Integrated Performance Primitives */
/* #undef HAVE_IPP */
/* #undef HAVE_IPP_ICV_ONLY */
/* Intel IPP Async */
/* #undef HAVE_IPP_A */
/* JPEG-2000 codec */
#define HAVE_JASPER
/* IJG JPEG codec */
#define HAVE_JPEG
/* libpng/png.h needs to be included */
#define HAVE_LIBPNG_PNG_H
/* GDCM DICOM codec */
/* #undef HAVE_GDCM */
/* V4L/V4L2 capturing support via libv4l */
/* #undef HAVE_LIBV4L */
/* Microsoft Media Foundation Capture library */
/* #undef HAVE_MSMF */
/* NVidia Video Decoding API*/
/* #undef HAVE_NVCUVID */
/* NVidia Video Encoding API*/
/* #undef HAVE_NVCUVENC */
/* OpenCL Support */
#define HAVE_OPENCL
/* #undef HAVE_OPENCL_STATIC */
/* #undef HAVE_OPENCL_SVM */
/* OpenEXR codec */
#define HAVE_OPENEXR
/* OpenGL support*/
/* #undef HAVE_OPENGL */
/* OpenNI library */
/* #undef HAVE_OPENNI */
/* OpenNI library */
/* #undef HAVE_OPENNI2 */
/* PNG codec */
#define HAVE_PNG
/* Posix threads (pthreads) */
#define HAVE_PTHREADS
/* parallel_for with pthreads */
#define HAVE_PTHREADS_PF
/* Qt support */
/* #undef HAVE_QT */
/* Qt OpenGL support */
/* #undef HAVE_QT_OPENGL */
/* QuickTime video libraries */
/* #undef HAVE_QUICKTIME */
/* QTKit video libraries */
/* #undef HAVE_QTKIT */
/* Intel Threading Building Blocks */
/* #undef HAVE_TBB */
/* TIFF codec */
#define HAVE_TIFF
/* Unicap video capture library */
/* #undef HAVE_UNICAP */
/* Video for Windows support */
/* #undef HAVE_VFW */
/* V4L2 capturing support in videoio.h */
/* #undef HAVE_VIDEOIO */
/* Win32 UI */
/* #undef HAVE_WIN32UI */
/* XIMEA camera support */
/* #undef HAVE_XIMEA */
/* Xine video library */
/* #undef HAVE_XINE */
/* Define if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* gPhoto2 library */
/* #undef HAVE_GPHOTO2 */
/* VA library (libva) */
/* #undef HAVE_VA */
/* Intel VA-API/OpenCL */
/* #undef HAVE_VA_INTEL */
/* Lapack */
/* #undef HAVE_LAPACK */
/* FP16 */
#define HAVE_FP16
/* Library was compiled with functions instrumentation */
/* #undef ENABLE_INSTRUMENTATION */
/* OpenVX */
/* #undef HAVE_OPENVX */
}}
**version_string.inc [#ce2aa6f5]
General configuration for OpenCV 3.2.0 =====================================
Version control: 3.1.0-2152-g70bbf17b1
Platform:
Timestamp: 2017-03-16T08:22:02Z
Host: Linux 4.4.16 armv7l
CMake: 3.6.2
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/c++ (ver 4.9.2)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfp16-format=ieee -mfpu=neon -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -mfpu=neon-fp16 -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfp16-format=ieee -mfpu=neon -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -mfpu=neon-fp16 -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/cc
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfp16-format=ieee -mfpu=neon -ffunction-sections -fvisibility=hidden -mfpu=neon-fp16 -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfp16-format=ieee -mfpu=neon -ffunction-sections -fvisibility=hidden -mfpu=neon-fp16 -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
ccache: NO
Precompiled headers: YES
Extra dependencies: /usr/lib/arm-linux-gnueabihf/libpng.so /usr/lib/arm-linux-gnueabihf/libz.so gtk-x11-2.0 gdk-x11-2.0 pangocairo-1.0 atk-1.0 cairo gdk_pixbuf-2.0 gio-2.0 pangoft2-1.0 pango-1.0 gobject-2.0 fontconfig freetype gthread-2.0 glib-2.0 dl m pthread rt
3rdparty dependencies: libjpeg libwebp libtiff libjasper IlmImf tegra_hal
OpenCV modules:
To be built: core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d stitching videostab
Disabled: world
Disabled by dependency: -
Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz
GUI:
QT: NO
GTK+ 2.x: YES (ver 2.24.25)
GThread : YES (ver 2.48.0)
GtkGlExt: NO
OpenGL support: NO
VTK support: NO
Media I/O:
ZLib: /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.8)
JPEG: libjpeg (ver 90)
WEBP: build (ver 0.3.1)
PNG: /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.2.50)
TIFF: build (ver 42 - 4.0.2)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
GDAL: NO
GDCM: NO
Video I/O:
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: NO
avcodec: NO
avformat: NO
avutil: NO
swscale: NO
avresample: NO
GStreamer: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
OpenNI2: NO
PvAPI: NO
GigEVisionSDK: NO
Aravis SDK: NO
UniCap: NO
UniCap ucil: NO
V4L/V4L2: NO/YES
XIMEA: NO
Xine: NO
gPhoto2: NO
Parallel framework: pthreads
Other third-party libraries:
Use IPP: NO
Use VA: NO
Use Intel VA-API/OpenCL: NO
Use Lapack: NO
Use Eigen: NO
Use Cuda: NO
Use OpenCL: YES
Use OpenVX: NO
Use custom HAL: YES (carotene (ver 0.0.1))
OpenCL: <Dynamic loading of OpenCL library>
Include path: /home/linaro/opencv-fork/3rdparty/include/opencl/1.2
Use AMDFFT: NO
Use AMDBLAS: NO
Python 2:
Interpreter: /usr/bin/python2.7 (ver 2.7.9)
Python 3:
Interpreter: /usr/bin/python3.4 (ver 3.4.2)
Python (for build): /usr/bin/python2.7
Java:
ant: NO
JNI: NO
Java wrappers: NO
Java tests: NO
Matlab: Matlab not found or implicitly disabled
Documentation:
Doxygen: NO
Tests and samples:
Tests: YES
Performance tests: YES
C/C++ Examples: NO
Install path: /usr/local
cvconfig.h is in: /home/linaro/opencv-fork/build
-----------------------------------------------------------------
*ビルドされたライブラリや実行ファイル [#ec313575]
-TBW
*performance [#uad79260]
-一応、ボードの形状で互換性を持つRaspberry Pi 3 と比較してみる
-OpenCV 3.2.0 のビルド時間で見ると、
|Platform|Builid duration|
|Raspberry Pi 3|56m16.801s|
|Tinker Board|31m24.178s|
-と、Tinker Boardの方が半分近い時間でビルドが終了している
-CPUのベースクロックがRPi3(1.2GHz) VS TinkerBoard(1.8GHz)なので、流石にその差が出たか
-ただし、ディスクI/Oもかなり足を引っ張ってるはずなので、ビルドに要した時間はあくまで目安
*関連ページ [#ye230449]
-[[:OpenCV]]
-[[:OpenCV 3.0]]
-[[:OpenCV 3.1]]
-[[:OpenCV 3.2]]
-[[Tinker Board]]
-[[Raspberry Pi 3でOpenCV3.2.0をビルド]]