-
Notifications
You must be signed in to change notification settings - Fork 578
Compile from source in Linux
Compiling from source can be done by building a Docker image with the SDRangel in Docker project more specifically the SDRangel section. Note that you may also execute the instructions in the Dockerfile manually although building with Docker will do the same automatically.
If you choose to compile from source it is assumed that the machine on which you compile is also the machine on which you run SDRangel.
Compiling from source is assumed to be done in a Linux system with an Ubuntu 24.04 distribution (thus Qt 5.15).
The minimal standard required for the C++ compiler is c++17
Be aware that it will try to apply the highest SIMD capabilities available on your CPU i.e. AVX2 > AVX > SSE4 ... So for best results make sure you run the program on the computer on which you compile or you are using the compiled binaries on a computer with similar SIMD capabilities (check the CPU flags with cat /proc/cpuinfo). The typical issue encountered when running hardware is not compatible is a SIGILL exception with a message like Program received signal SIGILL, Illegal instruction.
It assumes /opt/build is the base for the sources used to build and /opt/install is the base for the installation directories. It is assumed these directories are owned by your user. Hence assuming the user is $USER in group users you would do the following to create them (once):
sudo mkdir -p /opt/build
sudo chown $USER:users /opt/build
sudo mkdir -p /opt/install
sudo chown $USER:users /opt/install
You may change these locations at your will like using your home directory for the sources but it is strongly advised not to use the system directories for installation (/usr, /usr/local) and thus never have to do sudo make install. This is a bad idea as a principle for application software.
As a general prerequisite you should have the following packages installed:
sudo apt-get update && sudo apt-get -y install \
git cmake g++ pkg-config autoconf automake libtool libfftw3-dev libusb-1.0-0-dev libusb-dev libhidapi-dev libopengl-dev \
libfaad-dev libflac-dev zlib1g-dev libboost-all-dev libasound2-dev pulseaudio libopencv-dev libxml2-dev bison flex \
ffmpeg libavcodec-dev libavformat-dev libopus-dev doxygen graphviz libunwind-devAnd either Qt5:
sudo apt-get update && sudo apt-get -y install \
qtbase5-dev qtchooser libqt5multimedia5-plugins qtmultimedia5-dev libqt5websockets5-dev \
qttools5-dev qttools5-dev-tools libqt5opengl5-dev libqt5quick5 libqt5location5-plugins libqt5charts5-dev \
qml-module-qtlocation qml-module-qtpositioning qml-module-qtquick-window2 \
qml-module-qtquick-dialogs qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-layouts \
libqt5serialport5-dev qtdeclarative5-dev qtpositioning5-dev qtlocation5-dev libqt5texttospeech5-dev \
qtwebengine5-dev qtbase5-private-dev libqt5gamepad5-dev libqt5svg5-devOr Qt6:
sudo apt-get update && sudo apt-get -y install \
qt6-base-dev qt6-base-private-dev qt6-scxml-dev \
qt6-multimedia-dev qt6-positioning-dev qt6-location-dev qt6-websockets-dev qt6-webengine-dev \
qt6-serialport-dev qt6-speech-dev qt6-charts-dev qt6-svg-dev qt6-declarative-dev \
qtchooser qt6-tools-dev qt6-tools-dev-tools libqt6quick6 qt6-location-plugins \
qml-module-qtlocation qml-module-qtpositioning qml-module-qtquick-window2 \
qml-module-qtquick-dialogs qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-layoutsThese are dependencies, and are required to build SDRangel properly with all its plugins. Since not all of these are distributed in upstream packages (or don't have the tested version upstream), it is required that these are also build from source.
Required for decoding images transmitted by NOAA weather satellites.
# Optionally: sudo apt-get install libsndfile-dev
cd /opt/build
git clone https://github.com/srcejon/aptdec.git
cd aptdec
git checkout libaptdec
git submodule update --init --recursive
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/aptdec ..
make -j $(nproc) install
cd /opt/build
git clone https://github.com/f4exb/cm256cc.git
cd cm256cc
git reset --hard "v1.1.2"
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/cm256cc ..
make -j $(nproc) install
Required for Digital Audio Broadcasting (DAB), a digital radio standard for broadcasting digital audio radio services in many countries around the world.
cd /opt/build
git clone https://github.com/srcejon/dab-cmdline
cd dab-cmdline/library
git checkout msvc
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/libdab ..
make -j $(nproc) install
Requried to decode Project 25 Land mobile radio system (LMR) systems.
cd /opt/build
git clone https://github.com/srcejon/mbelib.git
cd mbelib
git reset --hard 0cf0604433d1409576073d0656926a13287d0de5
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/mbelib ..
make -j $(nproc) install
cd /opt/build
git clone https://github.com/f4exb/serialDV.git
cd serialDV
git reset --hard "v1.1.5"
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/serialdv ..
make -j $(nproc) install
cd /opt/build
git clone https://github.com/f4exb/dsdcc.git
cd dsdcc
git reset --hard "v1.9.6"
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/dsdcc -DUSE_MBELIB=ON -DLIBMBE_INCLUDE_DIR=/opt/install/mbelib/include -DLIBMBE_LIBRARY=/opt/install/mbelib/lib/libmbe.so -DLIBSERIALDV_INCLUDE_DIR=/opt/install/serialdv/include/serialdv -DLIBSERIALDV_LIBRARY=/opt/install/serialdv/lib/libserialdv.so ..
make -j $(nproc) install
Required for decoding Codec 2, an open source low bit rate speech codec.
sudo apt-get -y install libspeexdsp-dev libsamplerate0-dev
cd /opt/build
git clone https://github.com/drowe67/codec2-dev.git codec2
cd codec2
git reset --hard "v1.1.1"
mkdir build_linux; cd build_linux
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/codec2 ..
make -j $(nproc) install
Required for satellite tracking, used for calculating orbital state vectors of satellites.
cd /opt/build
git clone https://github.com/dnwrnr/sgp4.git
cd sgp4
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/sgp4 ..
make -j $(nproc) install
Also required for tracking and interacting with NASA "SPICE" (Spacecraft, Planet, Instrument, C-matrix, Events) data, observation geometry information system to assist scientists in planning and interpreting scientific observations from space-based instruments aboard robotic planetary spacecraft.
cd /opt/build
git clone https://github.com/srcejon/cspice-cmake.git
cd cspice-cmake
git switch msvc
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/cspice -DCSPICE_BUILD_STATIC_LIBRARY=OFF ..
make -j $(nproc) install
Needed to interact with SigMF data. SigMF specifies a way to describe sets of recorded digital signal samples with metadata. SigMF can be used to describe general information about a collection of samples, the characteristics of the system that generated the samples, features of signals themselves, and the relationship between different recordings.
cd /opt/build
git clone https://github.com/f4exb/libsigmf.git
cd libsigmf
git checkout "new-namespaces"
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/libsigmf ..
make -j $(nproc) install
Required to interact with Morse code data.
cd /opt/build
git clone https://github.com/ggerganov/ggmorse.git
cd ggmorse
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/ggmorse -DGGMORSE_BUILD_TESTS=OFF -DGGMORSE_BUILD_EXAMPLES=OFF ..
make -j $(nproc) install
RNNoise is a noise suppression library based on a recurrent neural network.
cd /opt/build
git clone https://github.com/f4exb/rnnoise
cd rnnoise
mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/install/rnnoise -DRNN_ENABLE_X86_RTCD=ON ..
make -j $(nproc) install
Required to interact with Inmarsat C systems, a two-way, data-only satellite communication system that operates globally. It is a cornerstone of maritime safety, universally approved for the Global Maritime Distress and Safety System (GMDSS) to transmit critical distress alerts, emails, and safety broadcasts.
cd /opt/build
git clone https://github.com/srcejon/inmarsatc.git
cd inmarsatc
git switch msvc
mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/install/inmarsatc ..
make -j $(nproc) install
You can choose to compile only the plugins corresponding to your hardware. In the final step to build SDRangel specify only the directories that correspond to your hardware.
For those installations instructions that include something similar to: -DINSTALL_UDEV_RULE=OFF this will not install the udev rules (since you aren't running as root), but this may cause the hardware not to function if this is the first time you are installing that specific library. You can find how to install the udev rules in the Quick start
Specific versions of packages listed are the ones developers have tested, and are known to work. If you use more up to date versions you are basically on your own.
Airspy is a line of Popular Software-Defined Radio (SDR) receivers developed to achieve High Performance and Affordability.
cd /opt/build
git clone https://github.com/airspy/airspyone_host.git libairspy
cd libairspy
git reset --hard c6721000f19601512e9ba6b0340e5d9ced22a900
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/libairspy ..
make -j $(nproc) install
HydraSDR RFOne is an advanced Software Defined Radio receiver.
cd /opt/build
git clone https://github.com/hydrasdr/hydrasdr-host.git
cd hydrasdr-host
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/libhydrasdr -DINSTALL_UDEV_RULES=OFF ..
make -j $(nproc) install
The RSP1 is a powerful wideband full featured SDR.
cd /opt/build
git clone https://github.com/f4exb/libmirisdr-4.git
cd libmirisdr-4
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/libmirisdr ..
make -j $(nproc) install
Either download the API from: SDRplay or run:
cd /opt/build
git clone https://github.com/srcejon/sdrplayapi.git
cd sdrplayapi
sudo ./install_lib.sh
RTL-SDR is a low cost USB dongle that can be used as a computer based radio scanner for receiving live radio signals in your area.
cd /opt/build
git clone https://github.com/osmocom/rtl-sdr.git librtlsdr
cd librtlsdr
git reset --hard 420086af84d7eaaf98ff948cd11fea2cae71734a
mkdir build; cd build
cmake -Wno-dev -DDETACH_KERNEL_DRIVER=ON -DCMAKE_INSTALL_PREFIX=/opt/install/librtlsdr ..
make -j $(nproc) install
The easy to use ADALM-PLUTO active learning module (PlutoSDR) helps introduce electrical engineering students to the fundamentals of software-defined radio (SDR), radio frequency (RF), and wireless communications.
cd /opt/build
git clone https://github.com/analogdevicesinc/libiio.git
cd libiio
git reset --hard v0.26
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/libiio -DINSTALL_UDEV_RULE=OFF -DWITH_AIO=OFF -DHAVE_DNS_SD=OFF ..
make -j $(nproc) install
You will need firmware 0.29 or above.
bladeRF is a Software Defined Radio (SDR) platform designed to enable a community of hobbyists, and professionals to explore and experiment with the multidisciplinary facets of RF communication.
cd /opt/build
git clone https://github.com/Nuand/bladeRF.git
cd bladeRF/host
git reset --hard "2024.05"
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/libbladeRF -DINSTALL_UDEV_RULES=OFF ..
make -j $(nproc) install
HackRF is open source hardware for software-defined radio.
cd /opt/build
git clone https://github.com/greatscottgadgets/hackrf.git
cd hackrf/host
git reset --hard "adc537331c5bc3165f47648043c570063518ef79"
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/libhackrf -DINSTALL_UDEV_RULES=OFF ..
make -j $(nproc) install
LimeSDR is a low cost, open source, software defined radio (SDR) platform that can be used to support just about any type of wireless communication standard.
cd /opt/build
git clone https://github.com/myriadrf/LimeSuite.git
cd LimeSuite
git reset --hard 524cd2e548b11084e6f739b2dfe0f958c2e30354
mkdir builddir; cd builddir
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/LimeSuite ..
make -j $(nproc) install
Airspy HF is a paradigm shift in HF radio design.
cd /opt/build
git clone https://github.com/airspy/airspyhf
cd airspyhf
git reset --hard 87cf12a30f3a0f10f313aab8e54999ca69b753af
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/libairspyhf ..
make -j $(nproc) install
Perseus is a VLF-LF-MF-HF receiver based on an exceptional direct sampling digital architecture.
cd /opt/build
git clone https://github.com/f4exb/libperseus-sdr.git
cd libperseus-sdr
git checkout fixes
git reset --hard afefa23e3140ac79d845acb68cf0beeb86d09028
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/libperseus ..
make -j $(nproc)
make install
USRP (Universal Software Radio Peripheral) is a line of software-defined radios (SDRs) created by Ettus Research (a National Instruments company) (a Emerson company).
Warning: this is quite heavy. Compile it only if you plan to use a USRP (UHD) device.
Prerequisites:
sudo apt install libboost-all-dev libusb-1.0-0-dev python3-mako doxygen python3-docutils cmake build-essential
cd /opt/build
git clone https://github.com/EttusResearch/uhd.git
cd uhd
git reset --hard v4.9.0.1
cd host
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/install/uhd ..
make -j $(nproc)
make install
/opt/install/uhd/lib/uhd/utils/uhd_images_downloader.py
# The following aren't required if installed to /
echo /opt/install/uhd/lib | sudo dd of=/etc/ld.so.conf.d/uhd.conf
sudo ldconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/install/uhd/lib/pkgconfig
# Enable USB access from user accounts
cd /opt/install/uhd/lib/uhd/utils
sudo cp uhd-usrp.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
XTRX is the smallest, easily embeddable software-defined radio (SDR). It is both affordable and high-performance.
Warning: XTRX is not supported on Raspberry Pi
Prerequisites:
sudo apt-get -y install build-essential libusb-1.0-0-dev cmake dkms python3-cheetah libqcustomplot-dev
Prerequisites 18.04:
sudo apt-get -y install build-essential libusb-1.0-0-dev cmake dkms python3 python3-pip
sudo pip3 install Cheetah3
cd /opt/build
git clone https://github.com/f4exb/images.git xtrx-images
cd xtrx-images
git submodule init
git submodule update
cd sources
mkdir build; cd build
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/xtrx-images -DENABLE_SOAPY=NO ..
make -j $(nproc)
make install
To use XTRX because libxtrx has dependent sub-libraries before starting SDRangel you need to add the library path to LD_LIBRAY_PATH with export LD_LIBRARY_PATH=/opt/install/xtrx-images/lib:$LD_LIBARY_PATH. If you start SDRangel in a shell script you have to add the export before invoking SDRangel.
SoapySDR is a bit special since it is an interface with the libraries that interface the hardware so there is a kind of double indirection. We will detail an installation that is done completely outside the standard paths as it has been done until now. Thus we will refrain from the easy but risky sudo make install.
First let's compile the main SoapySDR stuff:
cd /opt/build
git clone https://github.com/pothosware/SoapySDR.git
cd SoapySDR
git reset --hard 1667b4e6301d7ad47b340dcdcd6e9969bf57d843
mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/install/SoapySDR ..
make -j $(nproc) install
So far so good but we will need the support libraries that are the pieces (plugins) that make the link between SoapySDR and the libraries that drive the hardware. They have to be compiled one by one separately as you need them. Let's take a simple example for RTL-SDR assuming that librtlsdr has been compiled and installed as described earlier in /opt/install/librtlsdr:
cd /opt/build
git clone https://github.com/pothosware/SoapyRTLSDR.git
cd SoapyRTLSDR
mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/install/SoapySDR -DRTLSDR_INCLUDE_DIR=/opt/install/librtlsdr/include -DRTLSDR_LIBRARY=/opt/install/librtlsdr/lib/librtlsdr.so -DSOAPY_SDR_INCLUDE_DIR=/opt/install/SoapySDR/include -DSOAPY_SDR_LIBRARY=/opt/install/SoapySDR/lib/libSoapySDR.so ..
make -j $(nproc) install
The support libraries are installed in /opt/install/SoapySDR/lib/SoapySDR/modules0.8 (for the 0.8 version).
cd /opt/build
git clone https://github.com/pothosware/SoapyHackRF.git
cd SoapyHackRF
mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/install/SoapySDR -DLIBHACKRF_INCLUDE_DIR=/opt/install/libhackrf/include/libhackrf -DLIBHACKRF_LIBRARY=/opt/install/libhackrf/lib/libhackrf.so -DSOAPY_SDR_INCLUDE_DIR=/opt/install/SoapySDR/include -DSOAPY_SDR_LIBRARY=/opt/install/SoapySDR/lib/libSoapySDR.so ..
make -j $(nproc) install
Assuming you already have cloned LimeSuite and build it in the corresponding previous step.
cd /opt/build
cd LimeSuite/builddir
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/install/LimeSuite -DCMAKE_PREFIX_PATH=/opt/install/SoapySDR ..
make -j $(nproc) install
cp /opt/install/LimeSuite/lib/SoapySDR/modules0.7/libLMS7Support.so /opt/install/SoapySDR/lib/SoapySDR/modules0.7
sudo apt-get -y install libavahi-client-dev
cd /opt/build
git clone https://github.com/pothosware/SoapyRemote.git
cd SoapyRemote
git reset --hard "soapy-remote-0.5.1"
mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/install/SoapySDR -DSOAPY_SDR_INCLUDE_DIR=/opt/install/SoapySDR/include -DSOAPY_SDR_LIBRARY=/opt/install/SoapySDR/lib/libSoapySDR.so ..
make -j $(nproc) install
Additional cmake options:
-
-DBUILD_SERVER=OFFto compile the GUI variant only -
-DBUILD_GUI=OFFto compile the server variant only -
-DENABLE_QT6=ONto compile for Qt6 -
-DRX_SAMPLE_24BIT=OFFto compile using 16-bit samples, rather than 24-bit.
Commands are:
cd /opt/build
git clone https://github.com/f4exb/sdrangel.git
cd sdrangel
mkdir build; cd build
cmake -Wno-dev -DDEBUG_OUTPUT=ON -DRX_SAMPLE_24BIT=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DMIRISDR_DIR=/opt/install/libmirisdr \
-DAIRSPY_DIR=/opt/install/libairspy \
-DAIRSPYHF_DIR=/opt/install/libairspyhf \
-DBLADERF_DIR=/opt/install/libbladeRF \
-DHACKRF_DIR=/opt/install/libhackrf \
-DRTLSDR_DIR=/opt/install/librtlsdr \
-DLIMESUITE_DIR=/opt/install/LimeSuite \
-DIIO_DIR=/opt/install/libiio \
-DPERSEUS_DIR=/opt/install/libperseus \
-DXTRX_DIR=/opt/install/xtrx-images \
-DSOAPYSDR_DIR=/opt/install/SoapySDR \
-DUHD_DIR=/opt/install/uhd \
-DAPT_DIR=/opt/install/aptdec \
-DCM256CC_DIR=/opt/install/cm256cc \
-DDSDCC_DIR=/opt/install/dsdcc \
-DSERIALDV_DIR=/opt/install/serialdv \
-DMBE_DIR=/opt/install/mbelib \
-DCODEC2_DIR=/opt/install/codec2 \
-DSGP4_DIR=/opt/install/sgp4 \
-DCSPICE_DIR=/opt/install/cspice \
-DLIBSIGMF_DIR=/opt/install/libsigmf \
-DDAB_DIR=/opt/install/libdab \
-DGGMORSE_DIR=/opt/install/ggmorse \
-DRNNOISE_DIR=/opt/install/rnnoise \
-DINMARSATC_DIR=/opt/install/inmarsatc \
-DCMAKE_INSTALL_PREFIX=/opt/install/sdrangel ..
make -j $(nproc) install
There is always a balance between spending time working on developer documentation and a focus on getting functional software. SDRAngel developers (like most developers) give working software a higher priority than comprehensive documentation. End user documentation is found on this wiki. Developer documentation is created on your machine. To do this, ensure that these additional packages are installed before the additional cmake step above.
sudo apt-get update && sudo apt-get -y install doxygen graphviz then during the cmake, you should see an additional message:
-- added optional 'make dev_docs' for developer documentation generationnow you have an additional make target, make dev_docs; which will take 5-10 minutes and build up developer docs; to allow you better understand the SDRangel codebase. From here you can examine classes, files, and source.
For those interested in adding new devices, start with (search for):
-
DeviceSampleSink&DeviceSampleSourceclasses
For those interested in adding new modulators or demodulators, start with (search for):
-
BasebandSampleSinkandBasebandSampleSourceclasses
For those interested in helping with additional documentation, check out the dox.warn file in the build directory for various symbols, parameters and arguments, which need documentation. This would be a good way for anyone to get familiar with the code base before actually contributing code changes.
These docs will end up in your build directory, and can be viewed with your favorite browser:
firefox ./dev_docs/index.htmlFor the GUI variant in a terminal do /opt/install/sdrangel/bin/sdrangel
For the server variant the best is to use Docker particularly in the armv8 architecture. It is also possible to use supervisor see the Wiki pages "SDRangel server with supervisor...".
- Home
- Quick start
- Hardware requirements
- High DPI displays
- Compile in Linux
- Compile in Windows
- Compile in MacOS
- History and major releases
- Audio related
- Plugins
- Advanced
- Server and API