Hi all,
I need to compile OpenCV for Python 3.9 on Jetson Nano (ARM) to be able to get gstreamer support, which isn’t available from the PyPi wheel.
I’ve successfully build python 3.9.5 with static and shared libs and installed in /opt/python39x64
My problem is, that no matter what I do, cmake-gui claims not to find Python3 and also not building the cv2.so, even when setting the resp. flags:
and the configure output is:
Detected processor: aarch64
Looking for ccache - not found
Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found suitable version "1.2.11", minimum required is "1.2.3")
Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version >= 2.3.1). OpenJPEG will be built from sources
OpenJPEG: VERSION = 2.4.0, BUILD = opencv-4.5.3-pre-openjp2-2.4.0
OpenJPEG libraries will be built from sources: libopenjp2 (version "2.4.0")
Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found version "1.2.11")
CUDA detected: 10.2
CUDA: Using CUDA_ARCH_BIN=5.3
CUDA NVCC target flags: -gencode;arch=compute_53,code=sm_53;-D_FORCE_INLINES
Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY)
A library with BLAS API found.
A library with LAPACK API found.
The imported target "vtkRenderingPythonTkWidgets" references the file
"/usr/lib/aarch64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.
The imported target "vtk" references the file
"/usr/bin/vtk"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.
Found VTK 6.3.0 (/usr/lib/cmake/vtk-6.3/UseVTK.cmake)
OpenCV Python: during development append to PYTHONPATH: /home/phoenix/Sources/opencv/build/python_loader
freetype2: YES (ver 21.0.15)
harfbuzz: YES (ver 1.7.2)
HDF5: Using hdf5 compiler wrapper to determine C configuration
Julia not found. Not compiling Julia Bindings.
Module opencv_ovis disabled because OGRE3D was not found
No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
Checking for module 'tesseract'
No package 'tesseract' found
Tesseract: NO
Processing WORLD modules...
module opencv_cudev...
module opencv_core...
Allocator metrics storage type: 'int'
Excluding from source files list: <BUILD>/modules/world/test/test_intrin128.sse2.cpp
Excluding from source files list: <BUILD>/modules/world/test/test_intrin128.sse3.cpp
Excluding from source files list: <BUILD>/modules/world/test/test_intrin128.ssse3.cpp
Excluding from source files list: <BUILD>/modules/world/test/test_intrin128.sse4_1.cpp
Excluding from source files list: <BUILD>/modules/world/test/test_intrin128.sse4_2.cpp
Excluding from source files list: <BUILD>/modules/world/test/test_intrin128.avx.cpp
Excluding from source files list: <BUILD>/modules/world/test/test_intrin128.avx2.cpp
Excluding from source files list: <BUILD>/modules/world/test/test_intrin128.avx512_skx.cpp
Excluding from source files list: <BUILD>/modules/world/test/test_intrin256.avx2.cpp
Excluding from source files list: <BUILD>/modules/world/test/test_intrin256.avx512_skx.cpp
Excluding from source files list: <BUILD>/modules/world/test/test_intrin512.avx512_skx.cpp
module opencv_cudaarithm...
module opencv_flann...
module opencv_hdf...
HDF5: Using hdf5 compiler wrapper to determine C configuration
module opencv_imgproc...
module opencv_intensity_transform...
module opencv_ml...
module opencv_phase_unwrapping...
module opencv_plot...
module opencv_quality...
module opencv_reg...
module opencv_surface_matching...
module opencv_viz...
module opencv_alphamat...
module opencv_cudafilters...
module opencv_cudaimgproc...
module opencv_cudawarping...
module opencv_dnn...
Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': /home/phoenix/Sources/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
module opencv_dnn_superres...
module opencv_features2d...
module opencv_freetype...
module opencv_fuzzy...
module opencv_hfs...
module opencv_imgcodecs...
module opencv_line_descriptor...
module opencv_photo...
module opencv_saliency...
module opencv_text...
module opencv_videoio...
module opencv_wechat_qrcode...
module opencv_xphoto...
module opencv_barcode...
module opencv_calib3d...
module opencv_cudacodec...
module opencv_cudafeatures2d...
module opencv_cudastereo...
module opencv_datasets...
module opencv_highgui...
highgui: using builtin backend: GTK3
module opencv_mcc...
module opencv_objdetect...
module opencv_rapid...
module opencv_rgbd...
module opencv_shape...
module opencv_structured_light...
module opencv_video...
module opencv_xfeatures2d...
module opencv_ximgproc...
module opencv_xobjdetect...
module opencv_aruco...
module opencv_bgsegm...
module opencv_bioinspired...
module opencv_ccalib...
module opencv_cudabgsegm...
module opencv_cudalegacy...
module opencv_cudaobjdetect...
module opencv_dnn_objdetect...
module opencv_dpm...
module opencv_face...
module opencv_optflow...
module opencv_stitching...
module opencv_tracking...
module opencv_cudaoptflow...
Building with NVIDIA Optical Flow API 2.0
module opencv_stereo...
module opencv_superres...
module opencv_videostab...
Processing WORLD modules... DONE
Excluding from source files list: modules/imgproc/src/corner.avx.cpp
Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp
Excluding from source files list: modules/imgproc/src/imgwarp.sse4_1.cpp
Excluding from source files list: modules/imgproc/src/resize.avx2.cpp
Excluding from source files list: modules/imgproc/src/resize.sse4_1.cpp
Excluding from source files list: <BUILD>/modules/world/layers/layers_common.avx.cpp
Excluding from source files list: <BUILD>/modules/world/layers/layers_common.avx2.cpp
Excluding from source files list: <BUILD>/modules/world/layers/layers_common.avx512_skx.cpp
Excluding from source files list: modules/features2d/src/fast.avx2.cpp
General configuration for OpenCV 4.5.3-pre =====================================
Version control: 4.5.2-267-gc95a56450d
Extra modules:
Location (extra): /home/phoenix/Sources/opencv/opencv_contrib/modules
Version control (extra): 4.5.2-267-gc95a56450d
Platform:
Timestamp: 2021-06-26T11:20:30Z
Host: Linux 4.9.201-tegra aarch64
CMake: 3.10.2
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release
CPU/HW features:
Baseline: NEON FP16
C/C++:
Built as dynamic libs?: YES
C++ standard: 11
C++ Compiler: /usr/bin/c++ (ver 7.5.0)
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 -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 -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -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 -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 -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/cc
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-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 -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-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 -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,--gc-sections -Wl,--as-needed
Linker flags (Debug): -Wl,--gc-sections -Wl,--as-needed
ccache: NO
Precompiled headers: NO
Extra dependencies: m pthread cudart_static dl rt nppc nppial nppicc nppicom nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cudnn cufft -L/usr/local/cuda/lib64 -L/usr/lib/aarch64-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 hdf hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python2 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab viz wechat_qrcode world xfeatures2d ximgproc xobjdetect xphoto
Disabled: gapi java_bindings_generator python_tests
Disabled by dependency: -
Unavailable: cvv java julia matlab ovis python3 python3 sfm
Applications: tests apps
Documentation: NO
Non-free algorithms: NO
GUI:
GTK+: YES (ver 3.22.30)
GThread : YES (ver 2.56.4)
GtkGlExt: YES (ver 1.2.0)
OpenGL support: NO
VTK support: YES (ver 6.3.0)
Media I/O:
ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
WEBP: /usr/lib/aarch64-linux-gnu/libwebp.so (ver encoder: 0x020e)
PNG: /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.34)
TIFF: /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.0.9)
JPEG 2000: build (ver 2.4.0)
OpenEXR: build (ver 2.3.0)
GDAL: YES (/usr/lib/libgdal.so)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES
Video I/O:
FFMPEG: YES
avcodec: YES (57.107.100)
avformat: YES (57.83.100)
avutil: YES (55.78.100)
swscale: YES (4.8.100)
avresample: YES (3.7.0)
GStreamer: YES (1.14.5)
v4l/v4l2: YES (linux/videodev2.h)
Parallel framework: pthreads
Trace: YES (with Intel ITT)
Other third-party libraries:
Lapack: NO
Eigen: YES (ver 3.3.4)
Custom HAL: YES (carotene (ver 0.0.1))
Protobuf: build (3.5.1)
NVIDIA CUDA: YES (ver 10.2, CUFFT CUBLAS)
NVIDIA GPU arch: 53
NVIDIA PTX archs:
cuDNN: YES (ver 8.0.0)
OpenCL: YES (no extra features)
Include path: /home/phoenix/Sources/opencv/3rdparty/include/opencl/1.2
Link libraries: Dynamic load
Python 2:
Interpreter: /usr/bin/python2.7 (ver 2.7.17)
Libraries: /usr/lib/aarch64-linux-gnu/libpython2.7.so (ver 2.7.17)
numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.13.3)
install path: lib/python2.7/dist-packages/cv2/python-2.7
Python (for build): /usr/bin/python2.7
Install to: /usr/local
-----------------------------------------------------------------
Configuring done
I’ve tried already several tutorials, even installed the python3.9-dev, lib…blabla via deadsnakes/ppa, but nothing makes cmake change it’s mind. Does anyone have an idea how to just build the py-lib?