gr-dvbs2rx icon indicating copy to clipboard operation
gr-dvbs2rx copied to clipboard

Can't install to a custom prefix with sudo.

Open drmpeg opened this issue 2 years ago • 2 comments

When sudo make install tries to compile the heir block, the build fails. That's because the users environment (and PYTHONPATH) is lost when sudo is used.

drmpeg avatar Dec 18 '21 21:12 drmpeg

Hi @drmpeg ,

Thanks for opening the issue and apologies for the delay. I still haven't investigated this issue because I need to set up an environment to reproduce it. Just so I understand:

  • Are you trying to install as root with sudo make install after running make to build with the non-root user? Or did you try running sudo make install directly (with no preceding make) to execute both the build and the installation with the root user?

  • Are you using a GR installation on a prefix that requires explicitly setting the PYTHONPATH?

In other words, how can I reproduce the problem? I'm thinking I need to build GR from source and install it on a non-conventional prefix (i.e., out of /usr/ and /usr/local). Then, I need to try building gr-dvbs2rx using this GR installation (on the non-conventional prefix). Is that right?

Also, do you think there is any easy workaround to be added at the corresponding CMakeLists.txt?

I could also make the hierarchical block optional on CMake. It's only used by the example flowgraphs, and the flowgraphs are not built automatically by CMake, so building the hier block is only a convenience. The hierarchical block is not used by the dvbs2-rx application. Instead, this application connects the individual components (see https://github.com/igorauad/gr-dvbs2rx/blob/master/apps/dvbs2-rx#L606).

igorauad avatar Jan 05 '22 17:01 igorauad

You could just use the old method of generating hierarchical blocks. Put gr-dvbs2rx/grc/hier/dvbs2rx_rx_hier.grc in gr-dvbs2rx/examples. When you load dvbs2_rx.grc (or any other flow graph that contains the hierarchical block), the hierarchical block will be generated automatically. Then just click the "Reload Blocks" button.

drmpeg avatar Jan 11 '22 13:01 drmpeg

Thank you so much @drmpeg, this is exactly what was tripping me up, I kept getting the error ImportError: generic_type: type "bbdeheader_bb" is already registered! until I tried your suggestion, I also had to wipe ~/.grc_gnuradio (and I wiped the python portion of the install just to be safe) and reinstalled the OOT, and it finally worked!!! Would highly recommend implementing this change, since so many people are going to be installing it to the system with sudo, especially now that the GR PPA is pretty much the go-to method for installing GR, vs pybombs. Let me know if you want me to do the PR.

777arc avatar Aug 12 '22 04:08 777arc

Hi, @777arc . I've implemented the change in a69b5947a9647f5623702d115bd570bd3fb7eb31 as suggested by @drmpeg . Thanks!

igorauad avatar Aug 22 '22 15:08 igorauad