Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCV build without some internal modules fails in Linux and Windows #1024

Open
ioctl-user opened this issue Aug 26, 2024 · 1 comment
Open

Comments

@ioctl-user
Copy link

ioctl-user commented Aug 26, 2024

This problem appears in Windows and Linux. I have reproduced this problem only without the flann module, however, other modules disabling may lead to the same problem too.

There is no such problem while directly building OpenCV without opencv-python project with the same modules disabled, while configured with cmake -DBUILD_opencv_calib3d=OFF -DBUILD_opencv_flann=OFF -DPYTHON3_EXECUTABLE=$(which python3.9) ../

So, this namely an opencv-python problem.

Steps to reproduce in the manylinux2014 docker:

git clone --recursive https://github.com/opencv/opencv-python.git
cd opencv-python

export CMAKE_BUILD_PARALLEL_LEVEL=8
export CMAKE_ARGS="-DBUILD_opencv_calib3d=OFF -DBUILD_opencv_flann=OFF"
python3.9 -m pip wheel . --verbose

This give the following error:


  [100%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2_util.cpp.o
  [100%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2_highgui.cpp.o
  In file included from /home/ci/opencv-python/opencv/modules/python/src2/cv2.hpp:41,
                   from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:5:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:57: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:278:9: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    278 |         STORAGE v; \
        |         ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:57: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:278:9: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    278 |         STORAGE v; \
        |         ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:74: error: template argument 1 is invalid
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                                          ^
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:278:9: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    278 |         STORAGE v; \
        |         ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:57: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:281:61: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    281 |     static bool pyopencv_##CLASS_ID##_getp(PyObject * self, STORAGE * & dst) \
        |                                                             ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:57: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:281:61: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    281 |     static bool pyopencv_##CLASS_ID##_getp(PyObject * self, STORAGE * & dst) \
        |                                                             ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:74: error: template argument 1 is invalid
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                                          ^
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:281:61: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    281 |     static bool pyopencv_##CLASS_ID##_getp(PyObject * self, STORAGE * & dst) \
        |                                                             ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:57: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:290:60: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    290 |     static PyObject * pyopencv_##CLASS_ID##_Instance(const STORAGE &r) \
        |                                                            ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:57: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:290:60: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    290 |     static PyObject * pyopencv_##CLASS_ID##_Instance(const STORAGE &r) \
        |                                                            ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:74: error: template argument 1 is invalid
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                                          ^
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:290:60: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    290 |     static PyObject * pyopencv_##CLASS_ID##_Instance(const STORAGE &r) \
        |                                                            ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h: In function ‘PyObject* pyopencv_FlannBasedMatcher_Instance(const int&)’:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:57: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:293:23: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    293 |         new (&(m->v)) STORAGE(r); \
        |                       ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:57: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:293:23: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    293 |         new (&(m->v)) STORAGE(r); \
        |                       ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:74: error: template argument 1 is invalid
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                                          ^
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:293:23: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    293 |         new (&(m->v)) STORAGE(r); \
        |                       ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h: In function ‘void pyopencv_FlannBasedMatcher_dealloc(PyObject*)’:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:57: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:298:45: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    298 |         ((pyopencv_##CLASS_ID##_t*)self)->v.STORAGE::~SNAME(); \
        |                                             ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:57: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:298:45: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    298 |         ((pyopencv_##CLASS_ID##_t*)self)->v.STORAGE::~SNAME(); \
        |                                             ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:74: error: template argument 1 is invalid
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                                          ^
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:298:45: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    298 |         ((pyopencv_##CLASS_ID##_t*)self)->v.STORAGE::~SNAME(); \
        |                                             ^~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:77: error: ‘<expression error>::Ptr’ has not been declared
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        |                                                                             ^~~
  /home/ci/opencv-python/opencv/modules/python/src2/pycompat.hpp:298:55: note: in definition of macro ‘CVPY_TYPE_DECLARE_DYNAMIC’
    298 |         ((pyopencv_##CLASS_ID##_t*)self)->v.STORAGE::~SNAME(); \
        |                                                       ^~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types.h:86:1: note: in expansion of macro ‘CVPY_TYPE’
     86 | CVPY_TYPE(FlannBasedMatcher, FlannBasedMatcher, Ptr<cv::FlannBasedMatcher>, Ptr, DescriptorMatcher, pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher, "")
        | ^~~~~~~~~
  In file included from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:90:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h: In function ‘int pyopencv_cv_FlannBasedMatcher_FlannBasedMatcher(pyopencv_FlannBasedMatcher_t*, PyObject*, PyObject*)’:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8397:9: error: ‘flann’ was not declared in this scope
   8397 |     Ptr<flann::IndexParams> indexParams=makePtr<flann::KDTreeIndexParams>();
        |         ^~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8397:27: error: template argument 1 is invalid
   8397 |     Ptr<flann::IndexParams> indexParams=makePtr<flann::KDTreeIndexParams>();
        |                           ^
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8397:41: error: parse error in template argument list
   8397 |     Ptr<flann::IndexParams> indexParams=makePtr<flann::KDTreeIndexParams>();
        |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8397:75: error: no matching function for call to ‘makePtr<flann>()’
   8397 |     Ptr<flann::IndexParams> indexParams=makePtr<flann::KDTreeIndexParams>();
        |                                                                           ^
  In file included from /home/ci/opencv-python/opencv/modules/core/include/opencv2/core/cvstd.hpp:81,
                   from /home/ci/opencv-python/opencv/modules/core/include/opencv2/core/base.hpp:58,
                   from /home/ci/opencv-python/opencv/modules/core/include/opencv2/core.hpp:53,
                   from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:8:
  /home/ci/opencv-python/opencv/modules/core/include/opencv2/core/cvstd_wrapper.hpp:143:10: note: candidate: ‘template<class _Tp, class ... A1> cv::Ptr<_Tp> cv::makePtr(const A1& ...)’
    143 | Ptr<_Tp> makePtr(const A1&... a1)
        |          ^~~~~~~
  /home/ci/opencv-python/opencv/modules/core/include/opencv2/core/cvstd_wrapper.hpp:143:10: note:   template argument deduction/substitution failed:
  In file included from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:90:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8399:43: error: parse error in template argument list
   8399 |     Ptr<flann::SearchParams> searchParams=makePtr<flann::SearchParams>();
        |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8399:72: error: no matching function for call to ‘makePtr<flann>()’
   8399 |     Ptr<flann::SearchParams> searchParams=makePtr<flann::SearchParams>();
        |                                                                        ^
  In file included from /home/ci/opencv-python/opencv/modules/core/include/opencv2/core/cvstd.hpp:81,
                   from /home/ci/opencv-python/opencv/modules/core/include/opencv2/core/base.hpp:58,
                   from /home/ci/opencv-python/opencv/modules/core/include/opencv2/core.hpp:53,
                   from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:8:
  /home/ci/opencv-python/opencv/modules/core/include/opencv2/core/cvstd_wrapper.hpp:143:10: note: candidate: ‘template<class _Tp, class ... A1> cv::Ptr<_Tp> cv::makePtr(const A1& ...)’
    143 | Ptr<_Tp> makePtr(const A1&... a1)
        |          ^~~~~~~
  /home/ci/opencv-python/opencv/modules/core/include/opencv2/core/cvstd_wrapper.hpp:143:10: note:   template argument deduction/substitution failed:
  In file included from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:90:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8406:34: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
   8406 |         new (&(self->v)) Ptr<cv::FlannBasedMatcher>(); // init Ptr with placement new
        |                                  ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8406:34: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8406:51: error: template argument 1 is invalid
   8406 |         new (&(self->v)) Ptr<cv::FlannBasedMatcher>(); // init Ptr with placement new
        |                                                   ^
  In file included from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:15:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8407:35: error: request for member ‘reset’ in ‘self->pyopencv_FlannBasedMatcher_t::v’, which is of non-class type ‘int’
   8407 |         if(self) ERRWRAP2(self->v.reset(new cv::FlannBasedMatcher(indexParams, searchParams)));
        |                                   ^~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/cv2_util.hpp:102:5: note: in definition of macro ‘ERRWRAP2’
    102 |     expr; \
        |     ^~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8407:45: error: expected type-specifier
   8407 |         if(self) ERRWRAP2(self->v.reset(new cv::FlannBasedMatcher(indexParams, searchParams)));
        |                                             ^~
  /home/ci/opencv-python/opencv/modules/python/src2/cv2_util.hpp:102:5: note: in definition of macro ‘ERRWRAP2’
    102 |     expr; \
        |     ^~~~
  In file included from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:90:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h: In function ‘PyObject* pyopencv_cv_FlannBasedMatcher_create_static(PyObject*, PyObject*, PyObject*)’:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8418:9: error: ‘FlannBasedMatcher’ was not declared in this scope
   8418 |     Ptr<FlannBasedMatcher> retval;
        |         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8418:26: error: template argument 1 is invalid
   8418 |     Ptr<FlannBasedMatcher> retval;
        |                          ^
  In file included from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:15:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8422:31: error: ‘cv::FlannBasedMatcher’ has not been declared
   8422 |         ERRWRAP2(retval = cv::FlannBasedMatcher::create());
        |                               ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/cv2_util.hpp:102:5: note: in definition of macro ‘ERRWRAP2’
    102 |     expr; \
        |     ^~~~
  In file included from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:90:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h: At global scope:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8448:36: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
   8448 | struct PyOpenCV_Converter< Ptr<cv::FlannBasedMatcher> >
        |                                    ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8448:36: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8448:53: error: template argument 1 is invalid
   8448 | struct PyOpenCV_Converter< Ptr<cv::FlannBasedMatcher> >
        |                                                     ^
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_types_content.h:8448:55: error: template argument 1 is invalid
   8448 | struct PyOpenCV_Converter< Ptr<cv::FlannBasedMatcher> >
        |                                                       ^
  In file included from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:91:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_funcs.h: In function ‘PyObject* pyopencv_cv_FlannBasedMatcher_create(PyObject*, PyObject*, PyObject*)’:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_funcs.h:620:9: error: ‘FlannBasedMatcher’ was not declared in this scope
    620 |     Ptr<FlannBasedMatcher> retval;
        |         ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_funcs.h:620:26: error: template argument 1 is invalid
    620 |     Ptr<FlannBasedMatcher> retval;
        |                          ^
  In file included from /home/ci/opencv-python/opencv/modules/python/src2/cv2.cpp:15:
  /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build/modules/python_bindings_generator/pyopencv_generated_funcs.h:624:31: error: ‘cv::FlannBasedMatcher’ has not been declared
    624 |         ERRWRAP2(retval = cv::FlannBasedMatcher::create());
        |                               ^~~~~~~~~~~~~~~~~
  /home/ci/opencv-python/opencv/modules/python/src2/cv2_util.hpp:102:5: note: in definition of macro ‘ERRWRAP2’
    102 |     expr; \
        |     ^~~~
  gmake[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1
  gmake[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
  gmake: *** [all] Error 2
  Traceback (most recent call last):
    File "/tmp/pip-build-env-nrpr_6qr/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 672, in setup
      cmkr.make(make_args, install_target=cmake_install_target, env=env)
    File "/tmp/pip-build-env-nrpr_6qr/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 696, in make
      self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
    File "/tmp/pip-build-env-nrpr_6qr/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 741, in make_impl
      raise SKBuildError(msg)

  An error occurred while building with CMake.
    Command:
      /tmp/pip-build-env-nrpr_6qr/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake --build . --target install --config Release --
    Install target:
      install
    Source directory:
      /home/ci/opencv-python
    Working directory:
      /home/ci/opencv-python/_skbuild/linux-x86_64-3.9/cmake-build
  Please check the install target is valid and see CMake's output for more information.

  error: subprocess-exited-with-error

@ioctl-user
Copy link
Author

Additional info.

In Windows these flags give no build errors:
-DBUILD_opencv_calib3d=OFF -DBUILD_opencv_ml=OFF -DBUILD_opencv_objdetect=OFF -DBUILD_opencv_photo=OFF -DBUILD_opencv_stitching=OFF -DBUILD_opencv_video=OFF

And each one of these give build error in different places:
-DBUILD_opencv_flann=OFF -DBUILD_opencv_features2d=OFF

Others related to the internal modules not tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@ioctl-user and others