tomviz icon indicating copy to clipboard operation
tomviz copied to clipboard

update pybind11 to 2.13.1

Open kevinsmia1939 opened this issue 2 weeks ago • 0 comments

Old pybind11 is not compatible with Python 3.11. https://github.com/pybind/pybind11/pull/3694

Pybind11 need to be update, otherwise this error appear. Test on Linux openSUSE Tumbleweed.

In file included from /run/build/Tomviz/tomviz/pybind11/PybindVTKTypeCaster.h:7,
                 from /run/build/Tomviz/tomviz/pybind11/Wrapping.cxx:5:
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/cast.h: In function ‘std::string pybind11::detail::error_string()’:
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/cast.h:446:36: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
  446 |                 "  " + handle(frame->f_code->co_filename).cast<std::string>() +
      |                                    ^~
In file included from /usr/include/python3.11/Python.h:42,
                 from /run/build/Tomviz/thirdparty/pybind11/include/pybind11/detail/common.h:112,
                 from /run/build/Tomviz/thirdparty/pybind11/include/pybind11/pytypes.h:12,
                 from /run/build/Tomviz/thirdparty/pybind11/include/pybind11/cast.h:13:
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/cast.h:446:75: error: expected primary-expression before ‘>’ token
  446 |                 "  " + handle(frame->f_code->co_filename).cast<std::string>() +
      |                                                                           ^
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/cast.h:446:77: error: expected primary-expression before ‘)’ token
  446 |                 "  " + handle(frame->f_code->co_filename).cast<std::string>() +
      |                                                                             ^
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/cast.h:448:29: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
  448 |                 handle(frame->f_code->co_name).cast<std::string>() + "\n";
      |                             ^~
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/cast.h:448:64: error: expected primary-expression before ‘>’ token
  448 |                 handle(frame->f_code->co_name).cast<std::string>() + "\n";
      |                                                                ^
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/cast.h:448:66: error: expected primary-expression before ‘)’ token
  448 |                 handle(frame->f_code->co_name).cast<std::string>() + "\n";
      |                                                                  ^
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/cast.h:449:26: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
  449 |             frame = frame->f_back;
      |                          ^~
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
In file included from /run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h:44,
                 from /run/build/Tomviz/tomviz/pybind11/PybindVTKTypeCaster.h:8:
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/attr.h: At global scope:
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/attr.h:185:10: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
  185 |     std::uint16_t nargs;
      |          ^~~~~~~~
      |          wint_t
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/attr.h: In constructor ‘pybind11::detail::function_call::function_call(const pybind11::detail::function_record&, pybind11::handle)’:
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/attr.h:287:20: error: ‘const struct pybind11::detail::function_record’ has no member named ‘nargs’; did you mean ‘args’?
  287 |     args.reserve(f.nargs);
      |                    ^~~~~
      |                    args
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/attr.h:288:28: error: ‘const struct pybind11::detail::function_record’ has no member named ‘nargs’; did you mean ‘args’?
  288 |     args_convert.reserve(f.nargs);
      |                            ^~~~~
      |                            args
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h: In member function ‘void pybind11::cpp_function::initialize_generic(pybind11::detail::function_record*, const char*, const std::type_info* const*, pybind11::size_t)’:
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h:288:14: error: ‘struct pybind11::detail::function_record’ has no member named ‘nargs’; did you mean ‘args’?
  288 |         rec->nargs = (std::uint16_t) args;
      |              ^~~~~
      |              args
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h:288:28: error: ‘uint16_t’ is not a member of ‘std’; did you mean ‘wint_t’?
  288 |         rec->nargs = (std::uint16_t) args;
      |                            ^~~~~~~~
      |                            wint_t
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h: In static member function ‘static PyObject* pybind11::cpp_function::dispatcher(PyObject*, PyObject*, PyObject*)’:
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h:486:40: error: ‘const struct pybind11::detail::function_record’ has no member named ‘nargs’; did you mean ‘args’?
  486 |                 size_t pos_args = func.nargs;    // Number of positional arguments that we need
      |                                        ^~~~~
      |                                        args
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h:617:53: error: ‘const struct pybind11::detail::function_record’ has no member named ‘nargs’; did you mean ‘args’?
  617 |                     second_pass_convert.resize(func.nargs, false);
      |                                                     ^~~~~
      |                                                     args
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h: In function ‘pybind11::function pybind11::get_type_overload(const void*, const detail::type_info*, const char*)’:
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h:2053:49: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’; did you mean ‘cframe’?
 2053 |     PyFrameObject *frame = PyThreadState_Get()->frame;
      |                                                 ^~~~~
      |                                                 cframe
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h:2054:41: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
 2054 |     if (frame && (std::string) str(frame->f_code->co_name) == name &&
      |                                         ^~
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h:2055:14: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
 2055 |         frame->f_code->co_argcount > 0) {
      |              ^~
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h:2058:18: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
 2058 |             frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));
      |                  ^~
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
In file included from /usr/include/python3.11/Python.h:38:
/run/build/Tomviz/thirdparty/pybind11/include/pybind11/pybind11.h:2058:30: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
 2058 |             frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));
      |                              ^~~~~~~~~~~~~~~~
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~

By submitting this pull request I agree to the terms of the Developer Certificate or Origin.

kevinsmia1939 avatar Jun 28 '24 10:06 kevinsmia1939