Как установить gnuradio на ubuntu

Обновлено: 04.07.2024

There's generally no need to build GNU Radio from source code unless you want to modify GNU Radio rather than just using it. The recommended way to install GNU Radio on most platforms is using already compiled binary packages. Binary installation should be sufficient for most users, and certainly for anyone who is new to GNU Radio. However, if you have special requirements, or a binary package is not available for your system, you may need to install GNU Radio from source.

In short: on Ubuntu versions since 9.10, use:

See our PPA page for more details.

This page describes dependencies for building GNU Radio from source code.

Contents

Install Dependencies [ edit ]

To execute the script, copy and paste the relevant command line into a terminal.

Notes [ edit ]

  • Mint 19.2 is based on Ubuntu 18.04. Mint 19.2 Cinnamon desktop installs gnome-terminal which may have to be uninstalled for non-gui flowgraphs to run properly. Mint 19.2 Mate does not install gnome-terminal by default.

Focal Fossa (20.04) through Hirsute Hippo (21.04) [ edit ]

GNU Radio version 3.8.x with Python 3 support:

GNU Radio version 3.9.x additionally requires:

Bionic Beaver (18.04) through Eoan Ermine (19.10) [ edit ]

GNU Radio version 3.8.x with Python 3 support:

GNU Radio version 3.7.x:

Note: GNU Radio 3.9 and up will build from source on Ubuntu 18 only if pybind11 is installed from source as well. Also, pybind11 packages are on the gnuradio-master PPA, so another option is to install pybind from the GR PPA then build gnuradio from source. GNU Radio 3.9 additionally requires:

Xenial Xerus (16.04) [ edit ]

Building GNU Radio 3.8.x is difficult on Ubuntu 16.04 due to various dependency issues (especially due to CMake and Python versions). Please consider using GNU Radio 3.7.x instead.

For GNU Radio 3.7.x:

Trusty Tahr (14.04) [ edit ]

Then set the following environmental variable to use PyQT:

Saucy Salamander (13.10) [ edit ]

Saucy Salamander has a particular problem with PyQT and PyQWT. First, apt-get the following packages to get start. We will then manually build and install PyQT and PyQWT to get around the issue.

If you have PyQWT installed already, remove it:
$ sudo apt-get remove python-qwt5-qt4

Make sure SIP is installed:
$ sudo apt-get install python-sip python-sip-dev

We'll set up a separate directory to install into to make it keep it nicely separated from anything else (in case Ubuntu fixes this problem).
$ sudo mkdir /opt/qt

First, set up your environment

Edit ./bashrc by adding or amending the following variables:

Either restart the terminal or reset your environment:
$ source

If you've already built GNU Radio, first delete CMakeCache.txt in the top build directory. You should then only have to 'make clean' in gr-qtgui.

Run cmake and make like you would normally. With the environmental variables pointing to the new PyQT and PyQWT versions we've installed all gr-qtui displays and widgets should work properly now.

Raring Ringtail (13.04) [ edit ]

Note: At release, Ubuntu defaults the 'libboost-all-dev' package to libboost-*.49, which is incompatible with GNURadio. Thus, until the Ubuntu default Boost install catches up, you must manually specify 'libboost1.53-all-dev'.

Precise Pangolin (12.04) [ edit ]

Natty Narwhal (11.04) [ edit ]

Maverick (10.10) [ edit ]

Lucid (10.04) [ edit ]

Installing GNU Radio [ edit ]

Click here to show install instructions.

Configuring USRP support [ edit ]

This section is only relevant if you have a USRP1 that you want to use with GNU Radio. You may already have done this if you have installed UHD .

Ubuntu uses udev for handling hotplug devices, and does not by default provide non-root access to the USRP. The following script is taken from directions, and sets up groups to handle USRP via USB, either live or hot-plug

At this point, Ubuntu is configured to know what to do if/when it detects the USRP on the USB, except that "udev" needs to reload the rules to include the newly created one. The following might work, but if it doesn't then rebooting the computer will.

You can check if the USRP is being recognized, by examining /dev/bus/usb after plugging in a USRP. Using the command:

should result in one or more lines (one for each USRP) reading something like:

Each device file will be listed with group 'usrp' and mode 'crw-rw----'.

Once you've verified that the USRP is available to Ubuntu, now it is time to verify that GNU Radio works with the USRP. While "usrp_benchmark_usb" might not return a full 32 MB/s of throughput, the script should at least run properly; if not, either GNU Radio didn't make correctly or the USRP isn't accessible. From the "gnuradio" directory, verify that all of the following work:

The recommended way to install GNU Radio on most platforms is using already available binary packages (see Ubuntu PPA Installation). For some platforms there are no binaries provided by available package managers or the GNU Radio project. In these cases please contact the maintainer of the package manager or the GNU Radio project to find a sensible way to provide binaries for your platform.

In addition to using binaries, GNU Radio can be installed:

  1. From source (for those who want full control)
  2. Using PyBOMBS (for those who want it built from source and/or installed to a specific directory using a script)
  3. Using conda (for those who want binaries installed to managed environments)

Linux [ edit ]

Most distributions contain a package named gnuradio or similar in their standard repositories. For most use cases it is enough to install this package and start developing.

The development of GNU Radio can be fast-paced, and binaries provided by your distribution may be outdated. Do check if the version you're installing is up to date! Sometimes old versions are not updated in the packaging systems. If you find a bug in a older GNU Radio version, please check if the bug still exists in the newer version of GNU Radio before filing a new issue.

If the version shipped in your distribution is outdated please contact the corresponding maintainer to update it in the packaging system.

Here are examples of how to install GNU Radio in various Linux distributions. Click the link under "Distribution" for how to install dependencies.

Distribution Command
Debian/Ubuntu and derivates
Fedora
RHEL/CentOS
Archlinux
Gentoo Linux
Suse Linux

On other distributions, simply use the appropriate package management command to install the gnuradio package and then please add it to this list. If you need newer versions or have a different platform please contact the package maintainer of your distribution or raise your issue on the mailing list.

Ubuntu PPA Installation [ edit ]

For Ubuntu, the latest builds (both released and pulled from master branch) are maintained as PPAs on launchpad. Be sure to uninstall any previously installed versions of gnuradio first.

To access the latest from the master branch, add the gnuradio/gnuradio-master ppa (removing other gnuradio ppas if already configured)

To access the current released version (3.9), add the gnuradio/gnuradio-releases ppa (removing other gnuradio ppas if already configured)

To access the 3.8 released version, add the gnuradio/gnuradio-releases-3.8 ppa (removing other gnuradio ppas if already configured)

To access the 3.7 released version (legacy), add the gnuradio/gnuradio-releases-3.7 ppa (removing other gnuradio ppas if already configured)

Then, update the apt sources, and install gnuradio

Attention: Do NOT try to install further packages like `gr-osmosdr` via Ubuntu's package management (i.e. using "apt"). Ubuntu will try to install a potentially incompatible version and your system will be in an undefined state.

Modtool on Ubuntu [ edit ]

NOTE: On released builds for Ubuntu 18 (bionic), there is an issue using gr_modtool after GNU Radio has been installed from the PPA. This is due to byte-compiled code that remains in the modtool templates after installation. To workaround this issue:

This issue does not appear for Ubuntu 19 and later packages

Fedora COPR Installation [ edit ]

Packages are available for Fedora 29,30,31 hosted under COPR:

1. Add the repository:

-- For the latest released version:

-- For the latest pull from git master:

2. Install GNU Radio

Raspberry Pi [ edit ]

There is a pre-built 32 bit SDR flavored Raspberry Pi OS distro, PiSDR that includes GnuRadio and other SDR utilities. There are also instructions for InstallingGRFromSource_on_Raspberry_Pi.

Windows [ edit ]

Binary installers are now available for GNU Radio 3.7 and 3.8, download them here.
Conda packages are an alternative for installing binaries for GNU Radio 3.8+. See the conda install guide or radioconda.
If you need to install GNU Radio from source refer to the Windows install guide.

Note: We do not officially support Windows. We do our best to provide installation instructions and work out build bugs on Windows when they are reported and patches received. As new versions of GNU Radio, its dependencies, and Windows itself come out, however, keeping all of them working together is beyond the scope of what the project currently supports. User updates to the above wiki installation instructions are very welcome.

Mac OS X [ edit ]

Binary installation should be sufficient for most users, and certainly for anyone who is new to GNU Radio. However, if you have special requirements, want the latest version, or the binary packages are not working for you, you may want to install GNU Radio from source.

Notes [ edit ]

  • By default GNU Radio will be installed in the /usr/local directory. See notes about -DCMAKE_INSTALL_PREFIX to install it elsewhere.
  • Running and developing out-of-tree modules does not require GNU Radio to be installed from source.
  • If you want to use GNU Radio with a USRP, you FIRST must clone and install UHD. See the UHD Installation Page for more info, OR follow the instructions in Install UHD from source.
  • To install on a Raspberry Pi, see InstallingGRFromSource on Raspberry Pi.
  • To build from source from within a conda environment, see the conda install guide.

For GNU Radio 3.9 and Master Branch [ edit ]

This section describes how to install GNU Radio 3.9 and the Master branch from source code.

Installing Dependencies [ edit ]

Refer to this page for your specific Linux distro to find how to install dependencies. For example, on Ubuntu 20.04 use this command.

Installing Volk [ edit ]

The basic idea is the same, but instead of building Volk along with GNU Radio, you need to clone and build it separately. For this example, we will start in the home directory. You can, of course, use any directory you wish and the results will be the same.

Note: In the following command, you can add -DCMAKE_INSTALL_PREFIX=XXX to install Volk into the PREFIX XXX ; if not specified, then the PREFIX is /usr/local . See other CMake options in Common cmake flags.

  • cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../
  • make
  • make test
  • sudo make install

If you're running Linux, then always remember to do the following command after installing any library:

Installing GNU Radio [ edit ]

Note: If you want to build the maint-3.9 branch rather than the default master branch, enter: git checkout maint-3.9 and then

Note: In the following command, you can add -DCMAKE_INSTALL_PREFIX=XXX to install GNU Radio into the PREFIX XXX ; if not specified, then the PREFIX is /usr/local . See other CMake options in Common cmake flags.

  • cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../
  • make -j3 (e.g. if you want to use 3 CPU cores during the build. To use 8 do -j8, to use 1, leave out the -j flag.)

Note: In the following command, it is very possible that not all tests pass. Generally any error is a sign of a missing dependency such as the Python interface to ZMQ or NumPy or SciPy, none of which are required for building GNU Radio but are required for testing.

If you're running Linux, then always remember to do the following command after installing any library:

If you encounter "Cannot import gnuradio" error, then go to Finding the Python library to set your PYTHONPATH and LD_LIBRARY_PATH.
After setting these environment variables, you need to do sudo ldconfig again for the Linux dynamic library loader to find the just-installed GNU Radio libraries.
If you have installed in a custom path with -DCMAKE_INSTALL_PREFIX=XXX , you will need to add that path to $PATH in order to find gnuradio-companion.

For GNU Radio 3.8 or Earlier [ edit ]

For this example, we will start in the home directory; you can, of course, use any directory you wish and the results will be the same.

Note: In the following command, change maint-3.8 to some other branch or tag if you want to build a different version of GNU Radio; see tags for tagged releases including pre-releases ("rc"). For branches, it's generally wise to stick with "master" (the default after cloning), and, currently: maint-3.7 or maint-3.8 . Here we checkout the maint-3.8 branch, which contains the latest 3.8 release plus any fixes or augmentations to it that will be in the next 3.8 release.

  • git checkout maint-3.8
  • git submodule update --init --recursive
  • mkdir build
  • cd build

Note: In the following command, you can add -DCMAKE_INSTALL_PREFIX=XXX to install GNU Radio into the PREFIX XXX ; if not specified, then the PREFIX is /usr/local . See other CMake options in Common cmake flags.

  • cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../
  • make -j3 (e.g. if you want to use 3 CPU cores during the build. To use 8 do -j8, to use 1 leave out the -j flag.)
  • sudo make install

If you're running Linux, then always remember to do the following command after installing any library:

Go to Finding the Python library to set your PYTHONPATH and LD_LIBRARY_PATH.
After setting these environment variables, you need to do sudo ldconfig again for the Linux dynamic library loader to find the just-installed GNU Radio libraries.
If you have installed in a custom path with -DCMAKE_INSTALL_PREFIX=XXX , you will need to add that path to $PATH in order to find gnuradio-companion.

For Ubuntu 18.04 [ edit ]

An easy way to install GNU Radio 3.8 on many Ubuntu systems is to use the following commands (note that this skips the setup for UHD hardware):

Once this is done, reboot your computer and GNU Radio should be all set for you.

Common cmake flags [ edit ]

  • -DENABLE_GR_XXX=ON This enables (or disables for =OFF) the GNU Radio component named XXX. You might not need all of them, and this way, you can compile quicker.
  • -DCMAKE_INSTALL_PREFIX=XXX Install your stuff to XXX.
  • -DCMAKE_BUILD_TYPE=Debug This causes gcc to add debug symbols to all binaries. Useful for debugging (otherwise, it decreases efficiency!)
  • -DPYTHON_EXECUTABLE=/usr/bin/python This selects the Python version and executable to be used during build time and will determine which Python libraries will be used for building the Python bindings.

For a list of additional cmake flags, as well as minimum versions of dependencies, see [1]

PyBOMBS is good at building GNU Radio, UHD, and various Out of Tree (OOT) modules from source and then installing into a specified user directory rather than in the system files. PyBOMBS detects the user's Operating System and loads all of the prerequisites in the first stage of the build.

The PyBOMBS documentation is in the PyBOMBS README.

Over the years a number of Live Images and VMs have been created. There are currently no official versions but here are some current options:

    A customizable, programmatically generated VM and live environment for GNU Radio. An Ubuntu 20.04 virtual machine image with GNU Radio 3.8.2.0, Fosphor, GQRX, and several other useful pieces of software. (Created using Instant GNU Radio)

If the installation worked without any trouble, you're ready to use GNU Radio! If you have no idea how to do that, the best place to start is with the Tutorials.

Optionally, you may run volk_profile on your terminal to help libvolk to determine the optimal kernels (may speed up GNU Radio).

Тут как-то понадобилось установить программу GNURadio. Конечно я ее установил через «apt install . » и даже попробовал как советует автор GNURadio через PyBOMBS, но в первом случае, нет гарантии, что это будет последняя версия, а во втором возникали ошибки при установке.

Но в любом случае, мне хотелось всегда последнюю версию (хотя последнее, не всегда значит лучше!), да и вообще нравится мне этот фетиш с make )

В общем решил поставить из репозитория GitHub и собрать самостоятельно. Но естественно возникли проблемы со сборкой. То одно не хватает, то другое, то версии не те. В общем всё ругается и не компилируется. А в инете нет нормального описания (я не нашел) по установке.

Но потратив денек, я для себя накатал доку (дабы потом не забыть) и решил поделиться с Вами.


И так я расскажу, как установить и собрать GNURadio и модули для DVB-T USB приемника (у меня обычный приемник с али за 500 руб. и AirSpy R2)



Советы по установке:

1. Пишу по шагам, не пропускать ни одного шага, идем сверху вниз
2. Я скачивал всё в домашнюю папку! (cd

)
3. Где нужен root, там я пишу sudo
4. Проверяйте, что пишется в консоли после каждого шага (вдруг у Вас ошибка)
5. Процесс не быстрый! Нужно терпения и машинку по быстрее. Где-то час у вас уйдет на всё.

Весь процесс я поделил на 6 частей (установок)

1. Инсталлируем GNURadio — процесс долгий, сборка идет долго. Так, что терпения вам
2. Инсталлируем библиотеку RTL-SDR (DVB-T RTL2832U) для приемника
3. Инсталлируем библиотеку LibRtlSdr (Software to turn the RTL2832U into an SDR)
4. Инсталлируем библиотеку GR-OsmoSdr
5. Инсталлируем библиотеку Liquid DSP
6. Заблокировать загрузку стандартных файлов для нашего DVB-T RTL2832U

Часть 1. Инсталлируем GNURadio

Для начала устанавливаем необходимые пакеты (строка длинная)


и далее строчку за строчкой


после make test посмотрите, чтобы не было ошибок!
если нет, то далее…


сейчас мы установили GNURadio. Его можно уже запустить и пользоваться, но нам надо еще собрать и подключить модули для нашего DVB-T приемника.

Часть 2. Инсталлируем библиотеку RTL-SDR (DVB-T RTL2832U)


Тут не должно быть проблем. И библиотека RTL-SDR установлена.

Часть 3. Инсталлируем библиотеку LibRtlSdr


Сделано. Идем далее.

Часть 4. Инсталлируем библиотеку GR-OsmoSdr


Сделано. Идем далее.

Часть 5. Инсталлируем библиотеку Liquid DSP


Сделано. Идем далее.

Часть 6. Заблокировать загрузку стандартных файлов для нашего DVB-T RTL2832U
Открываем (или создаем) файл "/etc/modprobe.d/blacklist-dvb.conf"
и туда вставляем строчки

blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830

и ПЕРЕЗАПУСКАЕМ систему или проще говоря:


Ну вот, вроде процесс закончен и мы можем запустить и проверить наш GNURadio
для этого набираем в консоли:

Тут как-то понадобилось установить программу GNURadio. Конечно я ее установил через «apt install . » и даже попробовал как советует автор GNURadio через PyBOMBS, но в первом случае, нет гарантии, что это будет последняя версия, а во втором возникали ошибки при установке.

Но в любом случае, мне хотелось всегда последнюю версию (хотя последнее, не всегда значит лучше!), да и вообще нравится мне этот фетиш с make )

В общем решил поставить из репозитория GitHub и собрать самостоятельно. Но естественно возникли проблемы со сборкой. То одно не хватает, то другое, то версии не те. В общем всё ругается и не компилируется. А в инете нет нормального описания (я не нашел) по установке.

Но потратив денек, я для себя накатал доку (дабы потом не забыть) и решил поделиться с Вами.


И так я расскажу, как установить и собрать GNURadio и модули для DVB-T USB приемника (у меня обычный приемник с али за 500 руб. и AirSpy R2)



Советы по установке:

1. Пишу по шагам, не пропускать ни одного шага, идем сверху вниз
2. Я скачивал всё в домашнюю папку! (cd

)
3. Где нужен root, там я пишу sudo
4. Проверяйте, что пишется в консоли после каждого шага (вдруг у Вас ошибка)
5. Процесс не быстрый! Нужно терпения и машинку по быстрее. Где-то час у вас уйдет на всё.

Весь процесс я поделил на 6 частей (установок)

1. Инсталлируем GNURadio — процесс долгий, сборка идет долго. Так, что терпения вам
2. Инсталлируем библиотеку RTL-SDR (DVB-T RTL2832U) для приемника
3. Инсталлируем библиотеку LibRtlSdr (Software to turn the RTL2832U into an SDR)
4. Инсталлируем библиотеку GR-OsmoSdr
5. Инсталлируем библиотеку Liquid DSP
6. Заблокировать загрузку стандартных файлов для нашего DVB-T RTL2832U

Часть 1. Инсталлируем GNURadio

Для начала устанавливаем необходимые пакеты (строка длинная)


и далее строчку за строчкой


после make test посмотрите, чтобы не было ошибок!
если нет, то далее…


сейчас мы установили GNURadio. Его можно уже запустить и пользоваться, но нам надо еще собрать и подключить модули для нашего DVB-T приемника.

Часть 2. Инсталлируем библиотеку RTL-SDR (DVB-T RTL2832U)


Тут не должно быть проблем. И библиотека RTL-SDR установлена.

Часть 3. Инсталлируем библиотеку LibRtlSdr


Сделано. Идем далее.

Часть 4. Инсталлируем библиотеку GR-OsmoSdr


Сделано. Идем далее.

Часть 5. Инсталлируем библиотеку Liquid DSP


Сделано. Идем далее.

Часть 6. Заблокировать загрузку стандартных файлов для нашего DVB-T RTL2832U
Открываем (или создаем) файл "/etc/modprobe.d/blacklist-dvb.conf"
и туда вставляем строчки

blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830

и ПЕРЕЗАПУСКАЕМ систему или проще говоря:


Ну вот, вроде процесс закончен и мы можем запустить и проверить наш GNURadio
для этого набираем в консоли:

Читайте также: