如何知道为Ubuntu 12.04构建的OpenCV 2.3.1设置了哪些标志?

时间:2016-02-24 16:09:16

标签: c++ opencv

我需要在已经构建OpenCV的计算机上工作,而不是我的计算机。但是,我想知道在构建时已经设置了哪些标志,例如WITH_TBB =,WITH_CUDA =,依此类推。有没有办法从某个文件中获取此信息?

1 个答案:

答案 0 :(得分:5)

跑吧:

#include <opencv2/opencv.hpp>
#include <iostream>

int main()
{
    // Get build information
    std::cout << cv::getBuildInformation();
}

它产生如下输出:

General configuration for OpenCV 3.0.0 =====================================
Version control:               unknown

Platform:
Host:                        Darwin 15.0.0 x86_64
CMake:                       3.3.2
CMake generator:             Unix Makefiles
CMake build tool:            /usr/local/Library/ENV/4.3/gmake
Configuration:               Release

C/C++:
Built as dynamic libs?:      YES
C++ Compiler:                /usr/local/Library/ENV/4.3/clang++  (ver 7.0.0.7000176)
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 -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mavx -fvisibility=hidden -fvisibility-inlines-hidden   -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 -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mavx -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
C Compiler:                  /usr/local/Library/ENV/4.3/clang
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 -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mavx -fvisibility=hidden -fvisibility-inlines-hidden   -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 -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mavx -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
Precompiled headers:         NO
Extra dependencies:          -framework OpenCL -framework Cocoa /usr/local/opt/jpeg/lib/libjpeg.dylib /usr/local/lib/libwebp.dylib /usr/local/lib/libpng.dylib /usr/local/lib/libtiff.dylib /usr/local/lib/libImath.dylib /usr/local/lib/libIlmImf.dylib /usr/local/lib/libIex.dylib /usr/local/lib/libHalf.dylib /usr/local/lib/libIlmThread.dylib /usr/lib/libz.dylib -framework QTKit -framework QuartzCore -framework AppKit
3rdparty dependencies:       ippicv

OpenCV modules:
To be built:                 hal core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d stitching videostab python2
Disabled:                    world
Disabled by dependency:      -
Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python3 viz

GUI:
QT:                          NO
Cocoa:                       YES
OpenGL support:              NO
VTK support:                 NO

Media I/O:
ZLib:                        /usr/lib/libz.dylib (ver 1.2.5)
JPEG:                        /usr/local/opt/jpeg/lib/libjpeg.dylib (ver 80)
WEBP:                        /usr/local/lib/libwebp.dylib (ver encoder: 0x0202)
PNG:                         /usr/local/lib/libpng.dylib (ver 1.6.18)
TIFF:                        /usr/local/lib/libtiff.dylib (ver 42 - 4.0.6)
JPEG 2000:                   NO
OpenEXR:                     /usr/local/lib/libImath.dylib /usr/local/lib/libIlmImf.dylib /usr/local/lib/libIex.dylib /usr/local/lib/libHalf.dylib /usr/local/lib/libIlmThread.dylib (ver 2.2.0)
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
QuickTime:                   NO
QTKit:                       YES
V4L/V4L2:                    NO/NO
XIMEA:                       NO
gPhoto2:                     NO

Other third-party libraries:
Use IPP:                     8.2.1 [8.2.1]
at:                     /tmp/opencv320151102-4718-8kzykk/opencv-3.0.0/3rdparty/ippicv/unpack/ippicv_osx
Use IPP Async:               NO
Use Eigen:                   YES (ver 3.2.6)
Use TBB:                     NO
Use OpenMP:                  NO
Use GCD                      YES
Use Concurrency              NO
Use C=:                      NO
Use pthreads for parallel for:
NO
Use Cuda:                    NO
Use OpenCL:                  YES

OpenCL:
Version:                     static
libraries:                   -framework OpenCL
Use AMDFFT:                  NO
Use AMDBLAS:                 NO

Python 2:
Interpreter:                 /usr/bin/python (ver 2.7.10)
Libraries:                   /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib (ver 2.7.10)
numpy:                       /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include (ver 1.8.0rc1)
packages path:               lib/python2.7/site-packages

Python 3:
Interpreter:                 NO

Python (for build):            /usr/bin/python

Java:
ant:                         NO
JNI:                         /System/Library/Frameworks/JavaVM.framework/Headers /System/Library/Frameworks/JavaVM.framework/Headers /System/Library/Frameworks/JavaVM.framework/Headers
Java wrappers:               NO
Java tests:                  NO

Matlab:
mex:                         NO

Documentation:
Doxygen:                     NO
PlantUML:                    NO

Tests and samples:
Tests:                       YES
Performance tests:           YES
C/C++ Examples:              NO

Install path:                  /usr/local/Cellar/opencv3/3.0.0

cvconfig.h is in:              /tmp/opencv320151102-4718-8kzykk/opencv-3.0.0/macbuild
-----------------------------------------------------------------