UbuntuInstall: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
 
(30 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<b>There's generally no need to build GNU Radio from source code unless you want to modify GNU Radio rather than just using it.</b> 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.
<b>There's generally no need to build GNU Radio from source code unless you want to modify GNU Radio rather than just using it.</b> 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:
In short: on all modern Ubuntu versions use:


<pre>
<pre>
Line 11: Line 11:
See our [https://launchpad.net/~gnuradio/+archive/ubuntu/gnuradio-releases PPA] page for more details.
See our [https://launchpad.net/~gnuradio/+archive/ubuntu/gnuradio-releases PPA] page for more details.


This page describes dependencies for building GNU Radio from source code.
The rest of this page describes dependencies for building GNU Radio from source code.
 
= Building GNU Radio on Ubuntu Linux =
 
GNU Radio works well on all Ubuntu versions from 10.04 upward. It is also possible to install GNU Radio on older releases of Ubuntu (see [[#Building_GNU_Radio_on_Legacy_Ubuntu]]). However, we may not be able to provide sufficient support for legacy OS.


== Install Dependencies ==
== Install Dependencies ==


<p>The following command line scripts will install all the required dependencies. Before running them, you should ensure that the "Main" and "Universe" repositories are enabled in &quot;Software Sources&quot;. See https://help.ubuntu.com/community/Repositories/Ubuntu for a complete description.</p>
The following commands will install all the required dependencies. Before running them, you should [https://help.ubuntu.com/community/Repositories/Ubuntu ensure that the "Main" and "Universe" repositories are enabled in &quot;Software Sources&quot;].
 
To execute the script, copy and paste the relevant command line into a terminal.
 
=== Notes ===


* 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.
After installing dependencies you can continue with [[LinuxInstall#From_Source|installing GR from source]].


=== Focal Fossa (20.04) through Hirsute Hippo (21.04) ===
=== Focal Fossa (20.04) through Mantic Minotaur (23.10) ===


GNU Radio version 3.8.x with Python 3 support:
GNU Radio version 3.8.x with Python 3 support:
Line 37: Line 29:
liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins \
liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins \
python3-zmq python3-scipy python3-gi python3-gi-cairo gir1.2-gtk-3.0 \
python3-zmq python3-scipy python3-gi python3-gi-cairo gir1.2-gtk-3.0 \
libcodec2-dev libgsm1-dev
libcodec2-dev libgsm1-dev libusb-1.0-0 libusb-1.0-0-dev libudev-dev
</pre>
</pre>


GNU Radio version 3.9.x additionally requires:
GNU Radio version 3.9.x <b>in addition to above</b> requires:


<pre>
<pre>
sudo apt install pybind11-dev python3-matplotlib libsndfile1-dev \
sudo apt install pybind11-dev python3-matplotlib libsndfile1-dev \
pygccxml pyqtgraph libsoapysdr-dev soapysdr-tools
libsoapysdr-dev soapysdr-tools python3-pygccxml python3-pyqtgraph
</pre>
</pre>


GNU Radio version 3.10.x and the `master` branch additionally require:
GNU Radio version 3.10.x and the 'main' branch <b>in addition to above</b> require:
 
<pre>
sudo apt install libiio-dev libad9361-dev libspdlog-dev python3-packaging python3-jsonschema python3-qtpy
</pre>


<b>Note:</b> Since GNU Radio 3.9.x, swig has been replaced with pybind11 and can be removed:
<pre>
<pre>
sudo apt install libiio-dev libad9361-dev
sudo apt remove swig
</pre>
</pre>


Line 79: Line 76:
</pre>
</pre>


=== Xenial Xerus (16.04) ===
=== Older Ubuntu Distros ===


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 older versions of Ubuntu see [[Old Ubuntu Deps]]


For GNU Radio 3.7.x:
=== Ubuntu Derivative Distros ===


<pre>sudo apt-get -y install git-core cmake g++ python-dev swig \
* 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.
pkg-config libfftw3-dev libboost-all-dev libcppunit-dev libgsl0-dev \
libusb-dev libsdl1.2-dev python-wxgtk3.0 python-numpy \
python-cheetah python-lxml doxygen libxi-dev python-sip \
libqt4-opengl-dev libqwt-dev libfontconfig1-dev libxrender-dev \
python-sip python-sip-dev python-qt4 python-sphinx libusb-1.0-0-dev \
libcomedi-dev libzmq-dev </pre>
 
=== Trusty Tahr (14.04) ===
 
<pre>sudo apt-get -y install git-core cmake g++ python-dev swig \
pkg-config libfftw3-dev libboost1.55-all-dev libcppunit-dev libgsl0-dev \
libusb-dev libsdl1.2-dev python-wxgtk2.8 python-numpy \
python-cheetah python-lxml doxygen libxi-dev python-sip \
libqt4-opengl-dev libqwt-dev libfontconfig1-dev libxrender-dev \
python-sip python-sip-dev</pre>
Then set the following environmental variable to use PyQT:
 
<pre>export PYTHONPATH=/opt/qt/lib/python2.7/dist-package</pre>
=== Saucy Salamander (13.10) ===
 
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.
 
<pre>sudo apt-get -y install git-core cmake g++ python-dev swig \
pkg-config libfftw3-dev libboost1.53-all-dev libcppunit-dev libgsl0-dev \
libusb-dev libsdl1.2-dev python-wxgtk2.8 python-numpy \
python-cheetah python-lxml doxygen libxi-dev python-sip \
libqt4-opengl-dev libqwt-dev libfontconfig1-dev libxrender-dev \
libgruel3.6.1</pre>
If you have PyQWT installed already, remove it:<br />
<code>$ sudo apt-get remove python-qwt5-qt4</code>
 
Make sure SIP is installed:<br />
<code>$ sudo apt-get install python-sip python-sip-dev</code>
 
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).<br />
<code>$ sudo mkdir /opt/qt</code>
 
First, set up your environment
 
Edit ./bashrc by adding or amending the following variables:
 
<pre>export PATH=/opt/qt/bin:$PATH
export LD_LIBRARY_PATH=/opt/qt/lib:/usr/local/lib:$LD_LIBRARY_PATH
export PYTHONPATH=/opt/qt/lib/python2.7/dist-packages:$PYTHONPATH
export PKG_CONFIG_PATH=/opt/qt/lib/pkgconfig:$PKG_CONFIG_PATH</pre>
Either restart the terminal or reset your environment:<br />
<code>$ source ~/.bashrc</code>
 
Download and install PyQt version 4.10.3<br />
http://www.riverbankcomputing.com/software/pyqt/download
 
<pre>  $ tar xzf PyQt-x11-gpl-4.10.3.tar.gz
  $ cd PyQt-x11-gpl-4.10.3
  $ python configure.py -b /opt/qt/bin -d /opt/qt/lib/python2.7/dist-packages -v /opt/qt/share/sip
  $ make
  $ sudo make install</pre>
Download and install PyQWT version 5.2.0<br />
http://pyqwt.sourceforge.net/download.html
 
<pre>  $ tar xzf PyQwt-5.2.0.tar.gz
  $ cd PyQwt-5.2.0/configure
  $ ./configure.py -Q ../qwt-5.2 --module-install-path=/opt/qt/lib/python2.7/dist-packages/PyQt4/Qwt5
  $ make
  $ sudo make install</pre>
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) ===
 
'''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'.
 
<pre>sudo apt-get -y install git-core autoconf automake libtool g++ python-dev swig \
pkg-config libfftw3-dev libboost1.53-all-dev libcppunit-dev libgsl0-dev \
libusb-dev sdcc libsdl1.2-dev python-wxgtk2.8 python-numpy \
python-cheetah python-lxml doxygen python-qt4 python-qwt5-qt4 libxi-dev \
libqt4-opengl-dev libqwt5-qt4-dev libfontconfig1-dev libxrender-dev qt4-default</pre>
=== Precise Pangolin (12.04) ===
 
<pre>sudo apt-get -y install git-core autoconf automake  libtool g++ python-dev swig \
pkg-config libboost1.48-all-dev libfftw3-dev libcppunit-dev libgsl0-dev \
libusb-dev sdcc libsdl1.2-dev python-wxgtk2.8 python-numpy \
python-cheetah python-lxml doxygen python-qt4 python-qwt5-qt4 libxi-dev \
libqt4-opengl-dev libqwt5-qt4-dev libfontconfig1-dev libxrender-dev </pre>
=== Natty Narwhal (11.04) ===
 
<pre>sudo apt-get -y install git-core autoconf automake  libtool g++ python-dev swig \
pkg-config libboost-all-dev libfftw3-dev libcppunit-dev libgsl0-dev \
libusb-dev sdcc libsdl1.2-dev python-wxgtk2.8 python-numpy \
python-cheetah python-lxml doxygen python-qt4 python-qwt5-qt4 libxi-dev \
libqt4-opengl-dev libqwt5-qt4-dev libfontconfig1-dev libxrender-dev </pre>
=== Maverick (10.10) ===
 
<pre>sudo apt-get -y install libfontconfig1-dev libxrender-dev libpulse-dev \
swig g++ automake autoconf libtool python-dev libfftw3-dev \
libcppunit-dev libboost-all-dev libusb-dev fort77 sdcc sdcc-libraries \
libsdl1.2-dev python-wxgtk2.8 git guile-1.8-dev \
libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-lxml doxygen qt4-dev-tools \
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4</pre>
=== Lucid (10.04) ===
 
<pre>sudo apt-get -y install libfontconfig1-dev libxrender-dev libpulse-dev \
swig g++ automake autoconf libtool python-dev libfftw3-dev \
libcppunit-dev libboost-all-dev libusb-dev fort77 sdcc sdcc-libraries \
libsdl1.2-dev python-wxgtk2.8 git-core guile-1.8-dev \
libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-lxml doxygen qt4-dev-tools \
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4</pre>
 
== Installing GNU Radio ==
 
Click [[InstallingGR#From_Source|here]] to show install instructions.
 
== Configuring USRP support ==
 
''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 [https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux#Configuring_USB 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 [[UdevConfig|directions]], and sets up groups to handle USRP via USB, either live or hot-plug
 
<pre>sudo addgroup usrp
sudo usermod -G usrp -a
echo 'ACTION==&quot;add&quot;, BUS==&quot;usb&quot;, SYSFS{idVendor}==&quot;fffe&quot;, SYSFS{idProduct}==&quot;0002&quot;, GROUP:=&quot;usrp&quot;, MODE:=&quot;0660&quot;' &gt; tmpfile
sudo chown root.root tmpfile
sudo mv tmpfile /etc/udev/rules.d/10-usrp.rules</pre>
At this point, Ubuntu is configured to know what to do if/when it detects the USRP on the USB, except that &quot;udev&quot; 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.
 
<pre>sudo udevadm control --reload-rules</pre>
or
 
<pre>sudo /etc/init.d/udev stop
sudo /etc/init.d/udev start</pre>
or
 
<pre>sudo killall -HUP udevd</pre>
You can check if the USRP is being recognized, by examining /dev/bus/usb after plugging in a USRP. Using the command:
 
<pre>ls -lR /dev/bus/usb | grep usrp</pre>
should result in one or more lines (one for each USRP) reading something like:
 
<pre>crw-rw---- 1 root usrp 189, 514 Mar 24 09:46 003</pre>
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 &quot;usrp_benchmark_usb&quot; 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 &quot;gnuradio&quot; directory, verify that ''all'' of the following work:
 
* Python interface to the USRP; provides a rough estimate of the maximum throughput (quantized to a power of 2) between the host computer and the USRP.
 
<pre>cd gnuradio-examples/python/usrp
./usrp_benchmark_usb.py</pre>
* C++ interface to the USRP; provides a good estimate of the maximum throughput (non-quantized) between the host computer and the USRP.
 
<pre>cd usrp/host/apps
./test_usrp_standard_tx
./test_usrp_standard_rx</pre>
You are now ready to use GNU Radio and your USRP.

Latest revision as of 13:52, 8 April 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 all modern Ubuntu versions use:

sudo add-apt-repository ppa:gnuradio/gnuradio-releases
sudo apt-get update
sudo apt-get install gnuradio

See our PPA page for more details.

The rest of this page describes dependencies for building GNU Radio from source code.

Install Dependencies

The following commands will install all the required dependencies. Before running them, you should ensure that the "Main" and "Universe" repositories are enabled in "Software Sources".

After installing dependencies you can continue with installing GR from source.

Focal Fossa (20.04) through Mantic Minotaur (23.10)

GNU Radio version 3.8.x with Python 3 support:

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-gi python3-gi-cairo gir1.2-gtk-3.0 \
libcodec2-dev libgsm1-dev libusb-1.0-0 libusb-1.0-0-dev libudev-dev

GNU Radio version 3.9.x in addition to above requires:

sudo apt install pybind11-dev python3-matplotlib libsndfile1-dev \
libsoapysdr-dev soapysdr-tools python3-pygccxml python3-pyqtgraph

GNU Radio version 3.10.x and the 'main' branch in addition to above require:

sudo apt install libiio-dev libad9361-dev libspdlog-dev python3-packaging python3-jsonschema python3-qtpy

Note: Since GNU Radio 3.9.x, swig has been replaced with pybind11 and can be removed:

sudo apt remove swig

Bionic Beaver (18.04) through Eoan Ermine (19.10)

GNU Radio version 3.8.x with Python 3 support:

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

GNU Radio version 3.7.x:

sudo apt install cmake git g++ libboost-all-dev python-dev python-mako \
python-numpy python-wxgtk3.0 python-sphinx python-cheetah swig libzmq3-dev \
libfftw3-dev libgsl-dev libcppunit-dev doxygen libcomedi-dev libqt4-opengl-dev \
python-qt4 libqwt-dev libsdl1.2-dev libusb-1.0-0-dev python-gtk2 python-lxml \
pkg-config python-sip-dev 

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:

sudo apt install python3-matplotlib libsndfile1-dev

Older Ubuntu Distros

For older versions of Ubuntu see Old Ubuntu Deps

Ubuntu Derivative Distros

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