[[:OpenCV]]

#contents
*概要 [#xb7cef32]
-[[:OpenCV 3.4]]がリリースされたので、[[HiKey]]でビルドしてみた
*前提準備 [#m426ac83]
-[[HiKey]]を参照
*今回のターゲット [#n58941b4]
-HiKey
-OS:Debian Jessie (8.2)
-CPU:Arm Cortex-A53 Octa core 1.2GHz
-OpenCV 3.4.0
-cmake 3.0.2
-gcc 4.9.2
*OpenCV の取得 [#jb60d12d]
-gitでcloneして
-3.4.0をチェックアウトする
-パスは適宜合わせて
 ~$ time git clone git@github.com:opencv/opencv.git opencv-fork
 ~$ cd opencv-fork/
 ~/opencv-fork$ time git checkout -b Branch_3_4_0 3.4.0
 Switched to a new branch 'Branch_3_4_0'
-詳細は割愛
*OpenCV3.4.0のビルド [#sb5a81c9]
-cmakeのfull logは[[こちら>https://gist.github.com/tomoaki0705/5b19baa09a9882317c711145586deaa0]]
-make allのfull logは[[こちら>https://gist.github.com/tomoaki0705/232b88976a78dc7327bf75b70538482e]]
**cmake [#j164db96]
-[[ODROID-X2でOpenCV 3.1.0をビルド]]同様、out of source buildする 
 ~/opencv-fork$ mkdir build
 ~/opencv-fork$ cd build
 ~/opencv-fork/build$ time cmake ..
 (中略)
 real   2m17.585s
 user   1m23.120s
 sys    0m16.280s
**make all [#o2ae4ee0]
-3コアを使ったビルドする
-フルに8コア使うと途中でgccがクラッシュする
 ~/opencv-fork/build$ time make -j 3 all
 (中略)
 real   135m41.731s
 user   383m14.310s
 sys    14m26.830s
**make install [#i546f9af]
-割愛
*OpenCVビルド時のコンフィグなど [#p7000a8f]
**cvconfig.h [#b1366739]
#geshi(c++){{
#ifndef OPENCV_CVCONFIG_H_INCLUDED
#define OPENCV_CVCONFIG_H_INCLUDED

/* OpenCV compiled as static or dynamic libs */
#define BUILD_SHARED_LIBS

/* OpenCV intrinsics optimized code */
#define CV_ENABLE_INTRINSICS

/* OpenCV additional optimized code */
/* #undef CV_DISABLE_OPTIMIZATION */

/* 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

/* Halide support */
/* #undef HAVE_HALIDE */

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Intel Perceptual Computing SDK library */
/* #undef HAVE_INTELPERC */

/* Intel Integrated Performance Primitives */
/* #undef HAVE_IPP */
/* #undef HAVE_IPP_ICV */
/* #undef HAVE_IPP_IW */

/* 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_PTHREAD

/* 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 */

/* Intel Media SDK */
/* #undef HAVE_MFX */

/* Lapack */
/* #undef HAVE_LAPACK */

/* Library was compiled with functions instrumentation */
/* #undef ENABLE_INSTRUMENTATION */

/* OpenVX */
/* #undef HAVE_OPENVX */

#if defined(HAVE_XINE)         || \
    defined(HAVE_GSTREAMER)    || \
    defined(HAVE_QUICKTIME)    || \
    defined(HAVE_QTKIT)        || \
    defined(HAVE_AVFOUNDATION) || \
    /*defined(HAVE_OPENNI)     || too specialized */ \
    defined(HAVE_FFMPEG)       || \
    defined(HAVE_MSMF)
#define HAVE_VIDEO_INPUT
#endif

#if /*defined(HAVE_XINE)       || */\
    defined(HAVE_GSTREAMER)    || \
    defined(HAVE_QUICKTIME)    || \
    defined(HAVE_QTKIT)        || \
    defined(HAVE_AVFOUNDATION) || \
    defined(HAVE_FFMPEG)       || \
    defined(HAVE_MSMF)
#define HAVE_VIDEO_OUTPUT
#endif

/* OpenCV trace utilities */
#define OPENCV_TRACE


#endif // OPENCV_CVCONFIG_H_INCLUDED
}}
**opencv_version -v [#mb22187d]
 General configuration for OpenCV 3.4.0 =====================================
   Version control:               3.4.0
 
   Platform:
     Timestamp:                   2018-02-20T05:02:11Z
     Host:                        Linux 3.18.0-linaro-hikey aarch64
     CMake:                       3.0.2
     CMake generator:             Unix Makefiles
     CMake build tool:            /usr/bin/make
     Configuration:               Release
 
   CPU/HW features:
     Baseline:                    NEON
       requested:                 NEON FP16
       required:                  NEON
       disabled:                  VFPV3
 
   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 -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-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 -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-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 -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-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 -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections   -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
     Linker flags (Release):      
     Linker flags (Debug):        
     ccache:                      YES
     Precompiled headers:         NO
     Extra dependencies:          dl m pthread rt
     3rdparty dependencies:
 
   OpenCV modules:
     To be built:                 calib3d core dnn features2d flann highgui imgcodecs imgproc ml objdetect photo python_bindings_generator shape stitching superres ts video videoio videostab
     Disabled:                    js world
     Disabled by dependency:      -
     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz
     Applications:                tests perf_tests apps
     Documentation:               NO
     Non-free algorithms:         NO
 
   GUI: 
     GTK+:                        YES (ver 3.14.5)
       GThread :                  YES (ver 2.42.1)
       GtkGlExt:                  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 encoder: 0x020e)
     PNG:                         /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.2.50)
     TIFF:                        build (ver 42 - 4.0.9)
     JPEG 2000:                   build (ver 1.900.1)
     OpenEXR:                     build (ver 1.7.1)
 
   Video I/O:
     DC1394:                      NO
     FFMPEG:                      NO
       avcodec:                   NO
       avformat:                  NO
       avutil:                    NO
       swscale:                   NO
       avresample:                NO
     GStreamer:                   NO
     libv4l/libv4l2:              NO
     v4l/v4l2:                    linux/videodev2.h
     gPhoto2:                     NO
 
   Parallel framework:            pthreads
 
   Trace:                         YES (built-in)
 
   Other third-party libraries:
     Lapack:                      NO
     Eigen:                       NO
     Custom HAL:                  YES (carotene (ver 0.0.1))
 
   NVIDIA CUDA:                   NO
 
   OpenCL:                        YES (no extra features)
     Include path:                /home/linaro/opencv-fork/3rdparty/include/opencl/1.2
     Link libraries:              Dynamic load
 
   Python (for build):            /usr/bin/python2.7
 
   Java:
     ant:                         NO
     JNI:                         NO
     Java wrappers:               NO
     Java tests:                  NO
 
   Matlab:                        NO
 
   Install to:                    /usr/local
 -----------------------------------------------------------------

*ビルドされたライブラリや実行ファイル [#be58c07d]
 -rwxr-xr-x 1 linaro linaro   33848 Feb 20 14:53 opencv_annotation
 -rwxr-xr-x 1 linaro linaro   64560 Feb 20 16:15 opencv_createsamples
 -rwxr-xr-x 1 linaro linaro  182568 Feb 20 16:15 opencv_interactive-calibration
 -rwxr-xr-x 1 linaro linaro  998424 Feb 20 16:05 opencv_perf_calib3d
 -rwxr-xr-x 1 linaro linaro 4207144 Feb 20 15:27 opencv_perf_core
 -rwxr-xr-x 1 linaro linaro  854024 Feb 20 15:55 opencv_perf_dnn
 -rwxr-xr-x 1 linaro linaro 1042032 Feb 20 16:02 opencv_perf_features2d
 -rwxr-xr-x 1 linaro linaro  519040 Feb 20 15:55 opencv_perf_imgcodecs
 -rwxr-xr-x 1 linaro linaro 4924408 Feb 20 15:47 opencv_perf_imgproc
 -rwxr-xr-x 1 linaro linaro  679344 Feb 20 15:45 opencv_perf_objdetect
 -rwxr-xr-x 1 linaro linaro  711136 Feb 20 15:48 opencv_perf_photo
 -rwxr-xr-x 1 linaro linaro 1194416 Feb 20 16:18 opencv_perf_stitching
 -rwxr-xr-x 1 linaro linaro  687056 Feb 20 16:00 opencv_perf_superres
 -rwxr-xr-x 1 linaro linaro 1151376 Feb 20 15:53 opencv_perf_video
 -rwxr-xr-x 1 linaro linaro  521688 Feb 20 15:59 opencv_perf_videoio
 -rwxr-xr-x 1 linaro linaro 2083160 Feb 20 16:14 opencv_test_calib3d
 -rwxr-xr-x 1 linaro linaro 6123952 Feb 20 15:34 opencv_test_core
 -rwxr-xr-x 1 linaro linaro 1293008 Feb 20 15:58 opencv_test_dnn
 -rwxr-xr-x 1 linaro linaro 1271152 Feb 20 16:05 opencv_test_features2d
 -rwxr-xr-x 1 linaro linaro  515920 Feb 20 15:19 opencv_test_flann
 -rwxr-xr-x 1 linaro linaro  479728 Feb 20 16:00 opencv_test_highgui
 -rwxr-xr-x 1 linaro linaro  962592 Feb 20 15:59 opencv_test_imgcodecs
 -rwxr-xr-x 1 linaro linaro 5401040 Feb 20 15:53 opencv_test_imgproc
 -rwxr-xr-x 1 linaro linaro  896624 Feb 20 15:38 opencv_test_ml
 -rwxr-xr-x 1 linaro linaro  693664 Feb 20 15:47 opencv_test_objdetect
 -rwxr-xr-x 1 linaro linaro  951592 Feb 20 15:52 opencv_test_photo
 -rwxr-xr-x 1 linaro linaro  546400 Feb 20 15:59 opencv_test_shape
 -rwxr-xr-x 1 linaro linaro  625864 Feb 20 16:17 opencv_test_stitching
 -rwxr-xr-x 1 linaro linaro  455544 Feb 20 16:00 opencv_test_superres
 -rwxr-xr-x 1 linaro linaro 1064544 Feb 20 15:57 opencv_test_video
 -rwxr-xr-x 1 linaro linaro  642608 Feb 20 16:00 opencv_test_videoio
 -rwxr-xr-x 1 linaro linaro  510576 Feb 20 16:16 opencv_test_videostab
 -rwxr-xr-x 1 linaro linaro  409688 Feb 20 16:14 opencv_traincascade
 -rwxr-xr-x 1 linaro linaro   15208 Feb 20 14:54 opencv_version
 -rwxr-xr-x 1 linaro linaro   60200 Feb 20 14:54 opencv_visualisation

*関連ページ [#bf062158]
-[[:OpenCV]]
-[[:OpenCV 3.0]]
-[[:OpenCV 3.4]]
-[[HiKey]]
-[[Arm]]

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS