opencv / ade

Apache License 2.0
59 stars 49 forks source link

Bumped into error in ade-0.1.1f zip file which failed to compile opencv-python in python:3.10-+alpine image today which usually success previously #43

Open hteeyeoh opened 6 months ago

hteeyeoh commented 6 months ago

Expected behaviour Successfully install opencv-python as usual in python:3.10-alpine image as usual

Actual behaviour Compilation failed

Steps to reproduce pip install opencv-python in python:3.10 alpine image

opencv-python = opencv-python==4.6.0.66 62.48 ninja: job failed: /usr/bin/c++ -I/tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ippicv/ippicv_lnx/icv/include -I/tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ippicv/ippicv_lnx/iw/include -I/tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include -isystem /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build -fsigned-char -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 -std=c++11 -fPIC -MD -MT CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.1f/sources/ade/source/topological_sort.cpp.o -MF CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.1f/sources/ade/source/topological_sort.cpp.o.d -o CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.1f/sources/ade/source/topological_sort.cpp.o -c /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/source/topological_sort.cpp 62.48 In file included from /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/passes/topological_sort.hpp:17, 62.48 from /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/source/topological_sort.cpp:7: 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp:101:10: error: 'uintptr_t' in namespace 'std' does not name a type 62.48 101 | std::uintptr_t m_srcGraph; 62.48 | ^~~~~ 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp:22:1: note: 'std::uintptr_t' is defined in header ''; did you forget to '#include '? 62.48 21 | #include "typed_metadata.hpp" 62.48 +++ |+#include 62.48 22 | 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp: In member function 'const ade::Graph& ade::ConstTypedGraph::getCGraph() const': 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp:106:53: error: 'm_srcGraph' was not declared in this scope 62.48 106 | return reinterpret_cast(m_srcGraph); 62.48 | ^~~~~~ 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp: In constructor 'ade::ConstTypedGraph::ConstTypedGraph(const ade::Graph&)': 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp:122:9: error: class 'ade::ConstTypedGraph' does not have any field named 'm_srcGraph' 62.48 122 | m_srcGraph(reinterpret_caststd::uintptr_t(&graph)) 62.48 | ^~~~~~ 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp:122:42: error: 'uintptr_t' in namespace 'std' does not name a type 62.48 122 | m_srcGraph(reinterpret_caststd::uintptr_t(&graph)) 62.48 | ^~~~~ 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp:122:37: note: 'std::uintptr_t' is defined in header ''; did you forget to '#include '? 62.48 122 | m_srcGraph(reinterpret_caststd::uintptr_t(&graph)) 62.48 | ^~~ 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp: In constructor 'ade::ConstTypedGraph::ConstTypedGraph(const ade::ConstTypedGraph<OtherTypes ...>&)': 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp:130:9: error: class 'ade::ConstTypedGraph' does not have any field named 'm_srcGraph' 62.48 130 | m_srcGraph(other.m_srcGraph) 62.48 | ^~~~~~ 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp: In instantiation of 'ade::Graph& ade::TypedGraph::getGraph() const [with Types = {ade::passes::TopologicalSortData}]': 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp:238:16: required from 'ade::Graph::NodesListRange ade::TypedGraph::nodes() [with Types = {ade::passes::TopologicalSortData}; ade::Graph::NodesListRange = ade::util::Range::MapRange<ade::util::Range::IterRange<__gnu_cxx::__normal_iterator<std::shared_ptrade::Node, std::vector > >, ade::Graph::HandleMapper>]' 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/source/topological_sort.cpp:39:40: required from here 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp:167:53: error: 'const class ade::TypedGraphade::passes::TopologicalSortData' has no member named 'm_srcGraph' 62.48 167 | return reinterpret_castade::Graph*(this->m_srcGraph); 62.48 | ~~^~~~~~ 62.48 Note: Class cv::Feature2D has more than 1 base class (not supported by Python C extensions) 62.48 Bases: cv::Algorithm, cv::class, cv::Feature2D, cv::Algorithm 62.48 Only the first base class will be used 62.48 Note: Class cv::detail::GraphCutSeamFinder has more than 1 base class (not supported by Python C extensions) 62.48 Bases: cv::detail::GraphCutSeamFinderBase, cv::detail::SeamFinder 62.48 Only the first base class will be used 62.48 ninja: subcommand failed 62.48 Traceback (most recent call last): 62.48 File "/tmp/pip-build-env-z3sx64lf/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 674, in setup 62.48 cmkr.make(make_args, install_target=cmake_install_target, env=env) 62.48 File "/tmp/pip-build-env-z3sx64lf/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 697, in make 62.48 self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env) 62.48 File "/tmp/pip-build-env-z3sx64lf/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 742, in make_impl 62.48 raise SKBuildError(msg) 62.48 62.48 An error occurred while building with CMake. 62.48 Command: 62.48 /tmp/pip-build-env-z3sx64lf/overlay/lib/python3.10/site-packages/cmake/data/bin/cmake --build . --target install --config Release -- 62.48 Install target: 62.48 install 62.48 Source directory: 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a 62.48 Working directory: 62.48 /tmp/pip-install-ikpi2bfw/opencv-python_cd41126da3fb445da2c1bce7c2f69c2a/_skbuild/linux-x86_64-3.10/cmake-build 62.48 Please check the install target is valid and see CMake's output for more information. 62.48 62.48 [end of output] 62.48 62.48 note: This error originates from a subprocess, and is likely not a problem with pip. 62.48 ERROR: Failed building wheel for opencv-python 62.48 Successfully built unstructured-inference 62.48 Failed to build opencv-python 62.48 ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects

Is it something newly added in the ade source that cause something broken? tmp/pip-install-tltrnbg7/opencv-python_218517a01db34d7aa0d9c09d5f167498/_skbuild/linux-x86_64-3.10/cmake-build/3rdparty/ade/ade-0.1.1f/sources/ade/include/ade/typed_graph.hpp:22:1: note: 'std::uintptr_t' is defined in header ''; did you forget to '#include '? 412.4 21 | #include "typed_metadata.hpp" 412.4 +++ |+#include 412.4 22 |

opencv-alalek commented 6 months ago

opencv-python==4.6.0.66

There is no way to amend already released code (>1 year ago). Try to upgrade and verify the latest release.


note: 'std::uintptr_t' is defined in header ''; did you forget to '#include '?

Looks like compiler is broken in your build environment. Correct message should look like:

note: ‘uintptr_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?

hteeyeoh commented 6 months ago

@opencv-alalek erm this one i tried in python 3.11-alpine based image.. it failed because of imcompatible of alpine version. Hence i tried to downgrade to python3.10-alpine image. Then it was working all the way until recently bumped into issue. I tried to install the unstructured[pdf] python module and underlying it install opencv. I do saw it download the latest version but due to pip runtime backtracing issue it will still downloading the old version to find the most suitable to match across all the dependencies. Hence i bumped to this problem and stuck.

For environment, i think im using the same system env which previously working. and since im working on docker images and i think those things will be independent as stated in Dockerfile.

While this is the numpy issue i saw when using python3.11-alpine as base image: ERROR: Ignored the following versions that require a different python version: 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11

11 221.2 ERROR: Could not find a version that satisfies the requirement numpy==1.21.2 (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 1.13.3, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0, 1.21.1, 1.22.0, 1.22.1, 1.22.2, 1.22.3, 1.22.4, 1.23.0rc1, 1.23.0rc2, 1.23.0rc3, 1.23.0, 1.23.1, 1.23.2, 1.23.3, 1.23.4, 1.23.5, 1.24.0rc1, 1.24.0rc2, 1.24.0, 1.24.1, 1.24.2, 1.24.3, 1.24.4, 1.25.0rc1, 1.25.0, 1.25.1, 1.25.2, 1.26.0b1, 1.26.0rc1, 1.26.0, 1.26.1, 1.26.2)

11 221.2 ERROR: No matching distribution found for numpy==1.21.2