[[OpenCV2.4.10.1のビルド]]
OpenCV 2.4.13 が[[日本時間5月16日深夜にReleaseされた>https://github.com/Itseez/opencv/releases/tag/2.4.13]]
#contents
*概要 [#y8de517f]
-OpenCV2.4.13がReleaseされた。
-OpenCV2.4系列のビルドまとめは今回を最後にする
**今回のターゲット [#s243ad6f]
-Windows 7 64bit Ultimate
-CMake 3.4.3
-Visual Studio 2012
-CUDA 5.5

**ソースコードのダウンロード [#a76d0239]
***git fetch [#s4e018dc]
-割愛
***git checkout [#z4dbaa39]
-TortoiseGit -> Switch/Checkout を選択
#ref(OpenCV2.4.10のビルド/switch_checkout_git.png)
-Tag から 2.4.13を選択
-Branchも、適当な名前で作っておく
#ref(000-switch.png)

**ビルド前準備 [#v984d7c0]
-SourceでOpenCVのリポジトリの場所を指定する
--今回はD:\OpenCV2413
-Buildの場所を指定する
--今回はD:\OpenCV2413\build
#ref(001-cmake.png)
-Configureを押す
--D:\OpenCV2413\buildが無いので作る
#ref(002-cmake.png)
-コンパイラを選ぶ
--今回はVisual Studio 11 2012
#ref(OpenCV3.0.0のビルド/OpenCV300_007_compilerChoice.png)
-しばらく待つ
-Configureが終わったら、GPUのアーキテクチャを指定する
--詳細は[[OpenCV2.4.10.1のビルド#CUDAのアーキテクチャって何?>OpenCV2.4.10.1のビルド#c03bbddb]]を参照
--CUDA_ARCH_BIN → 3.0
--CUDA_ARCH_PTX → 空欄
--にする
#ref(003-cmake.png)
-再度Configureボタンを押す
-終わったら、Generateボタンを押す
#ref(004-cmake.png)
**ソースコードのビルド [#r1b5802a]
-Visual Studio で、D:\OpenCV2413\build\OpenCV.sln を開く
-ビルドの量が多いので、バッチビルドする。
-ビルド(B)→バッチビルド(T)でバッチビルド画面を出す
#ref(005-vs-batch-build.png)
-ALL_BUILDのDebugとReleaseにチェックを付けて、Buildボタンを押す
-全部で1時間45分20秒でビルド終了

**OpenCVビルド時のコンフィグなど [#me914fb4]
***cvconfig.h [#d46cb1fa]
#geshi(c++){{
/* OpenCV compiled as static or dynamic libs */
#define BUILD_SHARED_LIBS

/* Compile for 'real' NVIDIA GPU architectures */
#define CUDA_ARCH_BIN " 30"

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

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

/* Cocoa API */
/* #undef HAVE_COCOA */

/* C= */
/* #undef HAVE_CSTRIPES */

/* NVidia Cuda Basic Linear Algebra Subprograms (BLAS) API*/
/* #undef HAVE_CUBLAS */

/* NVidia Cuda Runtime API*/
#define HAVE_CUDA

/* NVidia Cuda Fast Fourier Transform (FFT) API*/
#define HAVE_CUFFT

/* IEEE1394 capturing support */
/* #undef HAVE_DC1394 */

/* IEEE1394 capturing support - libdc1394 v2.x */
/* #undef HAVE_DC1394_2 */

/* DirectShow Video Capture library */
#define HAVE_DSHOW

/* Eigen Matrix & Linear Algebra Library */
/* #undef HAVE_EIGEN */

/* FFMpeg video library */
#define HAVE_FFMPEG

/* ffmpeg's libswscale */
#define HAVE_FFMPEG_SWSCALE

/* ffmpeg in Gentoo */
#define HAVE_GENTOO_FFMPEG

/* GStreamer multimedia framework */
/* #undef HAVE_GSTREAMER */

/* GTK+ 2.0 Thread support */
/* #undef HAVE_GTHREAD */

/* Windows Runtime support */
/* #undef HAVE_WINRT */

/* Win32 UI */
#define HAVE_WIN32UI

/* GTK+ 2.x toolkit */
/* #undef HAVE_GTK */

/* Apple ImageIO Framework */
/* #undef HAVE_IMAGEIO */

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

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

/* JPEG-2000 codec */
#define HAVE_JASPER

/* IJG JPEG codec */
#define HAVE_JPEG

/* libpng/png.h needs to be included */
/* #undef 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 */

/* NVidia Video Encoding API*/
/* #undef HAVE_NVCUVENC */

/* OpenCL Support */
#define HAVE_OPENCL
/* #undef HAVE_OPENCL_STATIC */

/* OpenEXR codec */
#define HAVE_OPENEXR

/* OpenGL support*/
/* #undef HAVE_OPENGL */

/* OpenNI library */
/* #undef HAVE_OPENNI */

/* PNG codec */
#define HAVE_PNG

/* 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 */
#define HAVE_VFW

/* V4L2 capturing support in videoio.h */
/* #undef HAVE_VIDEOIO */

/* Win32 UI */
#define 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 */
}}
***version_string.inc [#bcb7c93a]
-いつもの 
 General configuration for OpenCV 2.4.13 =====================================
   Version control:               2.4.13
 
   Platform:
     Host:                        Windows 6.1.7601 AMD64
     CMake:                       3.4.3
     CMake generator:             Visual Studio 11 2012
     CMake build tool:            C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe
     MSVC:                        1700
 
   C/C++:
     Built as dynamic libs?:      YES
     C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe  (ver 17.0.61030.0)
     C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /wd4251 /wd4275 /wd4589 /wd4359 /MD /O2 /Ob2 /D NDEBUG  /Zi
     C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /wd4251 /wd4275 /wd4589 /wd4359 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
     C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe
     C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /MD /O2 /Ob2 /D NDEBUG  /Zi
     C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
     Linker flags (Release):      /machine:X86  /INCREMENTAL:NO  /debug
     Linker flags (Debug):        /machine:X86  /debug /INCREMENTAL 
     Precompiled headers:         YES
 
   OpenCV modules:
     To be built:                 core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib stitching superres ts videostab
     Disabled:                    world
     Disabled by dependency:      -
     Unavailable:                 androidcamera dynamicuda java python viz
 
   Windows RT support:            NO
 
   GUI: 
     QT:                          NO
     Win32 UI:                    YES
     OpenGL support:              NO
     VTK support:                 NO
 
   Media I/O: 
     ZLib:                        build (ver 1.2.7)
     JPEG:                        build (ver 62)
     PNG:                         build (ver 1.5.12)
     TIFF:                        build (ver 42 - 4.0.2)
     JPEG 2000:                   build (ver 1.900.1)
     OpenEXR:                     build (ver 1.7.1)
 
   Video I/O:
     Video for Windows:           YES
     DC1394 1.x:                  NO
     DC1394 2.x:                  NO
     FFMPEG:                      YES (prebuilt binaries)
       codec:                     YES (ver 55.18.102)
       format:                    YES (ver 55.12.100)
       util:                      YES (ver 52.38.100)
       swscale:                   YES (ver 2.3.100)
       resample:                  NO
       gentoo-style:              YES
     OpenNI:                      NO
     OpenNI PrimeSensor Modules:  NO
     PvAPI:                       NO
     GigEVisionSDK:               NO
     DirectShow:                  YES
     Media Foundation:            NO
     XIMEA:                       NO
     Intel PerC:                  NO
 
   Other third-party libraries:
     Use IPP:                     NO
     Use Eigen:                   NO
     Use TBB:                     NO
     Use OpenMP:                  NO
     Use GCD                      NO
     Use Concurrency              YES
     Use C=:                      NO
     Use Cuda:                    YES (ver 5.5)
     Use OpenCL:                  YES
 
   NVIDIA CUDA
     Use CUFFT:                   YES
     Use CUBLAS:                  NO
     USE NVCUVID:                 NO
     NVIDIA GPU arch:             30
     NVIDIA PTX archs:
     Use fast math:               NO
     Tiny gpu module:             NO
 
   OpenCL:
     Version:                     dynamic
     Include path:                D:/OpenCV2413/3rdparty/include/opencl/1.2
     Use AMD FFT:                 NO
     Use AMD BLAS:                NO
 
   Python:
     Interpreter:                 NO
 
   Java:
     ant:                         NO
     JNI:                         C:/Program Files (x86)/Java/jdk1.7.0_07/include C:/Program Files (x86)/Java/jdk1.7.0_07/include/win32 C:/Program Files (x86)/Java/jdk1.7.0_07/include
     Java tests:                  NO
 
   Documentation:
     Build Documentation:         NO
     Sphinx:                      NO
     PdfLaTeX compiler:           NO
     Doxygen:                     NO
 
   Tests and samples:
     Tests:                       YES
     Performance tests:           YES
     C/C++ Examples:              NO
 
   Install path:                  D:/OpenCV2413/build/install
 
   cvconfig.h is in:              D:/OpenCV2413/build
 -----------------------------------------------------------------
 
**ビルドに要した時間Top10 [#n905f605]
-TBW

*関連ページ [#g2407c21]
-[[OpenCV3.1のビルド]]
-[[OpenCV3.0.0のビルド]]
-[[OpenCV3.0.0-betaのビルド]]
-[[OpenCV3.0.0-alphaのビルド]]
-[[OpenCV2.4.10.1のビルド]]
-[[OpenCV2.4.10のビルド]]
-[[OpenCV2.4.9のビルド]]
-[[OpenCV2.4.8のビルド]]
-[[OpenCV2.1と2.2に見るビルド方法の違い]]
-[[:OpenCV 2.4]]
-[[:OpenCV]]

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