discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gr_modtool bind makes incorrect file


From: Josh Morman
Subject: Re: gr_modtool bind makes incorrect file
Date: Fri, 20 Jan 2023 06:48:28 -0500

Hi Jameson,

This should be fixed as Ryan mentioned by having pygccxml installed.  But for blocks with default interfaces as you described, gr_modtool bind should produce the same output as the default as of this fix: https://github.com/gnuradio/gnuradio/pull/6264 which got integrated after GR 3.10.2.0.  So updating to the latest 3.10.5.0 should resolve the issue (or installing pygccxml).

Josh

On Thu, Jan 19, 2023 at 3:20 PM Ryan Volz <ryan.volz@gmail.com> wrote:
Hi Jameson,

On 1/19/23 1:03 PM, Jameson Collins wrote:
> I am using gnuradio 3.10.2 from conda.  If I make a new module and
> simply edit its _impl.cc and yaml files then everything works correctly.
>
> If I take the same module, and run `gr_modtool bind` on it then the new
> binding file will be different and I'll get errors when trying to run.
>
> Here is the code to start with:
> ```
>      py::class_<newmod2, gr::sync_block, gr::block, gr::basic_block,
>          std::shared_ptr<newmod2>>(m, "newmod2", D(newmod2))
>
>          .def(py::init(&newmod2::make),
>             D(newmod2,make)
>          )
> ```
>
> Here is the code after running `gr_modtool bind`:
> ```
>      py::class_<newmod2,
>          std::shared_ptr<newmod2>>(m, "newmod2", D(newmod2))
>
>          .def(py::init(&newmod2::make),
>             py::arg("myarg") =  false,
>             D(newmod2,make)
>          )
> ```

I'm not an expert on `gr_modtool bind` (never used it), but I do know
that the conda packages do not include pygccxml as a dependency and that
that is important when autogenerating pybind11 bindings. If I had to
guess, you probably need to install pygccxml. Pip install should work,
although it will make maintaining that conda environment more of a
challenge.

If that's not it, then someone more familiar with `gr_modtool bind`
should be able to clarify.

Cheers,
Ryan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]