UHD and GNURadio installation from sources with PyBombs » History » Version 14

Version 13 (ROQUE, Damien, 01/21/2015 02:15 PM) → Version 14/15 (ROQUE, Damien, 01/26/2015 05:20 PM)

h1. UHD and GNURadio installation

On one hand, the UHD(Universal Hardware Driver) driver is necessary in order to communicate with an USRP(Universal Software Radio Peripheral) device. On the other hand, the development environment GNURadio is also recommended in order to provide several signal processing building blocks operating in a pseudo-real-time fashion.

This documentation explains how to install both "UHD":http://code.ettus.com/redmine/ettus/projects/uhd/wiki and "GNURadio":http://gnuradio.org from the sources with the help of the "PyBombs":http://gnuradio.org/redmine/projects/pybombs/wiki script. The following prerequisites are assumed in the following:
* a GNU/Linux operating system ;
* a user account with administror rights (through sudo) ;
* an Internet connection (if necessary, set @http_proxy@ and @https_proxy@ environment variables appropriately).

h2. Downloading and configuring PyBombs

PyBombs is an unified installation system for GNURadio and its "out-of-tree" modules (including hardware drivers). We first download it through Git with an unprivileged user (but with @sudo@ permissions):
<pre>
git clone https://github.com/pybombs/pybombs.git
</pre>

Run first the configuration of PyBombs as unprivileged user.
<pre>
cd pybombs && ./pybombs config
</pre>

The output should be something like this. Notice that since we chose @/usr/local@ as installation prefix, the configuration fails at the end of the process (it is normal).
<pre>
Username for GIT access
gituser [damien]:
Install Prefix
prefix [/home/damien/target]:/usr/local
Order in which to attempt installations when available, options are: src, rpm, deb
satisfy_order [deb,src]:
Comma separated list of package names to assume are already installed
forcepkgs []:
Comma separated list of package names to always build from source
forcebuild [gnuradio,uhd,gr-air-modes,gr-osmosdr,gr-iqbal,gr-fcdproplus,uhd,rtl-sdr,osmo-sdr,hackrf,gqrx,bladerf,airspy]:
Time the monitor thread waits (in seconds) before retrying downloads
timeout [30]:
CMAKE_BUILD_TYPE args to pass to cmake projects, options are: Debug, Release, RelWithDebInfo, MinSizeRel
cmakebuildtype [RelWithDebInfo]:
Build doxygen while compiling packages? options are: ON, OFF
builddocs [OFF]:
C Compiler Executable [gcc, clang, icc, etc]
cc [gcc]:
C++ Compiler Executable [g++, clang++, icpc, etc]
cxx [g++]:
Concurrent make threads [1,2,4,8...]
makewidth [4]:
done
Settled on prefix: /usr/local

[Errno 13] Permission denied: '/usr/local/lib64'
Error! Configured install prefix requires root privileges. Please re-run as sudo
</pre>

Rerun the configuration with @sudo@ and the intruction should end gracefully.
<pre>
sudo ./pybombs config
</pre>

Optionally, it is possible to define a maximum number a concurrent workers (it will be used by @make@).
<pre>
sudo ./pybombs config makewidth 2
</pre>

h2. Installing UHD and GNURadio from the sources

Run the installation of UHD and GNURadio with the following instruction (it might take one to several hours).

warning. If you are using a proxy, you should configure sudo in order to "preserve environment variables":http://stackoverflow.com/questions/8633461/how-to-keep-environment-variables-when-using-sudo

<pre>
sudo ./pybombs install uhd gnuradio
</pre>

The duration of the installation depends mainly of the following parameters:
* throughput of the Internet connection ;
* frequency and number of CPU cores ;
* number of prerequisite packages installed on your system.

At the end of a successful installation, update the library links.
<pre>
sudo ldconfig
</pre>

h2. Updating packages installed using PyBombs

Several packages installed thanks to PyBombs are under active development (e.g. UHD and GNURadio). In order to update the whole installation, run the following instruction.

warning. If you are using a proxy, you should configure sudo in order to "preserve environment variables":http://stackoverflow.com/questions/8633461/how-to-keep-environment-variables-when-using-sudo

<pre>
sudo ./pybombs update
</pre>

If only specific packages should be updated, they can be explicitly mentioned.
<pre>
sudo ./pybombs update uhd gnuradio
</pre>

At the end of the installation, do not forget to update the library links.
<pre>
sudo ldconfig
</pre>

h2. UHD configuration

h3. Update the firmware database

In order to make sure that the firmwares are up-to-date, you can run the following instruction.
<pre>
sudo "/usr/local/lib/uhd/utils/uhd_images_downloader.py"
</pre>



h3. Setting up real-time scheduling

Since the UHD needs a high priority of execution, it is recommended to add the following line to @/etc/security/limits.conf@.
<pre>
@usrp - rtprio 99
</pre>

Hence, it necessary to create the group @usrp@ and add to this group any user willing to use the USRP hardware.
<pre>
sudo groupadd usrp
sudo adduser <my-login> usrp
</pre>

At this time, the user shall close and reopen his session. Inside a shell, he can also issue the following instruction
<pre>
su - <my-login>

</pre>

The system is now ready for adding an USRP (see documentation for the appropriate model...).