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

ROQUE, Damien, 01/06/2015 04:12 PM

1 1 ROQUE, Damien
h1. UHD and GNURadio installation
2 1 ROQUE, Damien
3 3 ROQUE, Damien
The UHD(Universal Hardware Driver) driver deploy a USRP(Universal Software Radio Peripheral) device. The development environment GNURadio is also recommended in order to provide several signal processing building blocks operating in a pseudo-real-time fashion.
4 1 ROQUE, Damien
5 4 ROQUE, Damien
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:
6 4 ROQUE, Damien
* a GNU/Linux operating system ;
7 4 ROQUE, Damien
* a user account with administror rights (through sudo) ;
8 4 ROQUE, Damien
* an Internet connection (if necessary, set @http_proxy@ and @https_proxy@ environment variables appropriately).
9 2 ROQUE, Damien
10 3 ROQUE, Damien
h2. Downloading and configuring PyBombs
11 3 ROQUE, Damien
12 3 ROQUE, Damien
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):
13 1 ROQUE, Damien
<pre>
14 2 ROQUE, Damien
git clone https://github.com/pybombs/pybombs.git
15 2 ROQUE, Damien
</pre>
16 2 ROQUE, Damien
17 3 ROQUE, Damien
Run first the configuration of PyBombs as unprivileged user.
18 2 ROQUE, Damien
<pre>
19 2 ROQUE, Damien
cd pybombs && ./pybombs config
20 2 ROQUE, Damien
</pre>
21 2 ROQUE, Damien
22 3 ROQUE, Damien
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).
23 2 ROQUE, Damien
<pre>
24 2 ROQUE, Damien
Username for GIT access
25 2 ROQUE, Damien
gituser [damien]:
26 2 ROQUE, Damien
Install Prefix
27 2 ROQUE, Damien
prefix [/home/damien/target]:/usr/local
28 2 ROQUE, Damien
Order in which to attempt installations when available, options are: src, rpm, deb
29 2 ROQUE, Damien
satisfy_order [deb,src]:
30 2 ROQUE, Damien
Comma separated list of package names to assume are already installed
31 2 ROQUE, Damien
forcepkgs []:
32 2 ROQUE, Damien
Comma separated list of package names to always build from source
33 2 ROQUE, Damien
forcebuild [gnuradio,uhd,gr-air-modes,gr-osmosdr,gr-iqbal,gr-fcdproplus,uhd,rtl-sdr,osmo-sdr,hackrf,gqrx,bladerf,airspy]:
34 2 ROQUE, Damien
Time the monitor thread waits (in seconds) before retrying downloads
35 2 ROQUE, Damien
timeout [30]:
36 2 ROQUE, Damien
CMAKE_BUILD_TYPE args to pass to cmake projects, options are: Debug, Release, RelWithDebInfo, MinSizeRel
37 2 ROQUE, Damien
cmakebuildtype [RelWithDebInfo]:
38 2 ROQUE, Damien
Build doxygen while compiling packages? options are: ON, OFF
39 2 ROQUE, Damien
builddocs [OFF]:
40 2 ROQUE, Damien
C Compiler Executable [gcc, clang, icc, etc]
41 2 ROQUE, Damien
cc [gcc]:
42 2 ROQUE, Damien
C++ Compiler Executable [g++, clang++, icpc, etc]
43 2 ROQUE, Damien
cxx [g++]:
44 2 ROQUE, Damien
Concurrent make threads [1,2,4,8...]
45 2 ROQUE, Damien
makewidth [4]:
46 2 ROQUE, Damien
done
47 2 ROQUE, Damien
Settled on prefix: /usr/local
48 1 ROQUE, Damien
49 2 ROQUE, Damien
[Errno 13] Permission denied: '/usr/local/lib64'
50 2 ROQUE, Damien
Error! Configured install prefix requires root privileges. Please re-run as sudo
51 2 ROQUE, Damien
</pre>
52 2 ROQUE, Damien
53 3 ROQUE, Damien
Rerun the configuration with @sudo@ and the intruction should end gracefully.
54 2 ROQUE, Damien
<pre>
55 2 ROQUE, Damien
sudo ./pybombs config
56 2 ROQUE, Damien
</pre>
57 2 ROQUE, Damien
58 3 ROQUE, Damien
Optionally, it is possible to define a maximum number a concurrent workers (it will be used by @make@).
59 2 ROQUE, Damien
<pre>
60 1 ROQUE, Damien
sudo ./pybombs config makewidth 2
61 1 ROQUE, Damien
</pre>
62 2 ROQUE, Damien
63 2 ROQUE, Damien
h2. Installing UHD and GNURadio from the sources
64 1 ROQUE, Damien
65 3 ROQUE, Damien
Run the installation of UHD and GNURadio with the following instruction (it might take one to several hours).
66 8 ROQUE, Damien
67 8 ROQUE, Damien
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
68 8 ROQUE, Damien
69 2 ROQUE, Damien
<pre>
70 3 ROQUE, Damien
sudo ./pybombs install uhd gnuradio
71 2 ROQUE, Damien
</pre>
72 5 ROQUE, Damien
73 5 ROQUE, Damien
The duration of the installation depends mainly of the following parameters:
74 5 ROQUE, Damien
* throughput of the Internet connection ;
75 5 ROQUE, Damien
* frequency and number of CPU cores ;
76 5 ROQUE, Damien
* number of prerequisite packages installed on your system.
77 6 ROQUE, Damien
78 7 ROQUE, Damien
h2. UHD configuration
79 1 ROQUE, Damien
80 7 ROQUE, Damien
h3. Update the firmware database
81 7 ROQUE, Damien
82 7 ROQUE, Damien
In order to make sure that the firmwares are up-to-date, you can run the following instruction.
83 7 ROQUE, Damien
<pre>
84 7 ROQUE, Damien
sudo "/usr/local/lib/uhd/utils/uhd_images_downloader.py"
85 7 ROQUE, Damien
</pre>
86 7 ROQUE, Damien
87 7 ROQUE, Damien
h3. Setting up real-time scheduling
88 7 ROQUE, Damien
89 7 ROQUE, Damien
Since the UHD needs a high priority of execution, it is recommended to add the following line to @/etc/security/limits.conf@.
90 6 ROQUE, Damien
<pre>
91 6 ROQUE, Damien
@usrp            -       rtprio          99
92 6 ROQUE, Damien
</pre>
93 6 ROQUE, Damien
94 6 ROQUE, Damien
Hence, it necessary to create the group @usrp@ and add to this group any user willing to use the USRP hardware.
95 6 ROQUE, Damien
<pre>
96 6 ROQUE, Damien
groupadd usrp
97 6 ROQUE, Damien
adduser <my-login> usrp
98 6 ROQUE, Damien
</pre>