Skip to content

Build from source

adswill edited this page Oct 16, 2026 · 1 revision

You need a C++20 compiler, CMake 3.20 or newer, pkg-config, FFmpeg, libhackrf and GLFW. SoapySDR and Hamlib are optional.

macOS and Linux

# macOS
brew install cmake pkg-config hackrf soapysdr libusb ffmpeg glfw
# Debian / Ubuntu
sudo apt install build-essential cmake pkg-config libhackrf-dev libsoapysdr-dev libusb-1.0-0-dev \
  libglfw3-dev libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libswresample-dev

git clone https://github.com/adswill/OnAir.git && cd OnAir
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DDECT2_BUILD_APP=ON
cmake --build build -j "$(getconf _NPROCESSORS_ONLN)"   # one job per core
ctest --test-dir build

A bare -j starts hundreds of jobs and can run out of memory. The app is build/dect2. Without a radio you can open an IQ recording through the IQ recording file source, or use the command line: build/dect2cli --file capture.cs8 --rate 10 --format cs8 --play <service id>. See Command line.

Windows (MSYS2)

  1. Install MSYS2 with its default settings.
  2. Open MSYS2 UCRT64 from the Start menu (not MINGW64: it has no HackRF and SoapySDR packages).
  3. Update with pacman -Syu (run it again if the window closes).
  4. Install the tools: pacman -S --needed git zip mingw-w64-ucrt-x86_64-{gcc,cmake,ninja,pkgconf,ffmpeg,glfw,hackrf,soapysdr,libiconv} (optional mingw-w64-ucrt-x86_64-nsis for the setup .exe).
  5. git clone https://github.com/adswill/OnAir.git, then cd OnAir.
  6. cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DDECT2_BUILD_APP=ON and cmake --build build.
  7. Run ./build/dect2.exe from the same shell so Windows finds the DLLs; ctest --test-dir build runs the tests.
  8. For a folder that runs on any PC, run tools/package/make_windows.sh (a portable zip in build-windows/, and a setup .exe if NSIS is installed).

Install the WinUSB driver with Zadig to use a radio. From macOS or Linux, tools/package/make_windows_cross.sh builds the Windows package with a cross-compiler.

Tuning for your own CPU

The release programs are built for the baseline 64-bit PC and pick AVX2 at run time. A binary you build yourself can be lighter:

  • -DDECT2_WIN_AVX2=ON (x86-64 on Windows and Intel Macs): build everything for AVX2 + FMA; refuses to start on older CPUs.
  • -DCMAKE_CXX_FLAGS="-march=native" (GCC or Clang): the standard variable; the result runs only on CPUs like yours.
  • -DDECT2_PORTABLE=ON (macOS, plain C++ instead of Accelerate) and -DDECT2_NO_SIMD=ON: for unusual CPUs, slower.

Other options in CMakeLists.txt: DECT2_UI_BACKEND (Metal or OpenGL3), DECT2_WITH_SOAPY, DECT2_HAVE_HAMLIB (default on) and DECT2_BUNDLE_CODEC2. Configure with a clean build folder after changing them.

Packaging

  • macOS: tools/package/make_dmg.sh (targets macOS 15.0 by default; set MACOSX_DEPLOYMENT_TARGET to override).
  • Windows: tools/package/make_windows.sh.

Where to go next

Contributing and code map.

Clone this wiki locally