반응형

Ubuntu에서 C++과 Python을 위해 빌드된 OpenCV의 빌드 정보를 확인하는 방법을 다룹니다. 

윈도우에서도 동일한 코드로 확인이 가능합니다. 



2023. 1. 9  최초작성



Python

 

$ python3

Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux

Type "help", "copyright", "credits" or "license" for more information.

 

>>> import cv2

 

>>> print(cv2.getBuildInformation())

 

General configuration for OpenCV 4.6.0 =====================================

  Version control:               unknown

 

  Extra modules:

    Location (extra):            /home/webnautes/opencv-sources/opencv_contrib-4.6.0/modules

    Version control (extra):     unknown

 

  Platform:

    Timestamp:                   2022-12-18T00:30:09Z

    Host:                        Linux 5.15.0-56-generic x86_64

    CMake:                       3.22.1

    CMake generator:             Unix Makefiles

    CMake build tool:            /usr/bin/gmake

    Configuration:               RELEASE

 

  CPU/HW features:

    Baseline:                    SSE SSE2 SSE3

      requested:                 SSE3

    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX

      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX

      SSE4_1 (16 files):         + SSSE3 SSE4_1

      SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2

      FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX

      AVX (4 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX

      AVX2 (31 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

      AVX512_SKX (5 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

 

  C/C++:

    Built as dynamic libs?:      YES

    C++ standard:                11

    C++ Compiler:                /usr/bin/c++  (ver 11.3.0)

    C++ flags (Release):         -fsigned-char -ffast-math -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG

    C++ flags (Debug):           -fsigned-char -ffast-math -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG

    C Compiler:                  /usr/bin/cc

    C flags (Release):           -fsigned-char -ffast-math -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG

    C flags (Debug):             -fsigned-char -ffast-math -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG

    Linker flags (Release):      -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  

    Linker flags (Debug):        -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  

    ccache:                      NO

    Precompiled headers:         NO

    Extra dependencies:          m pthread cudart_static dl rt nppc nppial nppicc nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cudnn cufft -L/usr/local/cuda/lib64 -L/usr/lib/x86_64-linux-gnu

    3rdparty dependencies:

 

  OpenCV modules:

    To be built:                 alphamat aruco barcode bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto

    Disabled:                    world

    Disabled by dependency:      -

    Unavailable:                 cvv hdf java julia matlab ovis python2 sfm ts viz

    Applications:                apps

    Documentation:               NO

    Non-free algorithms:         YES

 

  GUI:                           GTK3

    GTK+:                        YES (ver 3.24.33)

      GThread :                  YES (ver 2.72.4)

      GtkGlExt:                  NO

    OpenGL support:              NO

    VTK support:                 NO

 

  Media I/O: 

    ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)

    JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)

    WEBP:                        build (ver encoder: 0x020f)

    PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)

    TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.3.0)

    JPEG 2000:                   build (ver 2.4.0)

    OpenEXR:                     build (ver 2.3.0)

    HDR:                         YES

    SUNRASTER:                   YES

    PXM:                         YES

    PFM:                         YES

 

  Video I/O:

    FFMPEG:                      YES

      avcodec:                   YES (58.134.100)

      avformat:                  YES (58.76.100)

      avutil:                    YES (56.70.100)

      swscale:                   YES (5.9.100)

      avresample:                NO

    GStreamer:                   YES (1.20.3)

    v4l/v4l2:                    YES (linux/videodev2.h)

 

  Parallel framework:            pthreads

 

  Trace:                         YES (with Intel ITT)

 

  Other third-party libraries:

    VA:                          NO

    Lapack:                      NO

    Eigen:                       YES (ver 3.4.0)

    Custom HAL:                  NO

    Protobuf:                    build (3.19.1)

 

  NVIDIA CUDA:                   YES (ver 11.8, CUFFT CUBLAS NVCUVID FAST_MATH)

    NVIDIA GPU arch:             75

    NVIDIA PTX archs:            75

 

  cuDNN:                         YES (ver 8.7.0)

 

  OpenCL:                        YES (no extra features)

    Include path:                /home/webnautes/opencv-sources/opencv-4.6.0/3rdparty/include/opencl/1.2

    Link libraries:              Dynamic load

 

  Python 3:

    Interpreter:                 /usr/bin/python3 (ver 3.10.6)

    Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.10.so (ver 3.10.6)

    numpy:                       /home/webnautes/.local/lib/python3.10/site-packages/numpy/core/include (ver 1.23.5)

    install path:                /usr/local/lib/python3.10/dist-packages

 

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

 

  Install to:                    /usr/local

-----------------------------------------------------------------




C++

test.cpp

 

#include <opencv2/opencv.hpp>

using namespace cv;
using namespace std;


int main()
{
cout << getBuildInformation() << endl;

return 0;
}




$ g++ test.cpp -o test `pkg-config opencv4 --libs --cflags`



$ ./test

 

General configuration for OpenCV 4.6.0 =====================================

  Version control:               unknown

 

  Extra modules:

    Location (extra):            /home/webnautes/opencv-sources/opencv_contrib-4.6.0/modules

    Version control (extra):     unknown

 

  Platform:

    Timestamp:                   2022-12-18T00:30:09Z

    Host:                        Linux 5.15.0-56-generic x86_64

    CMake:                       3.22.1

    CMake generator:             Unix Makefiles

    CMake build tool:            /usr/bin/gmake

    Configuration:               RELEASE

 

  CPU/HW features:

    Baseline:                    SSE SSE2 SSE3

      requested:                 SSE3

    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX

      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX

      SSE4_1 (16 files):         + SSSE3 SSE4_1

      SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2

      FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX

      AVX (4 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX

      AVX2 (31 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

      AVX512_SKX (5 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

 

  C/C++:

    Built as dynamic libs?:      YES

    C++ standard:                11

    C++ Compiler:                /usr/bin/c++  (ver 11.3.0)

    C++ flags (Release):         -fsigned-char -ffast-math -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG

    C++ flags (Debug):           -fsigned-char -ffast-math -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG

    C Compiler:                  /usr/bin/cc

    C flags (Release):           -fsigned-char -ffast-math -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG

    C flags (Debug):             -fsigned-char -ffast-math -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG

    Linker flags (Release):      -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  

    Linker flags (Debug):        -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  

    ccache:                      NO

    Precompiled headers:         NO

    Extra dependencies:          m pthread cudart_static dl rt nppc nppial nppicc nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cudnn cufft -L/usr/local/cuda/lib64 -L/usr/lib/x86_64-linux-gnu

    3rdparty dependencies:

 

  OpenCV modules:

    To be built:                 alphamat aruco barcode bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto

    Disabled:                    world

    Disabled by dependency:      -

    Unavailable:                 cvv hdf java julia matlab ovis python2 sfm ts viz

    Applications:                apps

    Documentation:               NO

    Non-free algorithms:         YES

 

  GUI:                           GTK3

    GTK+:                        YES (ver 3.24.33)

      GThread :                  YES (ver 2.72.4)

      GtkGlExt:                  NO

    OpenGL support:              NO

    VTK support:                 NO

 

  Media I/O: 

    ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)

    JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)

    WEBP:                        build (ver encoder: 0x020f)

    PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)

    TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.3.0)

    JPEG 2000:                   build (ver 2.4.0)

    OpenEXR:                     build (ver 2.3.0)

    HDR:                         YES

    SUNRASTER:                   YES

    PXM:                         YES

    PFM:                         YES

 

  Video I/O:

    FFMPEG:                      YES

      avcodec:                   YES (58.134.100)

      avformat:                  YES (58.76.100)

      avutil:                    YES (56.70.100)

      swscale:                   YES (5.9.100)

      avresample:                NO

    GStreamer:                   YES (1.20.3)

    v4l/v4l2:                    YES (linux/videodev2.h)

 

  Parallel framework:            pthreads

 

  Trace:                         YES (with Intel ITT)

 

  Other third-party libraries:

    VA:                          NO

    Lapack:                      NO

    Eigen:                       YES (ver 3.4.0)

    Custom HAL:                  NO

    Protobuf:                    build (3.19.1)

 

  NVIDIA CUDA:                   YES (ver 11.8, CUFFT CUBLAS NVCUVID FAST_MATH)

    NVIDIA GPU arch:             75

    NVIDIA PTX archs:            75

 

  cuDNN:                         YES (ver 8.7.0)

 

  OpenCL:                        YES (no extra features)

    Include path:                /home/webnautes/opencv-sources/opencv-4.6.0/3rdparty/include/opencl/1.2

    Link libraries:              Dynamic load

 

  Python 3:

    Interpreter:                 /usr/bin/python3 (ver 3.10.6)

    Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.10.so (ver 3.10.6)

    numpy:                       /home/webnautes/.local/lib/python3.10/site-packages/numpy/core/include (ver 1.23.5)

    install path:                /usr/local/lib/python3.10/dist-packages

 

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

 

  Install to:                    /usr/local

-----------------------------------------------------------------



반응형

문제 발생시 지나치지 마시고 댓글 남겨주시면 가능한 빨리 답장드립니다.

도움이 되셨다면 토스아이디로 후원해주세요.
https://toss.me/momo2024


제가 쓴 책도 한번 검토해보세요 ^^

+ Recent posts