How to build SoapySDR and CubicSDR from source in Ubuntu 20.04
After unsuccessful attempts to compile SoapySDR and CubicSDR on Mac OS and Windows, I was able to get it running in Ubuntu 20.04. The whole process took about 2 hours but could be done in less time if you know what you are doing.
It wasn’t really necessary to install CubicSDR to test SoapySDR. But CubicSDR is the only SoapySDR app that consistently works when it comes to devices, I/Q, files and TCP frequency control.
After completing this install I was also able to compile and run the SoapySDR example code here: https://github.com/pothosware/SoapySDR/wiki/Cpp_API_Example
Build
There are excellent instructions at the CubicSDR wiki on github: https://github.com/cjcliffe/CubicSDR/wiki/Build-Linux
I also added the rtlsdr driver and the airspyhf driver. Instructions for rtlsdr are on the wiki. Instructions for airspyhf are below. You can add these drivers/libraries at any time, after SoapySDR is installed.
There were several missing libraries – described here.
hamlib
Hamlib is an option in CubicSDR. It was included because we’re using it to send frequency data to the devices via rigctld. You’ll need to install hamlib before you try to compile CubicSDR
Instructions and source code here: https://github.com/Hamlib/Hamlib
Instructions are somewhat vague. Here’s what I did.
Install libtool:
sudo apt install libtool
Clone the repository, build, and install:
git clone https://github.com/Hamlib/Hamlib.git cd Hamlib ./bootstrap ./configure make sudo make install
airspyhf
airspyhf library code from Airspy. Instructions here: https://github.com/airspy/airspyhf
This is what I did, if I can remember correctly. You may need to install libusb, but if you have done all the stuff above you probably already have it.
git clone https://github.com/airspy/airspyhf cd airspyhf mkdir build cd build cmake ../ -DINSTALL_UDEV_RULES=ON< make sudo make install sudo ldconfig
SoapyAirspyHF
Now you can add the Soapy AirspyHF drivers. Instructions here: https://github.com/pothosware/SoapyAirspyHF/wiki
git clone https://github.com/pothosware/SoapyAirspyHF.git cd SoapyAirspyHF mkdir build cd build cmake .. make sudo make install