# Software Setup

In most instances, there are two pieces of software that you will be needing: UHD and GNU Radio. Most package managers have a version of libUHD that is compiled by Ettus for their radio products. At Per Vices, we maintain our own fork of libUHD. This allows for easy interfacing with software devices, and provides some compatibility with USRP devices. For more on these differences, check out our application note on use and operations. While you are unlikely to notice these differences when using the software, you will have to take some care to make sure that the correct (Per vices) version of UHD is what gets installed.

In most instances, there are two pieces of software that you will be needing: libUHD and GNU Radio. Most package managers have a version of libUHD that is compiled by Ettus for their radio products. At Per Vices, we maintain our own fork of UHD that looks and operates similarly with one main exception: it supports the Crimson TNG and Cyan radios that we manufacture. While you likely won’t notice the differences when using the software, you will have to take some care to make sure the correct (Per vices) version is what gets installed.

At run-time, GNU Radio compares the version of the UHD library used during compilation with the presently installed version. If there is a difference, it generates an error message. This is most often caused when using a distribution provided version of GNU Radio that has been compiled with the Ettus UHD version. Ensuring that you have correctly installed the Per Vices UHD version, and then recompiling gnuradio ensures consistency in the library versions and fixes any errors.

##### Figure 8: Overview of libUHD installation process

If you already have GNU Radio installed on your host computer, you need to first uninstall it (also uninstall the Ettus libUHD library, if applicable). Next, ensure the Per Vices libUHD version is correctly installed and reboot the computer. Finally, compile and install GNU Radio from source.

We use archlinux internally for development and testing. Installing uhd and GNU Radio on other distributions may be slightly more challenging.

Note

## 1. Installing from Binaries

Note

When installing from source, the packaged binaries for each distribution are created using the dockerfiles specified in the pvpkg repository.

Note

Ensure you do not have any other versions of UHD or GNU Radio installed! Remove all versions of UHD or GNU Radio if you are doing a fresh install.

### 1.1. Archlinux Binaries

To install Per Vices UHD and GNU Radio on Archlinux, follow these instructions:

UHD

2. Prior to installing pre-compiled binaries, make sure you do not have any of the latest versions of Boost installed, and then run the following commands:

$yay -Sy --noconfirm icu63 && \$ sudo pacman -U --noconfirm boost-libs-1.69.0-1-x86_64.pkg.tar.xz && \
$sudo pacman -U --noconfirm boost-1.69.0-1-x86_64.pkg.tar.xz && \$ sudo pacman -U --noconfirm qwt-6.1.6-1-x86_64.pkg.tar.zst
Note: the dependencies are also available within the pvpkg repo here.

3. Then use the pacman command to install .tar GNU Radio and then UHD files from step 2 (first install UHD then GNU Radio).

### 1.2. Ubuntu 20.04 Binaries

To install Per Vices UHD and GNU Radio on Ubuntu 20.04, follow these instructions:

UHD

2. Install UHD using dpkg:

$dpkg -i uhd*.deb 3. The above command will most likely fail with missing dependencies, but the install will work by subsequently running the following command to retrieve these: $ apt --fix-broken install
4. Install GNU Radio using dpkg:

$dpkg -i libgnuradio*.deb$ dpkg -i gnuradio*.deb
5. The above command will most likely fail with missing dependencies, but the install will work by subsequently running the following command to retreive these:

$apt --fix-broken install ### 1.3. Ubuntu 18 Binaries TBD ### 1.4. Centos Binaries To install Per Vices UHD and GNU Radio on CentOS 8, follow these instructions: 1. Get the latest version of Per Vices UHD and GNU Radio and decompress the archives: GNU Radio UHD 2. To install UHD, run the following command in the directory with the UHD RPM files (package): $ rpm -i uhd*.rpm
3. To install GNU Radio, run the following commands in the directory with the GNU Radio RPM files (package):

$rpm -i volk*.rpm && rpm -i libgnuradio*.rpm && rpm -i python3*.rpm && rpm -i gnuradio*.rpm ## 2. Compiling from Source (Using a Package Manager) We automatically compile the UHD and GNU Radio binaries used with our product using dockerfiles found in the pvpkg repo, for specific distributions, including ArchLinux, Ubuntu, and Centos. We encourage you to clone this repo, as it includes a number of patches and dependencies required to make the installation easier, and it also allows you to use your package manager for installation. You can clone the repo as follows; $ git clone https://github.com/pervices/pvpkg
To build the package, we use a Jenkinsfile. Instructions on how to install Jenkins is found in the README.md file within the above repo. You may also create the required binaries yourself, using the dockerfiles associated with each distribution.

### 2.1. Archlinux

To compile the current UHD binaries from source, you can use the dockerfile to help determine the required dependencies necessary to compile UHD and Gnuradio from your own distribution. This dockerfile assumes a clean installation of archlinux, and presents you with a guide on how to install it.

We suggest cloning the pvpkg repo, and then entering the arch subdirectory. This includes the required dependencies, along with a dockerfile that may be used to help guide installation.

In particular, you’ll first need to install the required dependencies for archlinux. You can find these dependencies in the archlinux dockerfile, which specifies all the steps we use to automatically build the archlinux binaries we post.

From there, you can use the archlinux UHD PKGBUILD script, also included in the pvpkg repo, to download the latest UHD library from github, and install all the required dependencies.

### 2.2 Ubuntu

We suggest first cloning the pvpkg repo:

$git clone https://github.com/pervices/pvpkg Then, you can use the dockerfile for ubuntu20.04 as a guide, as shown here. When following the dockerfile, note that we require a libboost dependency of 1.67. If you’ve update your boost library, you will need to uninstall the older versions of boost, and install the 1.67 version. This may be a bit tricky, but running apt-get remove, along with apt-get autoremove, will help. This is especially true if you’re not able to successfully run the mk-build-deps command. In this case, running the following may help; apt-get install libboost1.67-all-dev You may need to manually install the unmet dependencies if this is the case. Otherwise, you can follow the dockerfile commands, substituting the notroot directory for your own home directory. ## 3.1. Compiling from Source Manually Provided you’re prepared to resolve your own dependencies, you can easily compile UHD and Gnuradio from source. The specific commands and flags used to compile the sources, are most easily found within the Archlinux PKGBUILD associated with each application. ### 3.2. Manual Compilation Tips If you are committed to using another operating system, then you will want to build GNU Radio and UHD from source. However, your package manager can be useful for obtaining the necessary dependencies. We suggest installing all GNU Radio and UHD dependencies using your distribution package management system, and then actually installing GNU Radio and UHD from source. 1. Install all GNU Radio and UHD dependencies, but do NOT actually install GNU Radio or UHD. • You need to ensure that you have all the required install dependencies. • Though you will try to avoid installing GNU Radio or UHD 2. After installing the required dependencies, confirm that you do NOT have any of the following installed; • gnuradio • libgnuradio • libvolk • libuhd • uhd-host 3. If you have previously attempted to install GNU Radio or UHD from source, confirm that you do not have any residual files. • Ideally, if you still have the original source directory, you can run ?make uninstall? as root, to delete all the installed files. • The default installation settings see gnuradio installed in /usr/local/{bin,lib…}. Check each of the subdirectories in /usr/src to see whether you have old installation files. The presence of these files WILL cause problems down the road; either move them somewhere else, or delete them. 4. Download the Per Vices UHD driver sources code, and compile and install it. • For compatability, you may want to use the -DCMAKE_INSTALL_PREFIX=/usr cmake flag to install binaries to /usr (this is consistent with most linux distributions). • In order to successfully install the remaining components, you will need to have successfully installed the Per Vices UHD driver. • We recommend confirming that you have installed the correct uhd version, by typing; uhd_find_devices -v and confirming that the version number matches what you expect. 5. Download the gnuradio source code, compile and install it. • The gnuradio application needs to use the systems python interpreter and some accompanying python libraries to run. To ensure that our system can locate these tools, we will need to ensure that the PYTHONPATH and LD_LIBRARY_PATH are properly set. • You can verify that the LD_LIBRARY_PATH is set correctly using sudo ldconfig echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/user/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=/user/local/lib:\$LD_LIBRARY_PATH' >> ~/.profile

## 4. After installation

Confirm your installation by testing successful set up and operation.