analogdevicesinc / gr-iio

IIO blocks for GNU Radio
GNU General Public License v3.0
94 stars 62 forks source link

Upgrade 3.9 - new branch to use with gnuradio3.9 with pybind11 #88

Closed chrisjohgorman closed 3 years ago

chrisjohgorman commented 3 years ago

Hello,

I am trying to get a build error fixed with my modifications to gr-iio. This is gr-iio modified to run under pybind11. I don't know what I have missed.

My error is ... [ 67%] Building CXX object python/bindings/CMakeFiles/iio_python.dir/converter_ss_python.cc.o In file included from /usr/include/c++/10.2.0/bits/stl_iterator_base_types.h:67, from /usr/include/c++/10.2.0/bits/forward_list.h:36, from /usr/include/c++/10.2.0/forward_list:38, from /usr/include/python3.8/pybind11/detail/common.h:143, from /usr/include/python3.8/pybind11/pytypes.h:12, from /usr/include/python3.8/pybind11/cast.h:13, from /usr/include/python3.8/pybind11/attr.h:13, from /usr/include/python3.8/pybind11/pybind11.h:44, from /usr/include/python3.8/pybind11/complex.h:12, from /home/chris/src/iio/gr-iio/python/bindings/converter_ss_python.cc:20: /usr/include/c++/10.2.0/type_traits: In instantiation of ‘struct std::is_base_of<pybind11::detail::pyobject_tag, iio_channel>’: /usr/include/c++/10.2.0/tuple:69:28: recursively required by substitution of ‘template class pybind11::detail::type_caster<T, typename std::enable_if<std::is_base_of<pybind11::detail::pyobject_tag, typename std::remove_reference<_Tp>::type>::value, void>::type> [with T = iio_channel]’ /usr/include/c++/10.2.0/tuple:69:28: required from ‘struct std::_Tuple_impl<1, pybind11::detail::type_caster<iio_channel, void>, pybind11::detail::type_caster<bool, void> >’ /usr/include/c++/10.2.0/tuple:191:12: required from ‘struct std::_Tuple_impl<0, pybind11::detail::type_caster<pybind11::detail::value_and_holder, void>, pybind11::detail::type_caster<iio_channel, void>, pybind11::detail::type_caster<bool, void> >’ /usr/include/c++/10.2.0/tuple:516:11: required from ‘class std::tuple<pybind11::detail::type_caster<pybind11::detail::value_and_holder, void>, pybind11::detail::type_caster<iio_channel, void>, pybind11::detail::type_caster<bool, void> >’ /usr/include/python3.8/pybind11/cast.h:1985:38: required from ‘class pybind11::detail::argument_loader<pybind11::detail::value_and_holder&, const iio_channel, bool>’ /usr/include/python3.8/pybind11/pybind11.h:133:77: required from ‘void pybind11::cpp_function::initialize(Func&&, Return ()(Args ...), const Extra& ...) [with Func = pybind11::detail::initimpl::factory<Func, pybind11::detail::voidtype (*)(), Return(Args ...)>::execute<pybind11::class<gr::iio::converter_ss, gr::sync_block, gr::block, gr::basic_block, std::shared_ptr >, {pybind11::arg, pybind11::arg, const char}>::<lambda(pybind11::detail::value_and_holder&, const iio_channel, bool)>; Return = void; Args = {pybind11::detail::value_and_holder&, const iio_channel, bool}; Extra = {pybind11::name, pybind11::is_method, pybind11::sibling, pybind11::detail::is_new_style_constructor, pybind11::arg, pybind11::arg, const char}]’ /usr/include/python3.8/pybind11/pybind11.h:71:19: required from ‘pybind11::cpp_function::cpp_function(Func&&, const Extra& ...) [with Func = pybind11::detail::initimpl::factory<Func, pybind11::detail::voidtype (*)(), Return(Args ...)>::execute<pybind11::class<gr::iio::converter_ss, gr::sync_block, gr::block, gr::basic_block, std::shared_ptr >, {pybind11::arg, pybind11::arg, const char}>::<lambda(pybind11::detail::value_and_holder&, const iio_channel, bool)>; Extra = {pybind11::name, pybind11::is_method, pybind11::sibling, pybind11::detail::is_new_styleconstructor, pybind11::arg, pybind11::arg, const char*}; = void]’ /usr/include/python3.8/pybind11/pybind11.h:1118:22: required from ‘pybind11::class<type, options>& pybind11::class<type_, options>::def(const char, Func&&, const Extra& ...) [with Func = pybind11::detail::initimpl::factory<Func, pybind11::detail::void_type ()(), Return(Args ...)>::execute<pybind11::class_<gr::iio::converter_ss, gr::sync_block, gr::block, gr::basic_block, std::shared_ptr >, {pybind11::arg, pybind11::arg, const char}>::<lambda(pybind11::detail::value_and_holder&, const iio_channel, bool)>; Extra = {pybind11::detail::is_new_styleconstructor, pybind11::arg, pybind11::arg, const char*}; type = gr::iio::converter_ss; options = {gr::sync_block, gr::block, gr::basic_block, std::shared_ptr}]’ /usr/include/python3.8/pybind11/detail/init.h:234:15: required from ‘void pybind11::detail::initimpl::factory<Func, pybind11::detail::voidtype (*)(), Return(Args ...)>::execute(Class&, const Extra& ...) && [with Class = pybind11::class<gr::iio::converter_ss, gr::sync_block, gr::block, gr::basic_block, std::shared_ptr >; Extra = {pybind11::arg, pybind11::arg, const char}; Func = std::shared_ptr ()(const iio_channel, bool); Return = std::shared_ptr; Args = {const iio_channel, bool}]’ /usr/include/python3.8/pybind11/pybind11.h:1160:32: required from ‘pybind11::class<type, options>& pybind11::class<type, options>::def(pybind11::detail::initimpl::factory<Args ...>&&, const Extra& ...) [with Args = {std::shared_ptr ()(const iio_channel, bool), pybind11::detail::void_type ()(), std::shared_ptr(const iio_channel, bool), pybind11::detail::voidtype()}; Extra = {pybind11::arg, pybind11::arg, const char*}; type = gr::iio::converter_ss; options = {gr::sync_block, gr::block, gr::basic_block, std::shared_ptr}]’ /home/chris/src/iio/gr-iio/python/bindings/converter_ss_python.cc:43:9: required from here /usr/include/c++/10.2.0/type_traits:1412:38: error: invalid use of incomplete type ‘struct iio_channel’ 1412 | : public integral_constant<bool, __is_base_of(_Base, _Derived)>

I understand that gnuradio 3.9 will incorporate gr-iio, so I am not sure if I am doing something useful here. I have also never generated a pull request, so please let me know if I am missing something.

chrisjohgorman commented 3 years ago

Hello,

I found a way to build gr-iio for gnuradio 3.9. I used Edward Kigwana's repository of gnuradio, with his branch merge-griio-upstream. (https://github.com/ekigwana/gnuradio.git) This negates my need of porting gr-iio upgrade-3.8 to gnuradio 3.9 with pybind11. So this PR can be closed.

The merge-iio-upstream branch changes can be cut and pasted to the latest gnuradio without any problems.

Thanks,

Chris