discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: GNU Radio 3.9 gr_modtool problem


From: Boris Marjanovic
Subject: Re: GNU Radio 3.9 gr_modtool problem
Date: Mon, 17 May 2021 09:20:59 +1000

I understand that the original issue was resolved. But I have the same problem with a different setup.

I installed (did ot build it myself) gnuradio 3.9. on Ubuntu 20.02.2 using ppa:gnuradio/gnuradio-releases with no issues. The companion seems to work fine. Similar to above, though, I can not create new module using modtool 'out of the box'.
Running gr_modtool fails
$ gr_modtool newmod temp
ModToolException: Could not find gr-newmod source dir.
Interestingly, running config info returns prefix '/.'
$ gnuradio-config-info --prefix
/.
This would explain why gr.prefix() which is imported via 'form gnuradio import gr' returns the string that creates an incorrect path to search for templates and later to find clang-format.conf file.

I think there might be an issue with the installation package. As far as I can tell, (I'm 'advanced beginner' in python, so nothing is certain) that comes from shared library /usr/lib/python3/dist-packages/gnuradio/gr/gr_python.cpython-38-x86_64-linux-gnu.so
Having the correct path in /etc/gnuradio/conf.d/modtool.conf makes no difference. I copied the file to ~/.gnuradio/config.conf  but still did not work. For some reason it seems these files are not checked for the path.
It seems gr_modtool was re-written in 3.9 (maybe 3.8) to use click. The code shows there is now a parameter for a newmod option 'srcdir'. If srcdir is provided, the module seems to be created,
$ gr_modtool newmod --srcdir /usr/share/gnuradio/modtool/templates/gr-newmod temp
Creating out-of-tree module in ./gr-temp...
Failed to copy .clang-format: [Errno 2] No such file or directory: '/./share/gnuradio/clang-format.conf'
Done.
Use 'gr_modtool add' to add a new block to this currently empty module.

Note that the srcdir provided in the command is the same as the value in the config file. There is still a failure because file clang-format.conf can not be found. The reason is the same as before - gr.prefix() returns incorrect value. But it seems to be 'warning level' since the module scaffolding seems to be in place and blocks can be added. I have not tried compiling them yet though.
The workaround (would not call it a fix) is to modify lines creating the path in newmod.py files (under both cli and core directory) in your gnuradio python installation
It would be good if someone more familiar with the system could check if this makes sense.
If so, it would be nice to patch the library. I'm not sure if there is an environment variable that would override the prefix as used by the library.

Apologies for the length of the email. As I said, the original problem was resolved but maybe this can help someone installing 3.9 without building from source.



reply via email to

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