Compilation Error on 4.5.1

I am getting the following compilation error on OpenCV 4.5.1:
Generator error: class Tracker (cname=cv::Tracker) already exists
I am trying to compule with Cuda and CudaNN and am using python 3.8.5
Any help would be greatly appreciated. Thank you!

Hi,
Can you show us your cmake output?
Where do you clone opencv and opencv_contrib in your local repository?

– Detected processor: x86_64
– Looking for ccache - found (/usr/bin/ccache)
– libjpeg-turbo: VERSION = 2.0.6, BUILD = opencv-4.5.1-libjpeg-turbo
– The imported target “openjp2_static” references the file
“/usr/lib/x86_64-linux-gnu/libopenjp2.a”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– The imported target “openjpip” references the file
“/usr/lib/x86_64-linux-gnu/libopenjpip.so.2.3.1”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– The imported target “openjpip_server” references the file
“/usr/lib/x86_64-linux-gnu/libopenjpip_server.a”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– The imported target “opj_decompress” references the file
“/usr/bin/opj_decompress”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– The imported target “opj_compress” references the file
“/usr/bin/opj_compress”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– The imported target “opj_dump” references the file
“/usr/bin/opj_dump”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– The imported target “opj_jpip_addxml” references the file
“/usr/bin/opj_jpip_addxml”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– The imported target “opj_server” references the file
“/usr/bin/opj_server”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– The imported target “opj_dec_server” references the file
“/usr/bin/opj_dec_server”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– The imported target “opj_jpip_transcode” references the file
“/usr/bin/opj_jpip_transcode”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– The imported target “opj_jpip_test” references the file
“/usr/bin/opj_jpip_test”
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/x86_64-linux-gnu/openjpeg-2.3/OpenJPEGTargets.cmake”
    but not all the files it references.

– Found system OpenJPEG: openjp2 (found version “”)
– Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so
– Found TBB (cmake): /usr/lib/x86_64-linux-gnu/libtbb.so.2
– found Intel IPP (ICV version): 2020.0.0 [2020.0.0 Gold]
– at: /home/elclopitan/Library/opencv/build/3rdparty/ippicv/ippicv_lnx/icv
– found Intel IPP Integration Wrappers sources: 2020.0.0
– at: /home/elclopitan/Library/opencv/build/3rdparty/ippicv/ippicv_lnx/iw
– CUDA detected: 10.1
– CUDA: Using CUDA_ARCH_BIN=7.5
– CUDA NVCC target flags: -gencode;arch=compute_75,code=sm_75;-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)
– Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
– Could NOT find Pylint (missing: PYLINT_EXECUTABLE)
– Could NOT find Flake8 (missing: FLAKE8_EXECUTABLE)
– The imported target “vtkParseOGLExt” references the file
“/usr/bin/vtkParseOGLExt-7.1”
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-7.1/VTKTargets.cmake”
    but not all the files it references.

– The imported target “vtkRenderingPythonTkWidgets” references the file
“/usr/lib/x86_64-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-7.1/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-7.1/VTKTargets.cmake”
    but not all the files it references.

– The imported target “pvtk” references the file
“/usr/bin/pvtk”
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-7.1/VTKTargets.cmake”
    but not all the files it references.

– Found VTK 7.1.1 (/usr/lib/cmake/vtk-7.1/UseVTK.cmake)
– OpenCV Python: during development append to PYTHONPATH: /home/elclopitan/Library/opencv/build/python_loader
– Checking for module ‘gstreamer-app-1.0’
– No package ‘gstreamer-app-1.0’ found
– Checking for module ‘gstreamer-riff-1.0’
– No package ‘gstreamer-riff-1.0’ found
– Checking for module ‘gstreamer-pbutils-1.0’
– No package ‘gstreamer-pbutils-1.0’ found
– Caffe: NO
– Protobuf: NO
– Glog: YES
– freetype2: YES (ver 23.1.17)
– harfbuzz: YES (ver 2.6.4)
– 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.
– Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
– Detected gflags version: 2.2.2
– Found installed version of Eigen: /usr/lib/cmake/eigen3
– Found required Ceres dependency: Eigen version 3.3.7 in /usr/include/eigen3
– Found required Ceres dependency: glog
– Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
– Detected gflags version: 2.2.2
– Found required Ceres dependency: gflags
– Found Ceres version: 1.14.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
– Checking SFM deps… TRUE
– Checking for module ‘tesseract’
– No package ‘tesseract’ found
– Tesseract: NO
– Allocator metrics storage type: ‘long long’
– Registering hook ‘INIT_MODULE_SOURCES_opencv_dnn’: /home/elclopitan/Library/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
– 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.
– Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
– Detected gflags version: 2.2.2
– Found installed version of Eigen: /usr/lib/cmake/eigen3
– Found required Ceres dependency: Eigen version 3.3.7 in /usr/include/eigen3
– Found required Ceres dependency: glog
– Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
– Detected gflags version: 2.2.2
– Found required Ceres dependency: gflags
– Found Ceres version: 1.14.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
– Checking SFM deps… TRUE
– SYCL/OpenCL samples are skipped: SYCL SDK is required
– - check configuration of SYCL_DIR/SYCL_ROOT/CMAKE_MODULE_PATH
– - ensure that right compiler is selected from SYCL SDK (e.g, clang++): CMAKE_CXX_COMPILER=/usr/bin/c++

– General configuration for OpenCV 4.5.1 =====================================
– Version control: 4.5.1

– Extra modules:
– Location (extra): /home/elclopitan/Library/opencv_contrib/modules
– Version control (extra): 4.4.0-40-ge502f305

– Platform:
– Timestamp: 2021-02-08T22:08:07Z
– Host: Linux 5.8.0-41-generic x86_64
– CMake: 3.19.3
– CMake generator: Unix Makefiles
– CMake build tool: /usr/bin/make
– 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 (17 files): + SSSE3 SSE4_1
– SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
– FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
– AVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
– AVX2 (31 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
– AVX512_SKX (7 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 9.3.0)
– C++ flags (Release): -fsigned-char -ffast-math -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 -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 -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 -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/gcc-8
– C flags (Release): -fsigned-char -ffast-math -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 -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 -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 -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,–exclude-libs,libippicv.a -Wl,–exclude-libs,libippiw.a -Wl,–gc-sections -Wl,–as-needed
– Linker flags (Debug): -Wl,–exclude-libs,libippicv.a -Wl,–exclude-libs,libippiw.a -Wl,–gc-sections -Wl,–as-needed
– ccache: YES
– 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/lib/x86_64-linux-gnu -L/usr/lib64 -L/home/elclopitan/Library/cuda/lib64
– 3rdparty dependencies:

– OpenCV modules:
– To be built: alphamat aruco 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 hdf hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab viz xfeatures2d ximgproc xobjdetect xphoto
– Disabled: world
– Disabled by dependency: -
– Unavailable: cnn_3dobj cvv java julia matlab ovis python2
– Applications: tests perf_tests examples apps
– Documentation: NO
– Non-free algorithms: YES

– GUI:
– GTK+: YES (ver 3.24.20)
– GThread : YES (ver 2.64.6)
– GtkGlExt: NO
– OpenGL support: NO
– VTK support: YES (ver 7.1.1)

– Media I/O:
– ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
– JPEG: build-libjpeg-turbo (ver 2.0.6-62)
– WEBP: /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x020e)
– PNG: build (ver 1.6.37)
– TIFF: build (ver 42 - 4.0.10)
– JPEG 2000: OpenJPEG (ver 2.3.1)
– OpenEXR: /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 2_3)
– HDR: YES
– SUNRASTER: YES
– PXM: YES
– PFM: YES

– Video I/O:
– DC1394: YES (2.2.5)
– FFMPEG: YES
– avcodec: YES (58.54.100)
– avformat: YES (58.29.100)
– avutil: YES (56.31.100)
– swscale: YES (5.5.100)
– avresample: YES (4.0.0)
– GStreamer: NO
– v4l/v4l2: YES (linux/videodev2.h)

– Parallel framework: TBB (ver 2020.1 interface 11101)

– Trace: YES (with Intel ITT)

– Other third-party libraries:
– Intel IPP: 2020.0.0 Gold [2020.0.0]
– at: /home/elclopitan/Library/opencv/build/3rdparty/ippicv/ippicv_lnx/icv
– Intel IPP IW: sources (2020.0.0)
– at: /home/elclopitan/Library/opencv/build/3rdparty/ippicv/ippicv_lnx/iw
– Lapack: NO
– Eigen: YES (ver 3.3.7)
– Custom HAL: NO
– Protobuf: build (3.5.1)

– NVIDIA CUDA: YES (ver 10.1, CUFFT CUBLAS FAST_MATH)
– NVIDIA GPU arch: 75
– NVIDIA PTX archs:

– cuDNN: YES (ver 8.1.0)

– OpenCL: YES (no extra features)
– Include path: /home/elclopitan/Library/opencv/3rdparty/include/opencl/1.2
– Link libraries: Dynamic load

– Python 3:
– Interpreter: /usr/bin/python3 (ver 3.8.5)
– Libraries: /usr/lib/x86_64-linux-gnu/libpython3.8.so (ver 3.8.5)
– numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.17.4)
– install path: lib/python3.8/dist-packages/cv2/python-3.8

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

– Java:
– ant: NO
– JNI: NO
– Java wrappers: NO
– Java tests: NO

– Install to: /usr/local

Below is a copy of the error message as well as a warning I get when I run make:
Note: Class detail_GraphCutSeamFinder has more than 1 base class (not supported by Python C extensions)
Bases: cv::detail::GraphCutSeamFinderBase, cv::detail::SeamFinder
Only the first base class will be used
Generator error: class Tracker (cname=cv::Tracker) already exists
make[2]: *** [modules/python_bindings_generator/CMakeFiles/gen_opencv_python_source.dir/build.make:481: modules/python_bindings_generator/pyopencv_generated_enums.h] Error 255
make[1]: *** [CMakeFiles/Makefile2:21267: modules/python_bindings_generator/CMakeFiles/gen_opencv_python_source.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…

I was able to fix it myself. I think it was some issues with some tags I set. My current issue that I am unsure how to set it up so that python3 uses the opencv I compiled from source. When I run print(cv2.getBuildInformation()), it still says the stuff from before; running ‘cmake …’ in the opencv folder I have shows that it is compiled with cuda 11.2. It does say ’ install path: lib/python3.8/dist-packages/cv2/python-3.8’ when I check ccmake so I am not sure why it is still printing the wrong thing.

I was able to fix python3 stuff as well. I just needed to uninstall opencv-python by running pip3 uninstall opencv-python and remake and sudo make install. Thank you for offering your help!

1 Like