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

Rebuilding native backend fails on raspberry pi #761

Closed
cw150 opened this issue Apr 18, 2020 · 1 comment
Closed

Rebuilding native backend fails on raspberry pi #761

cw150 opened this issue Apr 18, 2020 · 1 comment

Comments

@cw150
Copy link

cw150 commented Apr 18, 2020

Expected Behavior

Using Edit->Options->Rebuild should build plutosdr backend

Actual Behavior

The plutosdr backend is not built, console log (omitting uninformative lines):
...
Found iio lib. Will compile with native plutosdr support
...
Skipping native support for plutosdr
...
usage: ExtensionHelper.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: ExtensionHelper.py --help [cmd1 cmd2 ...]
or: ExtensionHelper.py --help-commands
or: ExtensionHelper.py cmd --help

error: option -j not recognized

Steps To Reproduce

libiio was not found during urh install (with pip), probably because I installed it from source (it works with gnuradio). After installing libiio-dev package, it was still not found, due to unusual library path perhaps. I have to either specify /usr/lib/arm-linux-gnueabihf
in the urh options dialog, or run
export LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf
before running urh. Then I get the above behavior.

I am no python expert, this is how far I got in trying to fix this:

  1. The "error: option -j not recognized" disappears if I comment line 285 in ExtensionHelper.py
    285c285
    < #sys.argv.append("-j{}".format(os.cpu_count()))

sys.argv.append("-j{}".format(os.cpu_count()))

The error in the console then becomes:
running clean
'build/lib' does not exist -- can't clean it
'build/bdist.linux-armv7l' does not exist -- can't clean it
'build/scripts-3.7' does not exist -- can't clean it

  1. The problem seems to be with the way OptionsDialog.py calls ExtensionHelper.py. The first call to ExtensionHelper.get_device_extensions_and_extras in line 408 works, as seen by console output "Found iio lib. Will compile...". Then build_cmd is used to run ExtensionHelper.py in a subprocess. The main function will call get_device_extensions_and_extras a second time, however this time it will not find libiio. Apparently the additional library path is not passed when ExtensionHelper.py is invoked as a subprocess (and/or LD_LIBRARY_PATH has no effect). I checked that cythonize in line 290 is called with an empty list dev_extensions. This probably explains the "clean" error message.
Platform Specifications
  • OS: Raspbian GNU/Linux 10 (buster) on raspberry pi 4
  • URH version: 2.8.6
  • Python version: 3.7.3
  • Installed via pip
@cw150
Copy link
Author

cw150 commented Apr 18, 2020

Problem solved by running urh as root. Sorry for the disturbance.

@cw150 cw150 closed this as completed Apr 18, 2020
jopohl added a commit that referenced this issue Apr 19, 2020
it can lead to errors on certain environments (#761)
jopohl added a commit that referenced this issue Apr 19, 2020
it leads to errors on certain environments (#761)
jopohl added a commit that referenced this issue Apr 19, 2020
it leads to errors on certain environments (#761)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant