As earlier, I am porting an OOT that worked with GR 3.9 into GR 3.10.
I'm a C++ and CMake newbie, please keep that in mind.
When I run a flowgraph with my GR 3.10 block in it I get:
Traceback (most recent call last):
from gnuradio import mxvii
from .mxvii_python import *
ImportError: /home/dcherkus/radioconda/envs/radioconda/lib/python3.9/site-packages/gnuradio/mxvii/mxvii_python.cpython-39-x86_64-linux-gnu.so:
undefined symbol: _ZN2gr5mxvii7encoder15set_destinationENSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEThen I use c++filt to demangle the undefined symbol:
$ c++filt _ZN2gr5mxvii7encoder15set_destinationENSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
gr::mxvii::encoder::set_destination(std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
This shows Python is trying to call a callback I'm providing in C++ to set one of the block's parameters.
Then I use nm to see what is being exported by the C++ shared library built by my OOT:
$ nm -C ~/radioconda/envs/radioconda/lib/libgnuradio-mxvii.so.1.0.0.0
The only methods being exported are:
gr::mxvii::encoder_impl::work()
gr::mxvii::encoder_impl::encoder_impl()
gr::mxvii::encoder_impl::~encoder_impl()
gr::mxvii::encoder::make()
Then I use nm to see what is being exported by the .o I am building:
$ nm -C build/lib/CMakeFiles/gnuradio-mxvii.dir/encoder_impl.cc.o 2>/dev/null | grep set_destination
0000000000000000 T gr::mxvii::encoder_impl::set_destination(std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
So the object file is providing a definition of the callback method, but it doesn't get included in the shared object.
What could be going wrong here?Based on reading other people's yml I tried a redundant 'cxx_templates' block but it didn't seem to help:
templates:
imports: from gnuradio import mxvii
make: mxvii.encoder(${source_address}, ${destination_address})
callbacks:
- set_source(${source_address})
- set_destination(${destination_address})
cxx_templates:
callbacks:
- set_source(${source_address})
- set_destination(${destination_address})