Difference between revisions of "InstallingGR"

From GNU Radio
Jump to navigation Jump to search
 
(81 intermediate revisions by 14 users not shown)
Line 1: Line 1:
= From Binaries =
<div style="float:right">
{{Template:BeginnerTutorials}}
</div>
 
{| class="wikitable"
|+ Install Quickstart<br>(Refer to the rest of this page for more OS and installation options)
! Linux
||
# [https://releases.ubuntu.com/20.04/ Install Ubuntu 20.04] (either as a VM or natively)
# <code>sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.9</code>
# <code>sudo apt-get update</code>
# <code>sudo apt-get install gnuradio python3-packaging</code>
||v3.9.5
|-
! Windows
||
# Install the latest [https://github.com/ryanvolz/radioconda/releases Radioconda installer]
# Launch "GNU Radio Companion" from the Start menu
||v3.10.2
|-
! macOS
||
# [https://brew.sh/ Install Homebrew]
# <code>brew install gnuradio</code>
# You'll have to edit gnuradio/grc/gui/DrawingArea.py and [https://github.com/gnuradio/gnuradio/pull/5111/files make this change]
||v3.9.3
|}
 
 
= Types of Installation Methods =


The recommended way to install GNU Radio on most platforms is using already available binary packages (see [[#Ubuntu_PPA_Installation|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.
The recommended way to install GNU Radio on most platforms is using already available binary packages. Find your platform below in the [[#From_Binaries|From Binaries]] section for instructions on how to get GNU Radio through your regular package manager (e.g. [[#Ubuntu_PPA_Installation|Ubuntu PPA Installation]]), or visit the [[CondaInstall|Conda Installation]] page for instructions on how to use the Conda package manager to install GNU Radio on any Linux distribution, macOS, or Windows. 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:
In addition to using binaries, GNU Radio can be installed:
Line 7: Line 36:
# '''[[#From_Source|From source]]''' (for those who want full control)
# '''[[#From_Source|From source]]''' (for those who want full control)
# '''[[#Using_PyBOMBS|Using PyBOMBS]]''' (for those who want it built from source and/or installed to a specific directory using a script)
# '''[[#Using_PyBOMBS|Using PyBOMBS]]''' (for those who want it built from source and/or installed to a specific directory using a script)
= From Binaries =


== Linux ==
== Linux ==
Line 12: Line 43:
Most distributions contain a package named <code>gnuradio</code> or similar in their standard repositories. For most use cases it is enough to install this package and start developing.
Most distributions contain a package named <code>gnuradio</code> 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 is 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.
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.
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 &quot;Distribution&quot; for more installation details):
Here are examples of how to install GNU Radio in various Linux distributions. <b>Click the link under &quot;Distribution&quot; for how to install dependencies.</b>


{|class="wikitable" style="margin: auto; width: 90%;"
{|class="wikitable" style="margin: auto; width: 90%;"
Line 23: Line 54:
|-
|-
| [[UbuntuInstall|Debian/Ubuntu and derivates]]
| [[UbuntuInstall|Debian/Ubuntu and derivates]]
| <pre>$ apt install gnuradio</pre>
| <pre># apt install gnuradio</pre>
|-
|-
| [[FedoraInstall|Fedora]]
| [[FedoraInstall|Fedora]]
| <pre>$ dnf install gnuradio</pre>
| <pre># dnf install gnuradio</pre>
|-
|-
| RHEL/CentOS
| RHEL/CentOS/Rocky Linux/AlmaLinux
| <pre>$ yum install gnuradio</pre>
| <pre># yum install gnuradio</pre>
|-
|-
| [[ArchInstall|Archlinux]]
| [[ArchInstall|Archlinux]]
| <pre>$ pacman -S gnuradio</pre>
| <pre># pacman -S gnuradio</pre>
|-
|-
| [[GentooInstall|Gentoo Linux]]
| [[GentooInstall|Gentoo Linux]]
| <pre>$ emerge net-wireless/gnuradio</pre>
| <pre># emerge net-wireless/gnuradio</pre>
|-
|-
| [[SuseInstall|Suse Linux]]
| [[SuseInstall|Suse Linux]]
|
|
|-
| [[InstallingGRFromSource_on_Raspberry_Pi|Raspberry Pi OS]]
|  
|-
|-
|}
|}
Line 45: Line 79:


=== Ubuntu PPA Installation ===
=== Ubuntu PPA Installation ===
For Ubuntu, the latest builds (both released and pulled from master branch) are maintained as PPAs on [https://launchpad.net/~gnuradio/+archive/ubuntu/gnuradio-master launchpad]. Be sure to uninstall any previously installed versions of gnuradio first.
For Ubuntu, the latest builds (both released and pulled from master branch) are maintained as PPAs on [https://launchpad.net/~gnuradio launchpad].<br>
<b>Be sure to uninstall any previously installed versions of gnuradio first.</b> See [[UnInstallGR#From_PPA|UnInstallGR]].<br><br>


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


<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases</pre>
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases</pre>


To access the latest from the master branch (currently pre 3.9 release), add the gnuradio/gnuradio-master ppa (removing other gnuradio ppas if already configured)
To access the 3.9 released version, add the gnuradio/gnuradio-releases-3.9 ppa (removing other gnuradio ppas if already configured)
 
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.9</pre>
 
To access the 3.8 released version, add the gnuradio/gnuradio-releases-3.8 ppa (removing other gnuradio ppas if already configured)


<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-master</pre>
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.8</pre>


To access the 3.7 released version (legacy), add the gnuradio/gnuradio-releases-3.7 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)
Line 62: Line 101:
<pre>$ sudo apt-get update</pre>
<pre>$ sudo apt-get update</pre>
<pre>$ sudo apt install gnuradio</pre>
<pre>$ sudo apt install gnuradio</pre>
'''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. Instead, please first open GNURadio-Companion, and in the right-hand side block list, open "Soapy" -> "Source" or "Sink", to see whether the hardware you are most likely using is already integrated.
'''Note on 3.10 packaging dependency'''
For some distributions you may need to install the python module 'packaging' using pip (which may also need to be installed).
$ sudo apt install python3-pip
$ pip install packaging


==== Modtool on Ubuntu ====
==== Modtool on Ubuntu ====
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:
NOTE: On released builds for Ubuntu 18.04 (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 work around this issue:


<pre>$ cd /usr/share/gnuradio/modtool/templates/gr-newmod
<pre>$ cd /usr/share/gnuradio/modtool/templates/gr-newmod
Line 73: Line 121:
=== Fedora COPR Installation ===
=== Fedora COPR Installation ===


Packages are available for Fedora 29,30,31 hosted under COPR:
**NOTE: FEDORA COPR not currently maintained**
 
Packages are available for Fedora 29, 30, 31 hosted under COPR:


https://copr.fedorainfracloud.org/coprs/gnuradio/
https://copr.fedorainfracloud.org/coprs/gnuradio/
Line 89: Line 139:
== Windows ==
== Windows ==


Binary installers are now available for GNU Radio 3.7 and 3.8, download them [http://www.gcndevelopment.com/gnuradio/index.htm here].<br />
See the [[CondaInstall|Conda install guide]] or [https://github.com/ryanvolz/radioconda radioconda] to install GNU Radio 3.8 or newer on Windows.<br />
 
If you need to install GNU Radio from source refer to the [[WindowsInstall|Windows install guide]].
If you need to install GNU Radio from source refer to the [[WindowsInstall|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.
'''Note''': GNU Radio support on Windows is improving significantly but remains less tested and there are known problems and even significant bugs which affect regular usage of GNU Radio Companion. Please report bugs on the [https://github.com/gnuradio/gnuradio/issues GitHub Issues page] and if you have Windows development experience please consider investigating some of the [https://github.com/gnuradio/gnuradio/issues?q=is%3Aopen+is%3Aissue+label%3AWindows known issues].


== Mac OS X ==
== Mac OS X ==
Line 104: Line 155:
=== Notes ===
=== Notes ===


* By default GNU Radio will be installed in the /usr/local directory.  See notes about -DCMAKE_INSTALL_PREFIX to install it elsewhere.
* By default GNU Radio will be installed in the <code>/usr/local</code> directory.  See notes about [[InstallingGR#Common_cmake_flags|-DCMAKE_INSTALL_PREFIX]] to install it elsewhere.
* Running and developing out-of-tree modules does not require GNU Radio to be installed from source.  
* Running and developing out-of-tree modules does not require GNU Radio to be installed from source.  
* If you are using Ubuntu, see [[UbuntuInstall#Install_the_Pre-Requisites]] for installing dependencies / pre-requisites.
* <b>If you want to use GNU Radio with a USRP, you FIRST must clone and install UHD</b>. Follow the instructions in [[InstallingGRFromSource_on_Raspberry_Pi#Load_prerequisites|Install UHD from source]].
* If you want to use GNU Radio with a USRP, you <b>FIRST</b> must clone and install UHD. See [[https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux UHD Installation Page]] for more info.
* To install on a Raspberry Pi, see [[InstallingGRFromSource on Raspberry Pi]].
* To install on a Raspberry Pi, see [[InstallingGRFromSource on Raspberry Pi]].
* To build from source from within a conda environment, see [[CondaInstall#Building GNU Radio from source within a conda environment|the conda install guide]].
=== For GNU Radio 3.10, 3.9, and Main Branch ===


=== For the GNU Radio Master Branch ===
This section describes how to install GNU Radio 3.10, 3.9, and the Main branch from source code.


Since Volk is no longer considered as a submodule of GNU Radio (GNU Radio commit #80c04479da962d048d41165081b026aafdaa0316 ),<br> you <b>MUST FIRST</b> install Volk, and then install GNU Radio.
==== Installing Dependencies ====


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.
Refer to [[InstallingGR#Linux|this page for your specific Linux distro]] to find how to install dependencies. For example, on Ubuntu 20.04 [[UbuntuInstall#Focal_Fossa_.2820.04.29_through_Impish_Indri_.2821.10.29|use this command]].


==== Step 1: Installing Dependencies ====
==== Installing Volk ====


Refer to [[InstallingGR#Linux|this page for your specific Linux distro]] to find how to install dependencies.  For example, on Ubuntu 20.04 [[UbuntuInstall#Focal Fossa (20.04)|use this command]].
Since Volk is no longer considered as a submodule of GNU Radio (GNU Radio commit #80c04479da962d048d41165081b026aafdaa0316),<br> you <b>MUST FIRST</b> install Volk, and then install GNU Radio.  


==== Step 2: Installing Volk ====
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.


* <code>cd</code>
* <code>cd</code>
* <code>git clone https://github.com/gnuradio/volk.git</code>
* <code>git clone --recursive https://github.com/gnuradio/volk.git</code>
* <code>cd volk</code>
* <code>cd volk</code>
* <code>mkdir build</code>
* <code>mkdir build</code>
* <code>cd build</code>
* <code>cd build</code>
<b>Note:</b> In the following command, you can add <code>-DCMAKE_INSTALL_PREFIX=XXX</code> to install Volk into the PREFIX <code>XXX</code>; if not specified, then the PREFIX is <code>/usr/local</code>. See other CMake options in [[#Common_cmake_flags|Common cmake flags]].<br>
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code>
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code>
* <code>make</code>
* <code>make</code>
Line 135: Line 189:
* <code>sudo ldconfig</code>
* <code>sudo ldconfig</code>


==== Step 3: Installing GNU Radio ====
==== Installing GNU Radio ====
 
* <code>cd</code>
* <code>cd</code>
* <code>git clone https://github.com/gnuradio/gnuradio.git</code>
* <code>git clone https://github.com/gnuradio/gnuradio.git</code>
* <code>cd gnuradio</code>
* <code>cd gnuradio</code>
<b>Note:</b> If you want to build the <code>maint-3.10</code> or <code>maint-3.9</code> branch rather than the default <code>main</code> branch, enter:
<code>git checkout maint-3.10</code> and then<br>
* <code>mkdir build</code>
* <code>mkdir build</code>
* <code>cd build</code>
* <code>cd build</code>
<b>Note:</b> In the following command, you can add <code>-DCMAKE_INSTALL_PREFIX=XXX</code> to install GNU Radio into the PREFIX <code>XXX</code>; if not specified, then the PREFIX is <code>/usr/local</code>. See other CMake options in [[#Common_cmake_flags|Common cmake flags]].<br>
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code>
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code>
* <code>make</code>
* <code>make -j3</code> (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.)
 
<b>Note:</b> 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.
<b>Note:</b> 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.
* <code>make test</code>
* <code>make test</code>
* <code>sudo make install</code>
* <code>sudo make install</code>
If you're running Linux, then always remember to do the following command after installing any library:
* <code>sudo ldconfig</code>
As an optional step to increase performance, we recommend running the following, although it can take 10-15 minutes and you can always do it later:
* <code>volk_profile</code>
If you encounter "Cannot import gnuradio" error, then go to [[ModuleNotFoundError#B._Finding_the_Python_library|Finding the Python library]] to set your PYTHONPATH and LD_LIBRARY_PATH.<br><b>After setting these environment variables, you need to do</b> <code>sudo ldconfig</code> <b>again</b> for the Linux dynamic library loader to find the just-installed GNU Radio libraries.<br>
If you have installed in a custom path with <code>-DCMAKE_INSTALL_PREFIX=XXX</code>, you will need to add that path to $PATH in order to find gnuradio-companion.


Again, if you're running Linux, then always remember to do the following command after installing any library:
=== For GNU Radio 3.8 or Earlier ===
* <code>sudo ldconfig</code>
 
==== Installing Dependencies ====


If you encounter "Cannot import gnuradio" error, then go to [[ModuleNotFoundError#B._Finding_the_Python_library|Finding the Python library]] to set your PYTHONPATH and LD_LIBRARY_PATH.<br><b>After setting these environment variables, you need to do</b> <code>sudo ldconfig</code> <b>again</b> for the Linux dynamic library loader to find the just-installed GNU Radio libraries.
Refer to [[InstallingGR#Linux|this page for your specific Linux distro]] to find how to install dependencies. For example, on Ubuntu 20.04 [[UbuntuInstall#Focal_Fossa_.2820.04.29_through_Impish_Indri_.2821.10.29|use this command]].


=== For GNU Radio 3.8 or Earlier ===
==== Installing GNU Radio ====
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.
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.


Line 168: Line 231:
* <code>cd build</code>
* <code>cd build</code>


<b>Note:</b> In the following command, you can use <code>-DCMAKE_INSTALL_PREFIX=XXX</code> to install GNU Radio into the PREFIX <code>XXX</code>; if not specified, then the PREFIX is <code>/usr/local</code>. See other CMake options in [[#Common_cmake_flags|Common cmake flags]].<br>
<b>Note:</b> In the following command, you can add <code>-DCMAKE_INSTALL_PREFIX=XXX</code> to install GNU Radio into the PREFIX <code>XXX</code>; if not specified, then the PREFIX is <code>/usr/local</code>. See other CMake options in [[#Common_cmake_flags|Common cmake flags]].<br>


* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code>
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code>
Line 177: Line 240:
* <code>sudo ldconfig</code>
* <code>sudo ldconfig</code>


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


==== For Ubuntu 18.04 ====
==== For Ubuntu 18.04 ====
Line 187: Line 251:
* <code>pip3 install numpy scipy</code>
* <code>pip3 install numpy scipy</code>
* <code>echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.bashrc</code>
* <code>echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.bashrc</code>
* <code>echo 'export LD_LIBRARY_PATH=/user/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc</code>
* <code>echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc</code>
* <code>echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.profile</code>
* <code>echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.profile</code>
* <code>echo 'export LD_LIBRARY_PATH=/user/local/lib:$LD_LIBRARY_PATH' >> ~/.profile</code>
* <code>echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.profile</code>
* <code>cd ~/</code>
* <code>cd ~/</code>
* <code>git clone --recursive https://github.com/gnuradio/gnuradio</code>
* <code>git clone --recursive https://github.com/gnuradio/gnuradio</code>
Line 215: Line 279:
= Using PyBOMBS =
= Using PyBOMBS =


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.
PyBOMBS used to be the go-to method for building GNU Radio, UHD, and various Out of Tree (OOT) modules from source and then installing them into an isolated directory rather than system-wide, not unlike a Python virtualenv. We are no longer including PyBOMBS as a recommended method of installing GNU Radio, unless you want to play around with old versions (e.g. GR 3.7, 3.8, and OOTs of matching version).  The PyBOMBS documentation is in the PyBOMBS [https://github.com/gnuradio/pybombs#pybombs README].


The PyBOMBS documentation is in the PyBOMBS [https://github.com/gnuradio/pybombs#pybombs README].
= VMs and Live Images =
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:
*[https://github.com/bastibl/instant-gnuradio Instant GNU Radio] A customizable, programmatically generated VM and live environment for GNU Radio.
*[[UbuntuVM]] 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)


= OK, it's installed, what now? =
= OK, it's installed, what now? =

Latest revision as of 15:17, 24 April 2022

Beginner Tutorials

Introducing GNU Radio

  1. What is GNU Radio?
  2. Installing GNU Radio
  3. Your First Flowgraph

Flowgraph Fundamentals

  1. Python Variables in GRC
  2. Variables in Flowgraphs
  3. Runtime Updating Variables
  4. Signal Data Types
  5. Converting Data Types
  6. Packing Bits
  7. Streams and Vectors
  8. Hier Blocks and Parameters

Creating and Modifying Python Blocks

  1. Creating Your First Block
  2. Python Block With Vectors
  3. Python Block Message Passing
  4. Python Block Tags

DSP Blocks

  1. Low Pass Filter Example
  2. Designing Filter Taps
  3. Sample Rate Change
Install Quickstart
(Refer to the rest of this page for more OS and installation options)
Linux
  1. Install Ubuntu 20.04 (either as a VM or natively)
  2. sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.9
  3. sudo apt-get update
  4. sudo apt-get install gnuradio python3-packaging
v3.9.5
Windows
  1. Install the latest Radioconda installer
  2. Launch "GNU Radio Companion" from the Start menu
v3.10.2
macOS
  1. Install Homebrew
  2. brew install gnuradio
  3. You'll have to edit gnuradio/grc/gui/DrawingArea.py and make this change
v3.9.3


Types of Installation Methods[edit]

The recommended way to install GNU Radio on most platforms is using already available binary packages. Find your platform below in the From Binaries section for instructions on how to get GNU Radio through your regular package manager (e.g. Ubuntu PPA Installation), or visit the Conda Installation page for instructions on how to use the Conda package manager to install GNU Radio on any Linux distribution, macOS, or Windows. 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)

From Binaries[edit]

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
# apt install gnuradio
Fedora
# dnf install gnuradio
RHEL/CentOS/Rocky Linux/AlmaLinux
# yum install gnuradio
Archlinux
# pacman -S gnuradio
Gentoo Linux
# emerge net-wireless/gnuradio
Suse Linux
Raspberry Pi OS

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. See UnInstallGR.

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

$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases

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

$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.9

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

$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.8

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

$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.7

Then, update the apt sources, and install gnuradio

$ sudo apt-get update
$ sudo apt 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. Instead, please first open GNURadio-Companion, and in the right-hand side block list, open "Soapy" -> "Source" or "Sink", to see whether the hardware you are most likely using is already integrated.


Note on 3.10 packaging dependency For some distributions you may need to install the python module 'packaging' using pip (which may also need to be installed).

$ sudo apt install python3-pip
$ pip install packaging

Modtool on Ubuntu[edit]

NOTE: On released builds for Ubuntu 18.04 (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 work around this issue:

$ cd /usr/share/gnuradio/modtool/templates/gr-newmod
$ sudo py3clean .

This issue does not appear for Ubuntu 19 and later packages

Fedora COPR Installation[edit]

    • NOTE: FEDORA COPR not currently maintained**

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

https://copr.fedorainfracloud.org/coprs/gnuradio/

1. Add the repository:

-- For the latest released version:

$ sudo dnf copr enable gnuradio/gnuradio-releases 

-- For the latest pull from git master:

$ sudo dnf copr enable gnuradio/gnuradio-master 

2. Install GNU Radio

$ sudo dnf install gnuradio 

Windows[edit]

See the Conda install guide or radioconda to install GNU Radio 3.8 or newer on Windows.

If you need to install GNU Radio from source refer to the Windows install guide.

Note: GNU Radio support on Windows is improving significantly but remains less tested and there are known problems and even significant bugs which affect regular usage of GNU Radio Companion. Please report bugs on the GitHub Issues page and if you have Windows development experience please consider investigating some of the known issues.

Mac OS X[edit]

Refer to the Mac OS X install guide page.

From Source[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]

For GNU Radio 3.10, 3.9, and Main Branch[edit]

This section describes how to install GNU Radio 3.10, 3.9, and the Main 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]

Since Volk is no longer considered as a submodule of GNU Radio (GNU Radio commit #80c04479da962d048d41165081b026aafdaa0316),
you MUST FIRST install Volk, and then install GNU Radio.

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:

  • sudo ldconfig

Installing GNU Radio[edit]

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

  • 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.)

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.

  • make test
  • sudo make install

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

  • sudo ldconfig

As an optional step to increase performance, we recommend running the following, although it can take 10-15 minutes and you can always do it later:

  • volk_profile

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]

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 GNU Radio[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:

  • sudo ldconfig

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):

  • sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins python3-zmq python3-scipy python3-pip python3-gi-cairo
  • pip3 install git+https://github.com/pyqtgraph/pyqtgraph@develop
  • pip3 install numpy scipy
  • echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.bashrc
  • echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
  • echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.profile
  • echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.profile
  • cd ~/
  • git clone --recursive https://github.com/gnuradio/gnuradio
  • cd gnuradio
  • git checkout maint-3.8
  • mkdir build
  • cd build
  • git pull --recurse-submodules=on
  • git submodule update --init
  • cmake -DENABLE_GR_UHD=OFF ..
  • make -j $(nproc --all)
  • sudo make install
  • sudo ldconfig

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{2,3} 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]

Using PyBOMBS[edit]

PyBOMBS used to be the go-to method for building GNU Radio, UHD, and various Out of Tree (OOT) modules from source and then installing them into an isolated directory rather than system-wide, not unlike a Python virtualenv. We are no longer including PyBOMBS as a recommended method of installing GNU Radio, unless you want to play around with old versions (e.g. GR 3.7, 3.8, and OOTs of matching version). The PyBOMBS documentation is in the PyBOMBS README.

VMs and Live Images[edit]

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:

  • Instant GNU Radio A customizable, programmatically generated VM and live environment for GNU Radio.
  • UbuntuVM 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)

OK, it's installed, what now?[edit]

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).