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