#contents
*概要 [#ud65d627]
-[[ODROID-C2]]がリリースされたのでOpenCV 3.1.0 をインストールしてみた
*前提準備 [#n140f457]
-[[ODROID-C2]]を参照
*今回のターゲット [#fc84c217]
-ODROID-C2
-Ubuntu 16.04 64bit
-Arm Cortex A53 2.0GHz Quad-core
*OpenCV の取得 [#vddb5d1b]
-まずはgitでcloneする
odroid@odroid64:~$ time git clone git@github.com:Itseez/opencv.git
Cloning into 'opencv'...
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
remote: Counting objects: 187058, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 187058 (delta 11), reused 8 (delta 8), pack-reused 187030
Receiving objects: 100% (187058/187058), 410.00 MiB | 595.00 KiB/s, done.
Resolving deltas: 100% (127972/127972), done.
Checking connectivity... done.
Checking out files: 100% (4685/4685), done.
real 9m11.888s
user 0m55.950s
sys 0m13.220s
-そして、3.1.0をチェックアウトする
odroid@odroid64:~$ cd opencv/
odroid@odroid64:~/opencv$ time git checkout -b Branch_3_1_0 3.1.0
Switched to a new branch 'Branch_3_1_0'
real 0m0.596s
user 0m0.470s
sys 0m0.120s
*OpenCV3.1.0のビルド [#q0394138]
-aarch64からはNEONを有効化しなくても良いので、いつも付けてるENABLE_NEONは付けない。
-examplesのビルドだけ追加
-あと、libgtkを入れ忘れてたので、入れなおして再ビルド、再インストール
-cmakeのfull logは[[こちら>https://gist.github.com/tomoaki0705/a6180db22ad49670a2cf]]
-make allのfull logは[[こちら>https://gist.github.com/tomoaki0705/06ac3141e695d0621e84]]
-make installのfull logは[[こちら>https://gist.github.com/tomoaki0705/5d8f0004e29dd5534a54]]
**cmake [#gcdc8ec5]
-[[ODROID-X2でOpenCV 3.1.0をビルド]]同様、out of source buildする
odroid@odroid64:~/opencv$ mkdir build
odroid@odroid64:~/opencv$ cd build
odroid@odroid64:~/opencv/build$ time cmake -DBUILD_EXAMPLES:BOOL=ON ../
(中略)
real 0m54.016s
user 0m39.340s
sys 0m7.350s
**make all [#pe24b5cf]
-Armの4coreをフルに使う
odroid@odroid64:~/opencv/build$ time make -j4 all
(中略)
real 44m54.369s
user 154m57.100s
sys 7m9.000s
-ざっくり45分ぐらいかかる
**make install [#r27901a0]
-installにはsudoをつける
odroid@odroid64:~/opencv/build$ time sudo make install
real 1m29.533s
user 0m12.790s
sys 0m5.210s
*OpenCVビルド時のコンフィグなど [#e243b72b]
**cvconfig.h [#e1dd8ac9]
#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 */
/* ffmpeg's libswscale */
/* #undef HAVE_FFMPEG_SWSCALE */
/* ffmpeg in Gentoo */
/* #undef HAVE_GENTOO_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
/* V4L/V4L2 capturing support via libv4l */
/* #undef HAVE_LIBV4L */
/* Microsoft Media Foundation Capture library */
/* #undef HAVE_MSMF */
/* NVidia Video Decoding API*/
/* #undef HAVE_NVCUVID */
/* 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 */
}}
**version_string.inc [#k224d723]
General configuration for OpenCV 3.1.0 =====================================
Version control: 3.1.0
Platform:
Host: Linux 3.14.29-37 aarch64
CMake: 3.2.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 5.3.1)
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 -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -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 -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -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 -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -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 -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
Precompiled headers: YES
Extra dependencies: /usr/lib/aarch64-linux-gnu/libpng.so /usr/lib/aarch64-linux-gnu/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
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.30)
GThread : YES (ver 2.47.92)
GtkGlExt: NO
OpenGL support: NO
VTK support: NO
Media I/O:
ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.8)
JPEG: libjpeg (ver 90)
WEBP: build (ver 0.3.1)
PNG: /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.2.54)
TIFF: build (ver 42 - 4.0.2)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
GDAL: NO
Video I/O:
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: NO
codec: NO
format: NO
util: NO
swscale: NO
resample: NO
gentoo-style: NO
GStreamer: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
OpenNI2: NO
PvAPI: NO
GigEVisionSDK: 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 Eigen: NO
Use Cuda: NO
Use OpenCL: YES
Use custom HAL: NO
OpenCL:
Version: dynamic
Include path: /home/odroid/opencv/3rdparty/include/opencl/1.2
Use AMDFFT: NO
Use AMDBLAS: NO
Python 2:
Interpreter: /usr/bin/python2.7 (ver 2.7.11)
Python 3:
Interpreter: /usr/bin/python3 (ver 3.5.1)
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
PlantUML: NO
Tests and samples:
Tests: YES
Performance tests: YES
C/C++ Examples: YES
Install path: /usr/local
cvconfig.h is in: /home/odroid/opencv/build
-----------------------------------------------------------------
*ビルドされたライブラリや実行ファイル [#u5be0baf]
-TBW
*performance [#c3fd61bc]
-TBW
*その他 [#s3a46228]
-自身初の64bitかつArm上でのビルド
-ちゃんとcmakeのログにaarch64と表示されてたりする
-CMakeのログでは、Test HAVE_CXX_MFPU_NEONがFailedになっている。
--これはaarch64 (64bitArm)ではNEONはオプショナルではなくなったことに起因する
--aarch64のgccはmfpuオプションがそもそも削除されており、オプション無しでNEONもhalfも有効化されている
--OpenCVのCMakeLists.txt内でもその点考慮されており、ENABLE_NEONオプションに関わらず、aarch64プラットフォームではNEONが有効化される
*関連ページ [#e19868ec]
-[[:OpenCV]]
-[[:OpenCV 3.0]]
-[[:OpenCV 3.1]]
-[[ODROID-C2]]
-[[Arm]]