From f7c21dbaf8b4114c1cd7a3e6f16349da8ad5b735 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Wed, 16 Aug 2023 01:24:05 +0200 Subject: [PATCH] Update python generation scripts for latest gcc --- python/generate-python-stubs.sh | 2 +- python/generate-python.sh | 4 ++-- python/patch-001.diff | 6 +++--- python/patch-007.diff | 4 ++-- python/src/mrpt/config/CLoadableOptions.cpp | 6 +++--- python/src/mrpt/hwdrivers/CNTRIPClient.cpp | 2 +- python/src/std/stl_deque.cpp | 4 ++-- python/src/std/stl_deque_1.cpp | 4 ++-- python/src/std/stl_deque_2.cpp | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/python/generate-python-stubs.sh b/python/generate-python-stubs.sh index 07e4efd0b1..f05122644b 100755 --- a/python/generate-python-stubs.sh +++ b/python/generate-python-stubs.sh @@ -16,4 +16,4 @@ stubgen -p mrpt -p mrpt.pymrpt -o stubs-out # applying manual patches to stubs: echo "Applying manual patches to stubs..." -find . -name "patch-stubs*.diff" | xargs -I FIL bash -c "echo FIL && git apply FIL" +find . -name "patch-stubs*.diff" | xargs -I FIL bash -c "echo FIL && git apply FIL --ignore-whitespace" diff --git a/python/generate-python.sh b/python/generate-python.sh index 1759f09a22..c6e320f649 100755 --- a/python/generate-python.sh +++ b/python/generate-python.sh @@ -4,7 +4,7 @@ # Based on https://github.com/RosettaCommons/binder # # binder config: llvm-14 -# +# PYBIND11_VERSION=$(dpkg -s pybind11-dev | grep '^Version:' | cut -d " " -f2) @@ -94,5 +94,5 @@ find $WRAP_OUT_DIR -name "*.cpp" | xargs -I FIL \ # applying manual patches: echo "Applying manual patches to pybind11 code..." -find . -name "patch-0*.diff" | xargs -I FIL bash -c "echo FIL && git apply FIL" +find . -name "patch-0*.diff" | xargs -I FIL bash -c "echo \"Applying patch: FIL\" && git apply FIL --ignore-whitespace" diff --git a/python/patch-001.diff b/python/patch-001.diff index a34ff86e54..d6f68276e5 100644 --- a/python/patch-001.diff +++ b/python/patch-001.diff @@ -24,7 +24,7 @@ index cabe86ec7..302018560 100644 + void bind_std_stl_deque(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // std::deque file:bits/stl_deque.h line:766 + { // std::deque file:bits/stl_deque.h line:767 diff --git a/python/src/std/stl_deque_1.cpp b/python/src/std/stl_deque_1.cpp index d974577d3..a80326114 100644 --- a/python/src/std/stl_deque_1.cpp @@ -38,7 +38,7 @@ index d974577d3..a80326114 100644 + void bind_std_stl_deque_1(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // std::deque file:bits/stl_deque.h line:766 + { // std::deque file:bits/stl_deque.h line:767 diff --git a/python/src/std/stl_deque_2.cpp b/python/src/std/stl_deque_2.cpp index ca96e381d..54e7eaaf4 100644 --- a/python/src/std/stl_deque_2.cpp @@ -51,7 +51,7 @@ index ca96e381d..54e7eaaf4 100644 + void bind_std_stl_deque_2(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // std::deque file:bits/stl_deque.h line:766 + { // std::deque file:bits/stl_deque.h line:767 diff --git a/python/src/std/stl_map.cpp b/python/src/std/stl_map.cpp index db3f49fde..793bf72f3 100644 --- a/python/src/std/stl_map.cpp diff --git a/python/patch-007.diff b/python/patch-007.diff index a890a43d83..2501a44b3f 100644 --- a/python/patch-007.diff +++ b/python/patch-007.diff @@ -12,7 +12,7 @@ index 1638b4d29..4c5984034 100644 + }, pybind11::keep_alive<0, 1>()); + } - { // std::deque file:bits/stl_deque.h line:766 + { // std::deque file:bits/stl_deque.h line:767 pybind11::class_>, std::shared_ptr>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_math_TPose2D_mrpt_bayes_particle_storage_mode_VALUE_t", ""); @@ -90,5 +95,10 @@ void bind_std_stl_deque(std::function< pybind11::module &(std::string const &nam cl.def("pop_back", (void (std::deque>::*)()) &std::deque>::pop_back, "C++: std::deque>::pop_back() --> void"); @@ -39,7 +39,7 @@ index b16449336..69668158e 100644 + }, pybind11::keep_alive<0, 1>()); + } - { // std::deque file:bits/stl_deque.h line:766 + { // std::deque file:bits/stl_deque.h line:767 pybind11::class_>, std::shared_ptr>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_maps_CRBPFParticleData_mrpt_bayes_particle_storage_mode_POINTER_t", ""); @@ -91,5 +96,10 @@ void bind_std_stl_deque_1(std::function< pybind11::module &(std::string const &n cl.def("pop_back", (void (std::deque>::*)()) &std::deque>::pop_back, "C++: std::deque>::pop_back() --> void"); diff --git a/python/src/mrpt/config/CLoadableOptions.cpp b/python/src/mrpt/config/CLoadableOptions.cpp index 24034f6c6d..2d2736b5a9 100644 --- a/python/src/mrpt/config/CLoadableOptions.cpp +++ b/python/src/mrpt/config/CLoadableOptions.cpp @@ -24,7 +24,7 @@ PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif -// mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:26 +// mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:24 struct PyCallBack_mrpt_config_CLoadableOptions : public mrpt::config::CLoadableOptions { using mrpt::config::CLoadableOptions::CLoadableOptions; @@ -58,8 +58,8 @@ struct PyCallBack_mrpt_config_CLoadableOptions : public mrpt::config::CLoadableO void bind_mrpt_config_CLoadableOptions(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:26 - pybind11::class_, PyCallBack_mrpt_config_CLoadableOptions> cl(M("mrpt::config"), "CLoadableOptions", "This is a virtual base class for sets of options than can be loaded from\n and/or saved to configuration plain-text files.\n"); + { // mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:24 + pybind11::class_, PyCallBack_mrpt_config_CLoadableOptions> cl(M("mrpt::config"), "CLoadableOptions", "This is a virtual base class for sets of options than can be loaded from\n and/or saved to configuration plain-text files.\n \n\n\n "); cl.def(pybind11::init()); cl.def( pybind11::init( [](){ return new PyCallBack_mrpt_config_CLoadableOptions(); } ) ); cl.def("loadFromConfigFile", (void (mrpt::config::CLoadableOptions::*)(const class mrpt::config::CConfigFileBase &, const std::string &)) &mrpt::config::CLoadableOptions::loadFromConfigFile, "This method load the options from a \".ini\"-like file or memory-stored\n string list.\n Only those parameters found in the given \"section\" and having\n the same name that the variable are loaded. Those not found in\n the file will stay with their previous values (usually the default\n values loaded at initialization). An example of an \".ini\" file:\n \n\n\n\n\n\n \n loadFromConfigFileName, saveToConfigFile\n\nC++: mrpt::config::CLoadableOptions::loadFromConfigFile(const class mrpt::config::CConfigFileBase &, const std::string &) --> void", pybind11::arg("source"), pybind11::arg("section")); diff --git a/python/src/mrpt/hwdrivers/CNTRIPClient.cpp b/python/src/mrpt/hwdrivers/CNTRIPClient.cpp index 2440654c69..238eb4ff34 100644 --- a/python/src/mrpt/hwdrivers/CNTRIPClient.cpp +++ b/python/src/mrpt/hwdrivers/CNTRIPClient.cpp @@ -355,7 +355,7 @@ void bind_mrpt_hwdrivers_CNTRIPClient(std::function< pybind11::module &(std::str } { // mrpt::hwdrivers::CNTRIPEmitter file:mrpt/hwdrivers/CNTRIPEmitter.h line:62 - pybind11::class_, PyCallBack_mrpt_hwdrivers_CNTRIPEmitter, mrpt::hwdrivers::CGenericSensor> cl(M("mrpt::hwdrivers"), "CNTRIPEmitter", "This \"virtual driver\" encapsulates a NTRIP client (see CNTRIPClient) but\n adds the functionality of dumping the received datastream to a given serial\n port.\n Used within rawlog-grabber, along CGPSInterface, this class allows one to build\n a powerful & simple RTK-capable GPS receiver system.\n\n Therefore, this sensor will never \"collect\" any observation via the\n CGenericSensor interface.\n\n See also the example configuration file for rawlog-grabber in\n \"share/mrpt/config_files/rawlog-grabber\".\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n The next picture summarizes existing MRPT classes related to GPS / GNSS\n devices (CGPSInterface, CNTRIPEmitter, CGPS_NTRIP):\n\n \n\n \n\n \n CGPSInterface, CGPS_NTRIP, CNTRIPClient"); + pybind11::class_, PyCallBack_mrpt_hwdrivers_CNTRIPEmitter, mrpt::hwdrivers::CGenericSensor> cl(M("mrpt::hwdrivers"), "CNTRIPEmitter", "This \"virtual driver\" encapsulates a NTRIP client (see CNTRIPClient) but\n adds the functionality of dumping the received datastream to a given serial\n port.\n Used within rawlog-grabber, along CGPSInterface, this class allows one to\n build a powerful & simple RTK-capable GPS receiver system.\n\n Therefore, this sensor will never \"collect\" any observation via the\n CGenericSensor interface.\n\n See also the example configuration file for rawlog-grabber in\n \"share/mrpt/config_files/rawlog-grabber\".\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n The next picture summarizes existing MRPT classes related to GPS / GNSS\n devices (CGPSInterface, CNTRIPEmitter, CGPS_NTRIP):\n\n \n\n \n\n \n CGPSInterface, CGPS_NTRIP, CNTRIPClient"); cl.def( pybind11::init( [](){ return new mrpt::hwdrivers::CNTRIPEmitter(); }, [](){ return new PyCallBack_mrpt_hwdrivers_CNTRIPEmitter(); } ) ); cl.def("GetRuntimeClass", (const struct mrpt::hwdrivers::TSensorClassId * (mrpt::hwdrivers::CNTRIPEmitter::*)() const) &mrpt::hwdrivers::CNTRIPEmitter::GetRuntimeClass, "C++: mrpt::hwdrivers::CNTRIPEmitter::GetRuntimeClass() const --> const struct mrpt::hwdrivers::TSensorClassId *", pybind11::return_value_policy::automatic); cl.def_static("CreateObject", (class mrpt::hwdrivers::CGenericSensor * (*)()) &mrpt::hwdrivers::CNTRIPEmitter::CreateObject, "C++: mrpt::hwdrivers::CNTRIPEmitter::CreateObject() --> class mrpt::hwdrivers::CGenericSensor *", pybind11::return_value_policy::automatic); diff --git a/python/src/std/stl_deque.cpp b/python/src/std/stl_deque.cpp index 4c59840342..6e96f8eb27 100644 --- a/python/src/std/stl_deque.cpp +++ b/python/src/std/stl_deque.cpp @@ -23,7 +23,7 @@ PYBIND11_MAKE_OPAQUE(std::deque &M) { - { // std::deque file:bits/stl_deque.h line:766 + { // std::deque file:bits/stl_deque.h line:767 pybind11::class_>, std::shared_ptr>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_math_TPose3D_mrpt_bayes_particle_storage_mode_VALUE_t", ""); cl.def( pybind11::init( [](){ return new std::deque>(); } ) ); cl.def( pybind11::init > &>(), pybind11::arg("__a") ); @@ -62,7 +62,7 @@ void bind_std_stl_deque(std::function< pybind11::module &(std::string const &nam }, pybind11::keep_alive<0, 1>()); } - { // std::deque file:bits/stl_deque.h line:766 + { // std::deque file:bits/stl_deque.h line:767 pybind11::class_>, std::shared_ptr>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_math_TPose2D_mrpt_bayes_particle_storage_mode_VALUE_t", ""); cl.def( pybind11::init( [](){ return new std::deque>(); } ) ); cl.def( pybind11::init > &>(), pybind11::arg("__a") ); diff --git a/python/src/std/stl_deque_1.cpp b/python/src/std/stl_deque_1.cpp index 69668158ed..3fe005dcf4 100644 --- a/python/src/std/stl_deque_1.cpp +++ b/python/src/std/stl_deque_1.cpp @@ -31,7 +31,7 @@ PYBIND11_MAKE_OPAQUE(std::deque &M) { - { // std::deque file:bits/stl_deque.h line:766 + { // std::deque file:bits/stl_deque.h line:767 pybind11::class_, std::shared_ptr>> cl(M("std"), "deque_mrpt_math_TPose3D_t", ""); cl.def( pybind11::init( [](){ return new std::deque(); } ) ); cl.def( pybind11::init &>(), pybind11::arg("__a") ); @@ -70,7 +70,7 @@ void bind_std_stl_deque_1(std::function< pybind11::module &(std::string const &n }, pybind11::keep_alive<0, 1>()); } - { // std::deque file:bits/stl_deque.h line:766 + { // std::deque file:bits/stl_deque.h line:767 pybind11::class_>, std::shared_ptr>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_maps_CRBPFParticleData_mrpt_bayes_particle_storage_mode_POINTER_t", ""); cl.def( pybind11::init( [](){ return new std::deque>(); } ) ); cl.def( pybind11::init > &>(), pybind11::arg("__a") ); diff --git a/python/src/std/stl_deque_2.cpp b/python/src/std/stl_deque_2.cpp index 3ad4f52e77..744ff62ac6 100644 --- a/python/src/std/stl_deque_2.cpp +++ b/python/src/std/stl_deque_2.cpp @@ -20,7 +20,7 @@ PYBIND11_MAKE_OPAQUE(std::deque) void bind_std_stl_deque_2(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // std::deque file:bits/stl_deque.h line:766 + { // std::deque file:bits/stl_deque.h line:767 pybind11::class_, std::shared_ptr>> cl(M("std"), "deque_mrpt_system_CDirectoryExplorer_TFileInfo_t", ""); cl.def( pybind11::init( [](){ return new std::deque(); } ) ); cl.def( pybind11::init &>(), pybind11::arg("__a") );