Установка OpenCV застряла на [39%]; Модули OpenCV для сборки; - PullRequest
0 голосов
/ 16 июня 2020

OpenCV => 3.4.9 python 3.8 Операционная система / платформа => Ubuntu 20.4 cmake: 3: 16: 3

Я пытаюсь установить opencv-3.4.9 в Ubuntu 20.4. Когда я попытался построить его, меня поразило 38%. Я обнаружил, что некоторые файлы не создаются во время cmake.

 $ cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D INSTALL_PYTHON_EXAMPLES=ON
-D INSTALL_C_EXAMPLES=OFF
-D OPENCV_ENABLE_NONFREE=ON
-D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules
-D PYTHON_EXECUTABLE=/.virtualenvs/cv/bin/python
-D BUILD_EXAMPLES=ON ..

короткий вывод cmake

    Linker flags (Release):      -Wl,--gc-sections  
--     Linker flags (Debug):        -Wl,--gc-sections  
--     ccache:                      YES
--     Precompiled headers:         NO
--     Extra dependencies:          dl m pthread rt
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 adas aruco bgsegm bioinspired calib3d ccalib core datasets dnn dpm face features2d flann highgui imgcodecs imgproc line_descriptor ml objdetect optflow photo python2 python3 reg rgbd saliency shape stereo stitching superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    contrib_world world
--     Disabled by dependency:      structured_light
--     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv java js matlab viz
--     Applications:                tests perf_tests examples apps
--     Documentation:               NO
--     Non-free algorithms:         YES
-- 
--   GUI: 
--     GTK+:                        YES (ver 3.24.18)
--       GThread :                  YES (ver 2.64.2)
--       GtkGlExt:                  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: 0x020e)
--     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.1.0)
--     JPEG 2000:                   /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
--     OpenEXR:                     build (ver 2.3.0)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
-- 
--   Video I/O:
--     DC1394:                      YES (ver 2.2.5)
--     FFMPEG:                      YES
--       avcodec:                   YES (ver 58.54.100)
--       avformat:                  YES (ver 58.29.100)
--       avutil:                    YES (ver 56.31.100)
--       swscale:                   YES (ver 5.5.100)
--       avresample:                YES (ver 4.0.0)
--     GStreamer:                   YES
--       base:                      YES (ver 1.16.2)
--       video:                     YES (ver 1.16.2)
--       app:                       YES (ver 1.16.2)
--       riff:                      YES (ver 1.16.2)
--       pbutils:                   YES (ver 1.16.2)
--     libv4l/libv4l2:              NO
--     v4l/v4l2:                    linux/videodev.h linux/videodev2.h
-- 
--   Parallel framework:            pthreads
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Intel IPP:                   2019.0.0 Gold [2019.0.0]
--            at:                   /home/jv/opencv/build/3rdparty/ippicv/ippicv_lnx/icv
--     Intel IPP IW:                sources (2019.0.0)
--               at:                /home/jv/opencv/build/3rdparty/ippicv/ippicv_lnx/iw
--     Lapack:                      YES (/usr/lib/x86_64-linux-gnu/liblapack.so /usr/lib/x86_64-linux-gnu/libcblas.so /usr/lib/x86_64-linux-gnu/libatlas.so)
--     Eigen:                       NO
--     Custom HAL:                  NO
--     Protobuf:                    build (3.5.1)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/jv/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.18)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.18rc1)
--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.16.5)
--     install path:                lib/python2.7/dist-packages/cv2/python-2.7
-- 
--   Python 3:
--     Interpreter:                 /home/jv/.virtualenvs/cv/bin/python3 (ver 3.8.2)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.8.so (ver 3.8.2)
--     numpy:                       /home/jv/.virtualenvs/cv/lib/python3.8/site-packages/numpy/core/include (ver 1.18.5)
--     install path:                lib/python3.8/site-packages/cv2/python-3.8
-- 
--   Python (for build):            /usr/bin/python2.7
--     Pylint:                      /usr/bin/pylint (ver: 3.8.2, checks: 157)
--     Flake8:                      /home/jv/.local/bin/flake8 (ver: 3.8.3)
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local

make output: У меня 4-ядерный процессор

[ 0%] Built target gen-pkgconfig
[ 1%] Built target ippiw
[ 8%] Built target libwebp
[ 12%] Built target IlmImf
[ 13%] Built target quirc
[ 14%] Built target ittnotify
[ 14%] Built target gen_opencv_python_source
[ 17%] Built target libprotobuf
[ 22%] Built target opencv_core
[ 22%] Built target opencv_flann
[ 22%] Built target opencv_version
[ 23%] Built target opencv_ml
[ 23%] Built target opencv_surface_matching
[ 27%] Built target opencv_imgproc
[ 27%] Built target opencv_reg
[ 27%] Built target opencv_video
[ 28%] Built target opencv_photo
[ 29%] Built target opencv_imgcodecs
[ 30%] Built target opencv_shape
[ 31%] Built target opencv_features2d
[ 34%] Built target opencv_dnn
[ 35%] Built target opencv_videoio
[ 36%] Built target opencv_calib3d
[ 36%] Processing OpenCL kernels (superres)
[ 36%] Processing OpenCL kernels (objdetect)
Scanning dependencies of target opencv_ccalib
[ 37%] Built target opencv_highgui
Scanning dependencies of target opencv_superres
Scanning dependencies of target opencv_videostab
[ 37%] Building CXX object modules/ccalib/CMakeFiles/opencv_ccalib.dir/src/ccalib.cpp.o
Scanning dependencies of target opencv_objdetect
[ 37%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/btv_l1.cpp.o
[ 37%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/deblurring.cpp.o
[ 37%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect.dir/src/cascadedetect.cpp.o
In file included from /home/jv/opencv/modules/core/include/opencv2/core.hpp:56,
from /home/jv/opencv_contrib/modules/ccalib/src/precomp.hpp:45,
from /home/jv/opencv_contrib/modules/ccalib/src/ccalib.cpp:46:
/home/jv/opencv/modules/core/include/opencv2/core/traits.hpp: In instantiation of ‘struct cv::traits::Typecv::KeyPoint’:
/home/jv/opencv/modules/core/include/opencv2/core/mat.inl.hpp:634:23: required from ‘cv::Mat::Mat(const std::vector<_Tp>&, bool) [with _Tp = cv::KeyPoint]’
/home/jv/opencv_contrib/modules/ccalib/src/ccalib.cpp:410:25: required from here
/home/jv/opencv/modules/core/include/opencv2/core/traits.hpp:366:8: error: ‘type’ is not a member of ‘cv::DataTypecv::KeyPoint’
366 | { enum { value = DataType::type }; };
| ^
make[2]: *** [modules/ccalib/CMakeFiles/opencv_ccalib.dir/build.make:63: modules/ccalib/CMakeFiles/opencv_ccalib.dir/src/ccalib.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5485: modules/ccalib/CMakeFiles/opencv_ccalib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 37%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect.dir/src/cascadedetect_convert.cpp.o
[ 37%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/fast_marching.cpp.o
[ 37%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect.dir/src/detection_based_tracker.cpp.o
[ 37%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/frame_source.cpp.o
[ 37%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/btv_l1_cuda.cpp.o
[ 37%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/global_motion.cpp.o
[ 37%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.o
[ 37%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect.dir/src/haar.cpp.o
[ 37%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect.dir/src/hog.cpp.o
[ 37%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/input_array_utility.cpp.o
[ 37%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/optical_flow.cpp.o
[ 37%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect.dir/src/main.cpp.o
[ 37%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/inpainting.cpp.o
[ 37%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/super_resolution.cpp.o
[ 38%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect.dir/src/qrcode.cpp.o
[ 38%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect.dir/opencl_kernels_objdetect.cpp.o
[ 38%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/opencl_kernels_superres.cpp.o
[ 38%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect.dir/src/haar.avx.cpp.o
[ 38%] Linking CXX shared library ../../lib/libopencv_superres.so
[ 38%] Built target opencv_superres
[ 38%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/log.cpp.o
[ 38%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/motion_stabilizing.cpp.o
[ 38%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/optical_flow.cpp.o
[ 38%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/outlier_rejection.cpp.o
[ 38%] Linking CXX shared library ../../lib/libopencv_objdetect.so
[ 38%] Built target opencv_objdetect
[ 38%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/stabilizer.cpp.o
[ 38%] Building CXX object modules/videostab/CMakeFiles/opencv_videostab.dir/src/wobble_suppression.cpp.o
[ 39%] Linking CXX shared library ../../lib/libopencv_videostab.so
[ 39%] Built target opencv_videostab
make: *** [Makefile:163: all] Error 2

Заранее спасибо.

...