Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gr_modtool generates cpp noblock that does not compile #6960

Closed
AngelouDi opened this issue Nov 15, 2023 · 5 comments · Fixed by #7318
Closed

gr_modtool generates cpp noblock that does not compile #6960

AngelouDi opened this issue Nov 15, 2023 · 5 comments · Fixed by #7318

Comments

@AngelouDi
Copy link

What happened?

I am trying to generate a noblock using gr_modtool.

gr_modtool newmod my_rfid

gr_modtool add testblock
GNU Radio module name identified: my_rfid
('sink', 'source', 'sync', 'decimator', 'interpolator', 'general', 'tagged_stream', 'hier', 'noblock')
Enter block type: noblock
Language (python/cpp): cpp
Language: C++
Block/code identifier: testblock
Please specify the copyright holder: none
Enter valid argument list, including default arguments: 
 
Add C++ QA code? [Y/n] n
Adding file 'lib/testblock.cc'...
Adding file 'include/gnuradio/my_rfid/testblock.h'...
Adding file 'python/my_rfid/bindings/docstrings/testblock_pydoc_template.h'...
Adding file 'python/my_rfid/bindings/testblock_python.cc'...
Adding file 'grc/my_rfid_testblock.block.yml'...
Editing grc/CMakeLists.txt...

When I attempt a build:

[ 70%] Built target my_rfid_docstrings
[ 80%] Building CXX object python/my_rfid/bindings/CMakeFiles/my_rfid_python.dir/testblock_python.cc.o
/home/mitsos/Documents/Diplomatiki/gr-my_rfid/python/my_rfid/bindings/testblock_python.cc: In function ‘void bind_testblock(pybind11::module&)’:
/home/mitsos/Documents/Diplomatiki/gr-my_rfid/python/my_rfid/bindings/testblock_python.cc:37:34: error: template argument 2 is invalid
   37 |         std::shared_ptr<testblock>>(m, "testblock", D(testblock))
      |                                  ^~
/home/mitsos/Documents/Diplomatiki/gr-my_rfid/python/my_rfid/bindings/testblock_python.cc:39:35: error: ‘make’ is not a member of ‘testblock’ {aka ‘gr::my_rfid::testblock’}
   39 |         .def(py::init(&testblock::make),
      |                                   ^~~~
make[2]: *** [python/my_rfid/bindings/CMakeFiles/my_rfid_python.dir/build.make:76: python/my_rfid/bindings/CMakeFiles/my_rfid_python.dir/testblock_python.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:384: python/my_rfid/bindings/CMakeFiles/my_rfid_python.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

System Information

OS: Arch Linux x86_64
GR Installation Method: AUR: https://aur.archlinux.org/packages/gnuradio-git

GNU Radio Version

3.11-git (main)

Specific Version

v3.11.0.0git-576-g9fca5db4

Steps to Reproduce the Problem

Generate a new gr module and add a cpp noblock. Then try to compile.

Relevant log output

No response

@marcusmueller marcusmueller added modtool C++ Generation codegen Relating to automatic code generation and removed C++ Generation codegen Relating to automatic code generation labels Nov 15, 2023
@willcode
Copy link
Member

noblock doesn't seem to be documented, except as an option to addblock. This probably hasn't been tested recently. For anyone wondering, it creates a class in the module namespace that is not a block. This is of questionable usefulness.

@marcusmueller
Copy link
Member

marcusmueller commented Nov 15, 2023

agreed, at the very least it needs to be better documented; don't think having a "skeleton" option that just adds empty source files and and entries to CMakeLists.txt is a bad thing, but then that really is what should happen. No pre-filling of Python bindings to things that don't exist

@AngelouDi
Copy link
Author

I am gonna check the version that we had used at work tomorrow (it works fine on that version).

They way we used it was a to store global variables (We are implementing the Gen2 EPC specification from scratch). So we used the noblock as it would generate all the files and CMake lines in one go.

@AngelouDi
Copy link
Author

The version that works is 3.7.12.0

I don't know about later ones.

@marcusmueller
Copy link
Member

Still present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants