ORNL / ORNL/ExaGO

Upgrade pybind11 to the latest 2.x version

Open
#27 0 comments 0 reactions 1 assignee View on GitHub

@PhilipFackler is already working on this.

Since Apr 2, 2026.

enhancement
Dominant language
Python
Stars
15
Forks
9
Avg merge
4h 34m
Merged PRs (30d)
1

Description

Issue type

Feature Request

Issue applies to:
  • PFLOW
  • OPFLOW
  • TCOPFLOW
  • SCOPFLOW
  • SOPFLOW
  • CMake and build system
  • Spack
  • Visualization
  • Documentation
  • Other
Summary

Update python bindings submodule pybind11 to the latest 2.x version, currently 2.13.6. Currently we get some deprecation warnings during pybind11 configuration and compilation. Currently used version in ExaGO is 3 years old so updating to the latest stable will likely address some of the warnings.

Description how to reproduce the issue

Example warnings coming from pybind11:

In lambda function,
    inlined from 'Return pybind11::detail::argument_loader<Args>::call_impl(Func&&, std::index_sequence<Is ...>, Guard&&) && [with Return = int; Func = test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&; long unsigned int ...Is = {0}; Guard = pybind11::detail::void_type; Args = {std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >}]' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h:1504:37,
    inlined from 'std::enable_if_t<(! std::is_void<_Dummy>::value), Return> pybind11::detail::argument_loader<Args>::call(Func&&) && [with Return = int; Guard = pybind11::detail::void_type; Func = test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&; Args = {std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >}]' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h:1472:72,
    inlined from 'pybind11::cpp_function::initialize<test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>, int, std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >, pybind11::name, pybind11::scope, pybind11::sibling>(test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&&, int (*)(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >), const pybind11::name&, const pybind11::scope&, const pybind11::sibling&)::<lambda(pybind11::detail::function_call&)>' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/pybind11.h:294:40,
    inlined from 'static constexpr pybind11::handle pybind11::cpp_function::initialize<test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>, int, std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >, pybind11::name, pybind11::scope, pybind11::sibling>(test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&&, int (*)(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >), const pybind11::name&, const pybind11::scope&, const pybind11::sibling&)::<lambda(pybind11::detail::function_call&)>::_FUN(pybind11::detail::function_call&)' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/pybind11.h:265:21:
/Users/55y/src/exago/ExaGO/tpl/pybind11/tests/test_copy_move.cpp:233:38: warning: '((__tuple_element_t<0, std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >*)((char*)&<unnamed> + offsetof(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >,std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >::<unnamed>.std::_Optional_base<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>, false, false>::_M_payload.std::_Optional_payload<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>, false, false, false>::<unnamed>.std::_Optional_payload<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>, true, false, false>::<unnamed>.std::_Optional_payload_base<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >::_M_payload)))[2].MoveOrCopyInt::value' may be used uninitialized [-Wmaybe-uninitialized]
  233 |               return std::get<0>(*x).value + std::get<1>(*x).value + std::get<2>(*x).value;
      |                      ~~~~~~~~~~~~~~~~^~~~~
In file included from /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/attr.h:14,
                 from /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/detail/class.h:12,
                 from /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/pybind11.h:13,
                 from /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/stl.h:12,
                 from /Users/55y/src/exago/ExaGO/tpl/pybind11/tests/test_copy_move.cpp:11:
/Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h: In static member function 'static constexpr pybind11::handle pybind11::cpp_function::initialize<test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>, int, std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >, pybind11::name, pybind11::scope, pybind11::sibling>(test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&&, int (*)(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >), const pybind11::name&, const pybind11::scope&, const pybind11::sibling&)::<lambda(pybind11::detail::function_call&)>::_FUN(pybind11::detail::function_call&)':
/Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h:1504:37: note: '<anonymous>' declared here
 1504 |         return std::forward<Func>(f)(cast_op<Args>(std::move(std::get<Is>(argcasters)))...);
      |                ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In lambda function,
    inlined from 'Return pybind11::detail::argument_loader<Args>::call_impl(Func&&, std::index_sequence<Is ...>, Guard&&) && [with Return = int; Func = test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&; long unsigned int ...Is = {0}; Guard = pybind11::detail::void_type; Args = {std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >}]' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h:1504:37,
    inlined from 'std::enable_if_t<(! std::is_void<_Dummy>::value), Return> pybind11::detail::argument_loader<Args>::call(Func&&) && [with Return = int; Guard = pybind11::detail::void_type; Func = test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&; Args = {std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >}]' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h:1472:72,
    inlined from 'pybind11::cpp_function::initialize<test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>, int, std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >, pybind11::name, pybind11::scope, pybind11::sibling>(test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&&, int (*)(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >), const pybind11::name&, const pybind11::scope&, const pybind11::sibling&)::<lambda(pybind11::detail::function_call&)>' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/pybind11.h:294:40,
    inlined from 'static constexpr pybind11::handle pybind11::cpp_function::initialize<test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>, int, std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >, pybind11::name, pybind11::scope, pybind11::sibling>(test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&&, int (*)(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >), const pybind11::name&, const pybind11::scope&, const pybind11::sibling&)::<lambda(pybind11::detail::function_call&)>::_FUN(pybind11::detail::function_call&)' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/pybind11.h:265:21:
/Users/55y/src/exago/ExaGO/tpl/pybind11/tests/test_copy_move.cpp:233:62: warning: '((__tuple_element_t<1, std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >*)((char*)&<unnamed> + offsetof(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >,std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >::<unnamed>.std::_Optional_base<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>, false, false>::_M_payload.std::_Optional_payload<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>, false, false, false>::<unnamed>.std::_Optional_payload<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>, true, false, false>::<unnamed>.std::_Optional_payload_base<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >::_M_payload)))[1].MoveOnlyInt::value' may be used uninitialized [-Wmaybe-uninitialized]
  233 |               return std::get<0>(*x).value + std::get<1>(*x).value + std::get<2>(*x).value;
      |                                              ~~~~~~~~~~~~~~~~^~~~~
/Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h: In static member function 'static constexpr pybind11::handle pybind11::cpp_function::initialize<test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>, int, std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >, pybind11::name, pybind11::scope, pybind11::sibling>(test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&&, int (*)(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >), const pybind11::name&, const pybind11::scope&, const pybind11::sibling&)::<lambda(pybind11::detail::function_call&)>::_FUN(pybind11::detail::function_call&)':
/Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h:1504:37: note: '<anonymous>' declared here
 1504 |         return std::forward<Func>(f)(cast_op<Args>(std::move(std::get<Is>(argcasters)))...);
      |                ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In lambda function,
    inlined from 'Return pybind11::detail::argument_loader<Args>::call_impl(Func&&, std::index_sequence<Is ...>, Guard&&) && [with Return = int; Func = test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&; long unsigned int ...Is = {0}; Guard = pybind11::detail::void_type; Args = {std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >}]' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h:1504:37,
    inlined from 'std::enable_if_t<(! std::is_void<_Dummy>::value), Return> pybind11::detail::argument_loader<Args>::call(Func&&) && [with Return = int; Guard = pybind11::detail::void_type; Func = test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&; Args = {std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >}]' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h:1472:72,
    inlined from 'pybind11::cpp_function::initialize<test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>, int, std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >, pybind11::name, pybind11::scope, pybind11::sibling>(test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&&, int (*)(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >), const pybind11::name&, const pybind11::scope&, const pybind11::sibling&)::<lambda(pybind11::detail::function_call&)>' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/pybind11.h:294:40,
    inlined from 'static constexpr pybind11::handle pybind11::cpp_function::initialize<test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>, int, std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >, pybind11::name, pybind11::scope, pybind11::sibling>(test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&&, int (*)(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >), const pybind11::name&, const pybind11::scope&, const pybind11::sibling&)::<lambda(pybind11::detail::function_call&)>::_FUN(pybind11::detail::function_call&)' at /Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/pybind11.h:265:21:
/Users/55y/src/exago/ExaGO/tpl/pybind11/tests/test_copy_move.cpp:233:86: warning: '*(__tuple_element_t<2, std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >*)((char*)&<unnamed> + offsetof(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >,std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >::<unnamed>.std::_Optional_base<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>, false, false>::<unnamed>)).CopyOnlyInt::value' may be used uninitialized [-Wmaybe-uninitialized]
  233 |               return std::get<0>(*x).value + std::get<1>(*x).value + std::get<2>(*x).value;
      |                                                                      ~~~~~~~~~~~~~~~~^~~~~
/Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h: In static member function 'static constexpr pybind11::handle pybind11::cpp_function::initialize<test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>, int, std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >, pybind11::name, pybind11::scope, pybind11::sibling>(test_submodule_copy_move_policies(pybind11::module_&)::<lambda(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >)>&&, int (*)(std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt> >), const pybind11::name&, const pybind11::scope&, const pybind11::sibling&)::<lambda(pybind11::detail::function_call&)>::_FUN(pybind11::detail::function_call&)':
/Users/55y/src/exago/ExaGO/tpl/pybind11/include/pybind11/cast.h:1504:37: note: '<anonymous>' declared here
 1504 |         return std::forward<Func>(f)(cast_op<Args>(std::move(std::get<Is>(argcasters)))...);
      |                ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ExaGO version

develop at https://github.com/ORNL/ExaGO/commit/69f5b0eb23e842eadcc7c4e1230d5013339b0fbe

System and environment details

MacOS 15.7.5, Python 3.13.3, GCC 13.4.0.

Additional information

No response

Proposed solution

Set pybind11 git submodule to v2.13.6 tag. Make sure the code builds cleanly and all tests pass.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.