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

Build python wheel fails #22565

Closed
vlasov01 opened this issue Oct 23, 2024 · 1 comment
Closed

Build python wheel fails #22565

vlasov01 opened this issue Oct 23, 2024 · 1 comment

Comments

@vlasov01
Copy link

vlasov01 commented Oct 23, 2024

Describe the issue

Building the wheel from the source (1.20.0) fails on Ubuntu 22 for armv7l.
It is similar to #21145

Linux pynq 5.15.19-xilinx-v2022.1 #1 SMP PREEMPT Mon Apr 11 17:52:14 UTC 2022 armv7l armv7l armv7l GNU/Linux
GNU ld (GNU Binutils for Ubuntu) 2.38
cmake version 3.31.20241016-gee2eadb
numpy 1.26.4

Urgency
No response

Target platform
armv7l

Build script

cd onnxruntime
./build.sh --config Release --parallel --skip_submodule_sync --skip_tests --use_xnnpack --build_wheel --cmake_extra_defines CMAKE_CXX_FLAGS="-Wno-dev -Wall -Wextra -O3 -g3 -mfloat-abi=hard -mfpu=neon-vfpv3 -mcpu=cortex-a9 -mfloat-abi=hard" CMAKE_C_FLAGS="-Wno-dev -Wall -Wextra -O3 -g3 -mfloat-abi=hard -mfpu=neon-vfpv3 -mcpu=cortex-a9 -mfloat-abi=hard" onnxruntime_BUILD_UNIT_TESTS=OFF

Error / output

/home/xilinx/onnxruntime/onnxruntime/python/onnxruntime_pybind_state.cc: In function ‘pybind11::array onnxruntime::python::PrimitiveTensorToNumpyFromDevice(const OrtValu                                                                                                                                                                            e&, const DataTransferAlternative&)’:
/home/xilinx/onnxruntime/onnxruntime/python/onnxruntime_pybind_state.cc:232:46: error: no matching function for call to ‘pybind11::dtype::dtype(const int&)’
  232 |   pybind11::array result(py::dtype(numpy_type), tensor.Shape().GetDims());
      |                                              ^
In file included from /usr/local/include/pybind11/cast.h:13,
                 from /usr/local/include/pybind11/attr.h:13,
                 from /usr/local/include/pybind11/pybind11.h:45,
                 from /home/xilinx/onnxruntime/onnxruntime/python/onnxruntime_pybind.h:18,
                 from /home/xilinx/onnxruntime/onnxruntime/python/onnxruntime_pybind_exceptions.h:6,
                 from /home/xilinx/onnxruntime/onnxruntime/python/onnxruntime_pybind_state.cc:5:
/usr/local/include/pybind11/numpy.h:464:5: note: candidate: ‘template<class Policy_> pybind11::dtype::dtype(const pybind11::detail::accessor<Policy_>&)’
  464 |     PYBIND11_OBJECT_DEFAULT(dtype, object, detail::npy_api::get().PyArrayDescr_Check_);
      |     ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/pybind11/numpy.h:464:5: note:   template argument deduction/substitution failed:
/home/xilinx/onnxruntime/onnxruntime/python/onnxruntime_pybind_state.cc:232:46: note:   mismatched types ‘const pybind11::detail::accessor<Policy_>’ and ‘const int’
  232 |   pybind11::array result(py::dtype(numpy_type), tensor.Shape().GetDims());
      |                                              ^
In file included from /home/xilinx/onnxruntime/onnxruntime/python/onnxruntime_pybind_mlvalue.h:9,
                 from /home/xilinx/onnxruntime/onnxruntime/python/onnxruntime_pybind_state.cc:6:
/usr/local/include/pybind11/numpy.h:478:5: note: candidate: ‘pybind11::dtype::dtype(pybind11::list, pybind11::list, pybind11::list, pybind11::ssize_t)’
  478 |     dtype(list names, list formats, list offsets, ssize_t itemsize) {
      |     ^~~~~
/usr/local/include/pybind11/numpy.h:478:5: note:   candidate expects 4 arguments, 1 provided
/usr/local/include/pybind11/numpy.h:476:5: note: candidate: ‘pybind11::dtype::dtype(const char*)’ (near match)
  476 |     dtype(const char *format) : dtype(std::string(format)) { }
      |     ^~~~~
/usr/local/include/pybind11/numpy.h:476:5: note:   conversion of argument 1 would be ill-formed:
/home/xilinx/onnxruntime/onnxruntime/python/onnxruntime_pybind_state.cc:232:36: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive]
  232 |   pybind11::array result(py::dtype(numpy_type), tensor.Shape().GetDims());
      |                                    ^~~~~~~~~~
      |                                    |
      |                                    int

@snnn
Copy link
Member

snnn commented Oct 24, 2024

Your pybind version is too low. Delete /usr/local/include/pybind11 , or upgrade it, or do the build in a clean docker environment.

@snnn snnn closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
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

2 participants