OP25 op25 boatbod with gnuradio-3.10

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
The error pertains to an interface function connecting python to the c++ library code. Mostly when I've seen similar interface errors, it's due to problems in c++ code auto-generated by pybind11. So far my experience has been that pybind has demonstrated itself to be way more finicky than SWIG, and that's saying something!!

I'm in the process of setting up an Arch virtual machine to try building & running op25 myself, but seeing as I'm a Debian guy, the Arch learning curve is getting in the way of my progress. Clearly the regular Debian install.sh script isn't going to work without modification, so if you could summarize briefly the manual steps necessary to install prerequisite packages including gnuradio, compiler & cmake, that would be very helpful.
 

excentric

Member
Premium Subscriber
Joined
Mar 10, 2018
Messages
6
Well Installed and did this like 3 different time on different occasions trying to get it to compile. So I spent some time trying to figure out all the packages I installed. So this is the command to run After you have done as system update

System update:
sudo padman -Syu

needed packages:
"sudo pacman -S gnuradio rtl-sdr gnuradio-osmosdr libuhd libpcap lib32-libpcap orc cmake base-devel pkgconf doxygen clang pybind11 python-numpy python-waitress python-requests gnuplot libsndfile spdlog hackrf"

Then you have to get itpp frpm the AUR:
yay -S itpp

# Tell op25 to use python3
echo "/usr/bin/python3" > op25/gr-op25_repeater/apps/op25_python

i ran the ./build_bindings.sh file

Then followed your remaining directions:

rm -rf build
mkdir build
cd build
cmake ../ 2>&1 | tee cmake.log
make 2>&1 | tee make.log
sudo make install 2>&1 | tee install.log
sudo ldconfig

in a terminal where I was running the rx.py command I had to run this first. because it didnt know how to find it. (not sure how to fix this on compile).

export PYTHONPATH=/usr/local/lib/python3.10/site-packages:$PYTHONPATH
and
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

and now it should run but you saw my error.

I hope this helps
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
Well Installed and did this like 3 different time on different occasions trying to get it to compile. So I spent some time trying to figure out all the packages I installed. So this is the command to run After you have done as system update

System update:
sudo padman -Syu

needed packages:
"sudo pacman -S gnuradio rtl-sdr gnuradio-osmosdr libuhd libpcap lib32-libpcap orc cmake base-devel pkgconf doxygen clang pybind11 python-numpy python-waitress python-requests gnuplot libsndfile spdlog hackrf"

Then you have to get itpp frpm the AUR:
yay -S itpp

# Tell op25 to use python3
echo "/usr/bin/python3" > op25/gr-op25_repeater/apps/op25_python

i ran the ./build_bindings.sh file

Then followed your remaining directions:

rm -rf build
mkdir build
cd build
cmake ../ 2>&1 | tee cmake.log
make 2>&1 | tee make.log
sudo make install 2>&1 | tee install.log
sudo ldconfig

in a terminal where I was running the rx.py command I had to run this first. because it didnt know how to find it. (not sure how to fix this on compile).

export PYTHONPATH=/usr/local/lib/python3.10/site-packages:$PYTHONPATH
and
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

and now it should run but you saw my error.

I hope this helps
Yes, that is useful. I've been fumbling my way through this most of the afternoon and had just arrived at needing "yay" to retrieve itpp from AUR. I'll let you know how it goes once I get all the parts of the jigsaw on the table. It may not be today...
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
The issue is that python-pygccxml and castxml packages are missing so "gr_modtool bind" is only greating minimal bindings. These packages have to be installed from AUR. I'm recreating bindings and trying it now.
ETA: with the two packages added and the bindings rebuilt it does run, lock on and receive calls.

The install needs to be integrated, but this is what I have:
Code:
sudo packman -Sy gnuradio gnuradio-osmosdr rtl-sdr libuhd git cmake cppunit doxygen boost libpcap orc base-devel clang pkgconf pybind11 python-numpy python-waitress python-setuptools gnuplot libsndfile spdlog hackrf
yay -S itpp castxml python-pygccxml
 
Last edited:

excentric

Member
Premium Subscriber
Joined
Mar 10, 2018
Messages
6
The issue is that python-pygccxml and castxml packages are missing so "gr_modtool bind" is only greating minimal bindings. These packages have to be installed from AUR. I'm recreating bindings and trying it now.
ETA: with the two packages added and the bindings rebuilt it does run, lock on and receive calls.

The install needs to be integrated, but this is what I have:
Code:
sudo packman -Sy gnuradio gnuradio-osmosdr rtl-sdr libuhd git cmake cppunit doxygen boost libpcap orc base-devel clang pkgconf pybind11 python-numpy python-waitress python-setuptools gnuplot libsndfile spdlog hackrf
yay -S itpp castxml python-pygccxml
ok installing those now
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
For anyone that likes a challenge, I can confirm successfully building and running op25 boatbod on both Arch and Fedora 37. Both require manual installation of dependency packages and op25 build (forget the install.sh script) but they do work if you get everything just so! Red Hat Enterprise Linux (RHEL 9) was a bust because there are just too many support packages not available. My guess is that you could build everything from sources, but seems like a lot of extra work for little benefit.
 

belvdr

No longer interested in living
Joined
Aug 2, 2013
Messages
2,567
For anyone that likes a challenge, I can confirm successfully building and running op25 boatbod on both Arch and Fedora 37. Both require manual installation of dependency packages and op25 build (forget the install.sh script) but they do work if you get everything just so! Red Hat Enterprise Linux (RHEL 9) was a bust because there are just too many support packages not available. My guess is that you could build everything from sources, but seems like a lot of extra work for little benefit.
For RHEL9, you might find the packages in the Red Hat Linux Builder (formerly CodeReady) and/or EPEL repos.


 

excentric

Member
Premium Subscriber
Joined
Mar 10, 2018
Messages
6
For anyone that likes a challenge, I can confirm successfully building and running op25 boatbod on both Arch and Fedora 37. Both require manual installation of dependency packages and op25 build (forget the install.sh script) but they do work if you get everything just so! Red Hat Enterprise Linux (RHEL 9) was a bust because there are just too many support packages not available. My guess is that you could build everything from sources, but seems like a lot of extra work for little benefit.
Thanks for helping me get the last two packages. I got it working just had to recompile.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
I've created an Arch Linux install script "arch-install.sh" that can be used in place of the regular install.sh.
 

belvdr

No longer interested in living
Joined
Aug 2, 2013
Messages
2,567
I've created an Arch Linux install script "arch-install.sh" that can be used in place of the regular install.sh.
It's funny as so many Arch hardcore users really don't like AUR helpers, like yay. I use it, but have found some issues with it. For example, a developer had code that made the application install directory owned by the user, not root.

Even when updating with yay, it failed to correct the permissions. My fix was to uninstall/reinstall with yay. The hardcore users will tell you to build every package in a chroot every time.

After you install yay, you can also use it to install packages, just like pacman. For example:
Code:
yay -S --needed git base-devel
is also valid.

All that to say I'm using your Arch script now and received this error, as libthrift is now 0.18.1:
Code:
ln: failed to access '/usr/lib/libthrift-0.18.0.so': No such file or directory
I'm waiting for the script to finish to see if it's an issue.
 
Last edited:

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
It's funny as so many Arch hardcore users really don't like AUR helpers, like yay. I use it, but have found some issues with it. For example, a developer had code that made the application install directory owned by the user, not root.

Even when updating with yay, it failed to correct the permissions. My fix was to uninstall/reinstall with yay. The hardcore users will tell you to build every package in a chroot every time.

After you install yay, you can also use it to install packages, just like pacman. For example:
Code:
yay -S --needed git base-devel
is also valid.

All that to say I'm using your Arch script now and received this error, as libthrift is now 0.18.1:
Code:
ln: failed to access '/usr/lib/libthrift-0.18.0.so': No such file or directory
I'm waiting for the script to finish to see if it's an issue.
I'm very quickly coming to hate Arch.
Please could you take a look in /usr/lib and see what versions of libthrift exist now.
If you could also try to run "gr_modtool" and see if barfs, and if so with what error, that would be useful thanks.
 

belvdr

No longer interested in living
Joined
Aug 2, 2013
Messages
2,567
I'm very quickly coming to hate Arch.
Please could you take a look in /usr/lib and see what versions of libthrift exist now.
If you could also try to run "gr_modtool" and see if barfs, and if so with what error, that would be useful thanks.
It's important to realize what Arch is, before dedicating yourself to it. It's a rolling release, so the system is always getting the latest libraries and packages, which is unlike many other distributions. In Ubuntu, you generally don't get these until you upgrade to a new version (i.e. 20.04 to 22.04).

The current libthrift is /usr/lib/libthrift-0.18.1.so. However, I suggest querying the package to find out the current file name. The following code will always use the latest installed version:
Code:
if ! [ -f /usr/lib/libthrift-0.17.0.so ]; then
    THRIFTVER=$(pacman -Q thrift | awk '{print $NF}' | sed 's/-.*$//')
    sudo ln /usr/lib/libthrift-${THRIFTVER}.so /usr/lib/libthrift-0.17.0.so
fi
Essentially, this queries the thrift package version, then uses that in the symlink creation. Here's my test:
Code:
$ THRIFTVER=$(yay -Q thrift | awk '{print $NF}' | sed 's/-.*$//')
$ ls /usr/lib/libthrift-${THRIFTVER}.so
/usr/lib/libthrift-0.18.1.so
This assumes the library will not change names, and there's a solution for that. However, I think that is unlikely.

One word of caution. Let's say thrift 0.18.2 comes out. In the current scenario, op25 will break, as the symlink will be orphaned. This is where the Arch User Repository comes into play. A file called PKGBUILD is used, and it can pull from your existing repo, change branches, and run whatever install script you want. It also has a dependency check to ensure the correct versions are installed. There's an entire wiki article dedicated to it. It's not that difficult.

I was able to run gr_modtool fine, but without any arguments, so the usage text appeared. Anything you want me to add to that? I'm new to op25, so not sure what a good test would be:
Code:
$ gr_modtool
Usage: gr_modtool [OPTIONS] COMMAND [ARGS]...

  A tool for editing GNU Radio out-of-tree modules.

Options:
  --help  Show this message and exit.

Commands:
  add       Adds a block to the out-of-tree module.
  bind      Generate Python bindings for GR block
  disable   Disable selected block in module.
  info      Return information about a given module
  makeyaml  Generate YAML files for GRC block bindings.
  newmod    Create new empty module, use add to add blocks.
  rename    Rename a block inside a module.
  rm        Remove a block from a module.
  update    Update the grc bindings for a block

  Manipulate with GNU Radio modules source code tree. Call it without options
  to run specified command interactively
 
Last edited:

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
Arch is most certainly not something I'm dedicated to beyond attempting to help other Arch users get op25 running. Personally I prefer Debian/Ubuntu derivatives as I find them more stable and reliable. Fedora was another one of those releases that I tested for compatibility purposes, but it's probably not something I'll ever find myself using long-term or as a primary dev environment.

Getting pack to this issue... when I put together the arch install script I ran into problems with gnuradio's gr_modtool insisting it wanted a particular version of libthrift that was not the same as what was installed. I added a symlink as a work-around for that deficiency, which sounds like it might been corrected. If so, the symlink should no longer be necessary.
 

belvdr

No longer interested in living
Joined
Aug 2, 2013
Messages
2,567
Arch is most certainly not something I'm dedicated to beyond attempting to help other Arch users get op25 running. Personally I prefer Debian/Ubuntu derivatives as I find them more stable and reliable. Fedora was another one of those releases that I tested for compatibility purposes, but it's probably not something I'll ever find myself using long-term or as a primary dev environment.
To each their own. I don't find any of them to be unstable or unreliable. They simply act different when compared to each other.
 

viggendriver

Member
Joined
May 3, 2020
Messages
14
I keep coming up with the following error using Ubuntu Mate 22.04. Ideas?

Traceback (most recent call last):
File "/home/sig/Downloads/op25/op25/gr-op25_repeater/apps/./rx.py", line 47, in <module>
from gnuradio import audio, eng_notation, gr, gru, filter, blocks, fft, analog, digital
ImportError: cannot import name 'gru' from 'gnuradio' (/usr/lib/python3/dist-packages/gnuradio/__init__.py)
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
I keep coming up with the following error using Ubuntu Mate 22.04. Ideas?

Traceback (most recent call last):
File "/home/sig/Downloads/op25/op25/gr-op25_repeater/apps/./rx.py", line 47, in <module>
from gnuradio import audio, eng_notation, gr, gru, filter, blocks, fft, analog, digital
ImportError: cannot import name 'gru' from 'gnuradio' (/usr/lib/python3/dist-packages/gnuradio/__init__.py)
Looks like you're not on the gr310 branch.
The module named "gru" is only part of the gr-3.8 release and does not exist in rx.py when you "git checkout gr310".
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
I specified the 310 branch but I can try again[?]
Did the command complete properly?
Code:
cd ~/op25
git checkout gr310
You can check where you're at:
Code:
git status
norbury@yoga2 ~/op25/op25/gr-op25_repeater/apps $ git status
On branch dev
Your branch is up to date with 'origin/dev'.

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: p25_demodulator.py

Untracked files:
(use "git add <file>..." to include in what will be committed)
../../../detect-os.sh

no changes added to commit (use "git add" and/or "git commit -a")
gnorbury@yoga2 ~/op25.tmp $ git status
On branch gr310
Your branch is up to date with 'origin/gr310'.

nothing to commit, working tree clean
 

viggendriver

Member
Joined
May 3, 2020
Messages
14
Figured it out but your post helped...I copied over an old rx.py file:oops: Some of the old config files (trunk.tsv) files aren't working but at least it seems to be running. I'll figure everything out in the AM. I appreciate the help.
 
Top