Last active
November 9, 2015 06:04
-
-
Save atinfinity/4e2f831cd078294cd541 to your computer and use it in GitHub Desktop.
OpenCV 2.4.9ビルド用バッチファイル(VS2012/64bit/WITH_CUDA)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: setting of the environment variables | |
set SOURCE_DIR=%~dp0 | |
set BUILD_DIR=%SOURCE_DIR%\build | |
set INSTALL_DIR=%BUILD_DIR%\install | |
set VC_VERSION_NUM=11 | |
set VCVARSALL_BAT="C:\Program Files (x86)\Microsoft Visual Studio %VC_VERSION_NUM%.0\VC\vcvarsall.bat" | |
set ARCH=amd64 | |
set GENERATOR_NAME=Visual Studio %VC_VERSION_NUM% Win64 | |
call %VCVARSALL_BAT% %ARCH% | |
mkdir build | |
cd build | |
:: runnig CMake | |
cmake.exe ^ | |
-G "%GENERATOR_NAME%" ^ | |
--build "%BUILD_DIR%" ^ | |
-D BUILD_DOCS=OFF ^ | |
-D BUILD_EXAMPLES=OFF ^ | |
-D BUILD_JASPER=ON ^ | |
-D BUILD_JPEG=ON ^ | |
-D BUILD_OPENEXR=ON ^ | |
-D BUILD_PACKAGE=ON ^ | |
-D BUILD_PERF_TESTS=OFF ^ | |
-D BUILD_PNG=ON ^ | |
-D BUILD_SHARED_LIBS=ON ^ | |
-D BUILD_TBB=OFF ^ | |
-D BUILD_TESTS=OFF ^ | |
-D BUILD_TIFF=ON ^ | |
-D BUILD_WITH_DEBUG_INFO=ON ^ | |
-D BUILD_WITH_STATIC_CRT=ON ^ | |
-D BUILD_ZLIB=ON ^ | |
-D BUILD_opencv_apps=ON ^ | |
-D BUILD_opencv_calib3d=ON ^ | |
-D BUILD_opencv_contrib=ON ^ | |
-D BUILD_opencv_core=ON ^ | |
-D BUILD_opencv_features2d=ON ^ | |
-D BUILD_opencv_flann=ON ^ | |
-D BUILD_opencv_gpu=ON ^ | |
-D BUILD_opencv_highgui=ON ^ | |
-D BUILD_opencv_imgproc=ON ^ | |
-D BUILD_opencv_java=OFF ^ | |
-D BUILD_opencv_legacy=ON ^ | |
-D BUILD_opencv_ml=ON ^ | |
-D BUILD_opencv_nonfree=ON ^ | |
-D BUILD_opencv_objdetect=ON ^ | |
-D BUILD_opencv_photo=ON ^ | |
-D BUILD_opencv_python=OFF ^ | |
-D BUILD_opencv_stitching=ON ^ | |
-D BUILD_opencv_superres=ON ^ | |
-D BUILD_opencv_ts=ON ^ | |
-D BUILD_opencv_video=ON ^ | |
-D BUILD_opencv_videostab=ON ^ | |
-D BUILD_opencv_viz=OFF ^ | |
-D BUILD_opencv_world=OFF ^ | |
-D CMAKE_CONFIGURATION_TYPES="Debug;Release" ^ | |
-D CMAKE_INSTALL_PREFIX="%INSTALL_DIR%" ^ | |
-D CMAKE_CXX_FLAGS="/DWIN32 /D_WINDOWS /W3 /GR /EHa /Zm150" ^ | |
-D CMAKE_C_FLAGS="/DWIN32 /D_WINDOWS /W3 /Zm150" ^ | |
-D EIGEN_INCLUDE_PATH="C:/dev/eigen-3.2.6/build/install/include/eigen3" ^ | |
-D TBB_INCLUDE_DIR="C:/dev/tbb44_20150728oss/include" ^ | |
-D CUDA_ARCH_BIN="3.0" ^ | |
-D CUDA_ARCH_PTX="" ^ | |
-D WITH_1394=OFF ^ | |
-D WITH_CUBLAS=ON ^ | |
-D WITH_CUDA=ON ^ | |
-D WITH_CUFFT=ON ^ | |
-D WITH_DSHOW=ON ^ | |
-D WITH_EIGEN=ON ^ | |
-D WITH_FFMPEG=ON ^ | |
-D WITH_GIGEAPI=OFF ^ | |
-D WITH_JASPER=ON ^ | |
-D WITH_JPEG=ON ^ | |
-D WITH_MSMF=ON ^ | |
-D WITH_NVCUVID=OFF ^ | |
-D WITH_OPENCL=ON ^ | |
-D WITH_OPENCLAMDBLAS=OFF ^ | |
-D WITH_OPENCLAMDFFT=OFF ^ | |
-D WITH_OPENEXR=ON ^ | |
-D WITH_OPENGL=ON ^ | |
-D WITH_OPENMP=OFF ^ | |
-D WITH_OPENNI=OFF ^ | |
-D WITH_PNG=ON ^ | |
-D WITH_PVAPI=OFF ^ | |
-D WITH_QT=OFF ^ | |
-D WITH_TBB=ON ^ | |
-D WITH_TIFF=ON ^ | |
-D WITH_VFW=OFF ^ | |
-D WITH_VTK=OFF ^ | |
-D WITH_WIN32UI=ON ^ | |
-D WITH_XIMEA=OFF %SOURCE_DIR% | |
:: Building the OpenCV(Debug/Release) using Visual Studio | |
devenv /build "Debug|x64" /project "INSTALL" OpenCV.sln | |
devenv /build "Release|x64" /project "INSTALL" OpenCV.sln |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OpenCV 2.4.9ビルド用バッチファイル(VS2012/64bit/WITH_CUDA)
という手順でビルドを行うことができます(CMake GUIポチポチしたくない人向け).
設定やファイルパス等は適宜書き換えが必要です.
バッチファイルのカスタマイズ方法
Visual Studioバージョン
VC_VERSION_NUM
で指定している番号を必要に応じて編集してください.(
VC_VERSION_NUM=11
は「Visual Studio 2012」指定を表す)TBB
TBB_INCLUDE_DIR
を必要に応じて編集してください.Eigen
EIGEN_INCLUDE_PATH
を必要に応じて編集してください.CUDA
CUDA_ARCH_BIN
にNVIDIA GPUのCapability番号を指定します.※Capability番号はNVIDIAサイトから調べることができます.
筆者の環境の場合,GeForce GTX 680(GPU Capability=3.0)を積んでいるため,
CUDA_ARCH_BIN="3.0"
と指定しています.このようにCapability番号を明示的に指定することで,動作させるGPU向けのみのコンパイルにとどめることができ,ビルド時間を大きく短縮することができます.参考URL