Hi Achilleas,

> I see one more package "python3-uhd". Do I also need this package […]?

No, *but* (I think you're doing this right, but for posteriority, I write this. State as of 2023-09-27, current UHD is 4.5, dear future reader.):

> I usually install uhd from ettus binaries through the suggested method sudo add-apt-repository ppa:ettusresearch/uhd […] > I want to run gnuradio with USRPs and want to do gnuradio development as well (eg, OOT modules etc)?

The gnuradio package you might have installed through apt install gnuradio is built against the Ubuntu (or debian) libuhd, not against the Ettus libuhd (which remains installed; uhd-host, which includes things like the FPGA image downloader, however, gets updated, so you can't get the right firmware images anymore for your GNU Radio-used version of UHD).

So, you *must* uninstall `sudo apt-get remove gnuradio`, and rebuild GNU Radio to link against Ettus version of the UHD packages.

Here's how I do that, to be able to continue using the gnuradio-dependent Ubuntu (debian) packages, as the resulting GNU Radio should be binary-compatible.

------------------------------------------------------------------------------------------

1. Enable the Ubuntu (or debian) source repos
2. Install the gnuradio package's build-dependencies
3. Download the gnuradio package and rebuild it
4. Install the freshly built package(s)
5. Fix the version of the installed libgnuradio-uhd package, so an update from 
Ubuntu (or
   debian) doesn't replace your gnuradio package with one using the original 
Ubuntu (or
   debian) UHD.

In detail, after you've set up the ettusresearch PPA:


       Enable the Ubuntu (or debian) source repos

Either using the software settings in your desktop environment (settings->Software->checkmark on "Source Code"), or by

 * (Ubuntu, debian <= 11) editing /etc/apt/sources.list, add (uncomment) the 
identical
   lines, starting with "deb-src" instead of "deb" below each "deb" line
 * (debian >= 12) editing /etc/apt/sources.list.d/debian.sources; add " 
deb-src" at the
   end of the lines starting with "Types: deb"

Run `sudo apt-get update` to make your system aware that it now knows how to get source code for packages.


       Install the gnuradio package's build-dependencies

1. sudo apt-get build-dep -y gnuradio
2. sudo apt-get install -y dpkg-dev


       Download the gnuradio package and rebuild it

No sudo required!

cd && mkdir gnuradio-pkg && cd gnuradio-pkg && apt-get source --build gnuradio

You're left with new .deb package files in ~/gnuradio-pkg.


       Install the freshly built package(s)

cd ~/gnuradio-pkg && sudo apt-get install -y ./*.deb


       Fix the version of the installed package

sudo apt-mark hold libgnuradio-uhd\*

------------------------------------------------------------------------------------------

PS: in case you wonder whether you could put the above in a Dockerfile and just run it every time you need an updated UHD to get your updated GNU Radio packages; sure:

1. Save attached Dockerfile to empty directory; adjust the Ubuntu version and 
date in the
   first lines.
2. Install podman (I prefer that) or docker (if using docker, simply replace 
"podman"
   with "docker" below)
3. cd into that directory
4. podman build -t ubuntu-VERSION-ettusresearch-gnuradio-dependencies .
5. mkdir -p ~/data
6. podman run --rm -v ~/data:/data:Z ettus-uhd-gnuradio-ubuntu-2204:latest sh -c 
"cd
   /data;DEBIAN_FRONTEND=noninteractive apt-get source --build gnuradio"
7. You should now have the packages in your ~/data

------------------------------------------------------------------------------------------
Cheers,
Marcus


On 27.09.23 01:56, Achilleas Anastasopoulos wrote:
I usually install uhd from ettus binaries through the suggested method:

sudo add-apt-repository ppa:ettusresearch/uhd
sudo apt-get update
sudo apt-get install libuhd-dev uhd-host
FROM ubuntu:22.04
LABEL maintainer="marcus.muel...@ettus.com"

# Updating the below when you do a rebuild will make the image contain all the 
updates
ENV security_updates_as_of 2023-09-27

# Prepare distribution, enable sources repos
RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \
    ;\
      DEBIAN_FRONTEND=noninteractive apt-get -y upgrade \
    && \
      DEBIAN_FRONTEND=noninteractive apt-get install -qy \
        software-properties-common \
    && \
      CODENAME=$(sed -n 's/VERSION_CODENAME=\(.*\)$/\1/p' </etc/os-release) \
        sed -n "s/deb\\( .*${CODENAME}.*\\)$/deb-src\\1/p" \
        < /etc/apt/sources.list \
        > /etc/apt/sources.list.d/50-${CODENAME}-sources.list \
    && \
      add-apt-repository ppa:ettusresearch/uhd \
    && \
      apt-get clean

# Install Ettus UHD version, and the essential tool for building packages
# Install gnuradio's build-dependencies
RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \
    ;\
    DEBIAN_FRONTEND=noninteractive apt-get install -qy --no-install-recommends \
        libuhd-dev \
        uhd-host \
        dpkg-dev \
    && \
      DEBIAN_FRONTEND=noninteractive apt-get build-dep -qy 
--no-install-recommends \
        gnuradio \
    && \
      apt-get clean

_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com

Reply via email to