GNU Radio 4.0

From GNU Radio
Revision as of 19:24, 20 September 2022 by Mormj (talk | contribs) (→‎Creating a Prefix)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


GNU Radio 4.0 represents a major shift in the framework to allow for new functionality that has required architectural change to allow, such as:

  • Modular Runtime Components
  • Improved Support of Heterogeneous Architectures
  • Support for Distributed Architectures

To see a full description of the proposed features for 4.0, please see GNU_Radio_4.0_Summary_of_Proposed_Features

Getting and Installing

Currently GR 4.0 is not packaged, but can be easily built from source:


A complete list of dependencies can be found in the CI worker build scripts. These include:

  • meson-build
  • ninja
  • jinja2
  • gcc (or clang)
  • spdlog
  • libfmt
  • gtest
  • pybind11
  • python3
  • numpy
  • soapysdr
  • libasound
  • portaudio
  • flatbuffers-compiler
  • zmq
  • pyyaml


sudo apt install libzmq3-dev libspdlog-dev libyaml-cpp-dev libgtest-dev libfmt-dev pybind11-dev python3-dev python3-numpy build-essential cmake ninja-build libfftw3-dev libgmp-dev libgsl0-dev git python3-pip pkg-config libsoapysdr-dev libasound2 portaudio19-dev libad9361-0

pip install meson ninja mako jinja2 pyyaml zmq jsonschema jsonschema-default 

For Ubuntu 22.04, VOLK can be installed from apt

sudo apt install libvolk2-dev 

But for Ubuntu 20.04, we must install VOLK from source

# Install VOLK
mkdir -p /src/build
git clone --recursive /src/volk --branch v2.4.1
cd /src/build && cmake -DCMAKE_BUILD_TYPE=Release ../volk/ && make && make install && cd / && rm -rf /src/ 

For both 22.04 and 20.04, flatbuffers must be installed from source

# Install Flatc
mkdir -p /src/build
git clone /src/flatbuffers --branch v2.0.0
cd /src/build && cmake -DCMAKE_BUILD_TYPE=Release ../flatbuffers/ && make && make install && cd / && rm -rf /src/ 


sudo dnf install cmake gcc gcc-c++ spdlog-devel fmt-devel yaml-cpp-devel gtest-devel cppzmq-devel fftw-devel gsl-devel gmp-devel volk-devel SoapySDR-devel python3-devel python3-pybind11 python3-numpy python3-pip python3-pyyaml python3-lxml python3-gobject gtk3 python3-cairo pango SDL-devel alsa-lib-devel portaudio-devel jack-audio-connection-kit-devel libsndfile-devel git flatbuffers-devel flatbuffers-compiler

pip install meson ninja mako six jinja2 pyyaml zmq jsonschema jsonschema-default

Installing from Source

Creating a Prefix

An isolated prefix provides a convenient way to develop and utilize multiple versions of GNU Radio simultaneously (e.g. GR 3.10 and GR 4.0) without interference.

1. Create a directory that will be the root of your prefix

This might be /opt/gr4/ or ~/gr4 or anywhere else you like to keep a big directory (build files can grow to several GB). We will refer to this directory as $GR_PREFIX

2. Create a file into the prefix root. This file should look contain something similar to (edit your /path/to/my/prefix and python version

export GR_PREFIX="/path/to/my/prefix"
MIN=`python3 -c "import sys; print(sys.version_info.minor)"`

export PATH="$GR_PREFIX/bin:$PATH"
export PYTHONPATH="$GR_PREFIX/lib/python3/site-packages:$GR_PREFIX/lib/python3/dist-packages:$GR_PREFIX/lib/python3.$MIN/site-packages:$GR_PREFIX/lib/python3.$MIN/dist-packages:$GR_PREFIX/lib64/python3/site-packages:$GR_PREFIX/lib64/python3/dist-packages:$GR_PREFIX/lib64/python3.$MIN/site-packages:$GR_PREFIX/lib64/python3.$MIN/dist-packages:$PYTHONPATH"
export LD_LIBRARY_PATH="$GR_PREFIX/lib:$GR_PREFIX/lib64/:$GR_PREFIX/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
export LIBRARY_PATH="$GR_PREFIX/lib:$GR_PREFIX/lib64/:$GR_PREFIX/lib/x86_64-linux-gnu:$LIBRARY_PATH"
export PKG_CONFIG_PATH="$GR_PREFIX/lib/pkgconfig:$GR_PREFIX/lib64/pkgconfig:$PKG_CONFIG_PATH"

3. source - do this every time you open the terminal to enter the development or runtime in this prefix

Getting the GR4 Source

Open a new terminal window

mkdir src && cd src
git clone https// --branch dev-4.0 

Building and installing GR4

cd gnuradio
meson setup build --libdir=lib --prefix=$GR_PREFIX
cd build
ninja test
ninja install

Note that nothing in installing to the prefix should require sudo

Creating an Out of Tree Module

There is currently no gr_modtool in GR 4.0, but Out of tree modules can be created very easily with some helper scripts

Please see the tutorial Creating OOT Module in GR 4.0