Skip to content

Development Setup

Lunae Mons Research edited this page Sep 1, 2025 · 1 revision

Development Setup

This guide helps you set up a development environment for SDR++CE on different platforms.

Prerequisites

All Platforms

  • C++ Compiler with C++17 support
  • CMake 3.13 or later
  • Git for version control
  • vcpkg (Windows) or system package manager

Platform-Specific Requirements

Windows

  • Visual Studio 2019/2022 or MinGW-w64
  • vcpkg for dependency management
  • Windows SDK (latest)

Linux

  • GCC 8+ or Clang 10+
  • Development packages for dependencies
  • pkg-config

macOS

  • Xcode or Command Line Tools
  • Homebrew for dependencies
  • macOS 10.15+ target

Quick Setup Scripts

Linux (Ubuntu/Debian)

# Install dependencies
sudo apt update
sudo apt install build-essential cmake git pkg-config \
                 libfftw3-dev libglfw3-dev libvolk-dev \
                 portaudio19-dev librtaudio-dev libzstd-dev

# Clone repository
git clone https://github.com/LunaeMons/SDRPlusPlus_CommunityEdition.git
cd SDRPlusPlus_CommunityEdition

# Build
mkdir build && cd build
cmake ..
make -j$(nproc)

macOS (Homebrew)

# Install dependencies
brew install cmake fftw glfw volk portaudio rtaudio zstd codec2

# Clone repository  
git clone https://github.com/LunaeMons/SDRPlusPlus_CommunityEdition.git
cd SDRPlusPlus_CommunityEdition

# Build
mkdir build && cd build
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 ..
make -j$(sysctl -n hw.ncpu)

# Create app bundle
../make_macos_bundle.sh . ../SDR++CE.app

Windows (vcpkg)

REM Install vcpkg
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install

REM Install dependencies
.\vcpkg install fftw3:x64-windows glfw3:x64-windows volk:x64-windows
.\vcpkg install portaudio:x64-windows rtaudio:x64-windows zstd:x64-windows

REM Clone and build SDR++CE
git clone https://github.com/LunaeMons/SDRPlusPlus_CommunityEdition.git
cd SDRPlusPlus_CommunityEdition
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build . --config Release

Build Configuration Options

Core Options

cmake .. \
  -DCMAKE_BUILD_TYPE=Release \          # Release/Debug/RelWithDebInfo
  -DOPT_BUILD_BLADERF_SOURCE=ON \       # BladeRF support
  -DOPT_BUILD_LIMESDR_SOURCE=ON \       # LimeSDR support
  -DOPT_BUILD_HACKRF_SOURCE=ON \        # HackRF support
  -DOPT_BUILD_RTL_TCP_SOURCE=ON \       # RTL-TCP support
  -DOPT_BUILD_SPYSERVER_SOURCE=ON       # SpyServer support

Platform-Specific Options

# macOS
cmake .. \
  -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
  -DUSE_BUNDLE_DEFAULTS=ON              # App bundle behavior

# Windows  
cmake .. \
  -DCMAKE_TOOLCHAIN_FILE=vcpkg.cmake \
  -DOPT_BUILD_MSVC_DLL=ON               # MSVC runtime linking

# Linux
cmake .. \
  -DCMAKE_INSTALL_PREFIX=/usr \
  -DOPT_BUILD_DEBIAN_PACKAGE=ON         # Debian package support

Module Development Setup

Additional Dependencies for Module Development

SDR Hardware Libraries

# Linux
sudo apt install librtlsdr-dev libhackrf-dev liblimesuite-dev

# macOS  
brew install librtlsdr hackrf limesuite

# Windows (vcpkg)
vcpkg install librtlsdr:x64-windows hackrf:x64-windows limesuite:x64-windows

Digital Signal Processing

# Linux
sudo apt install libliquid-dev libcodec2-dev

# macOS
brew install liquid-dsp codec2

# Windows (vcpkg)  
vcpkg install liquid-dsp:x64-windows codec2:x64-windows

Module Development Template

Create a development workspace:

mkdir sdrpp-modules && cd sdrpp-modules

# Create module template
mkdir my_module && cd my_module

Use this CMakeLists.txt template:

cmake_minimum_required(VERSION 3.13)
project(my_module)

# Find SDR++CE installation
find_path(SDRPP_INCLUDE_DIR 
    NAMES module.h
    PATHS /usr/include/sdrpp
          /usr/local/include/sdrpp
          ${CMAKE_SOURCE_DIR}/../core/src)

if(NOT SDRPP_INCLUDE_DIR)
    message(FATAL_ERROR "SDR++CE headers not found")
endif()

# Module source
add_library(my_module SHARED src/main.cpp)
target_include_directories(my_module PRIVATE ${SDRPP_INCLUDE_DIR})

# Install  
install(TARGETS my_module DESTINATION lib/sdrpp/plugins)

IDE Setup

Visual Studio Code

Install recommended extensions:

{
  "recommendations": [
    "ms-vscode.cpptools",
    "ms-vscode.cmake-tools", 
    "vadimcn.vscode-lldb",
    "ms-vscode.hexeditor"
  ]
}

Configure .vscode/settings.json:

{
  "cmake.buildDirectory": "${workspaceFolder}/build",
  "cmake.generator": "Unix Makefiles",
  "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
  "C_Cpp.default.cppStandard": "c++17"
}

CLion

  1. Open Project: File → Open → Select SDR++CE root directory
  2. CMake Settings: File → Settings → Build → CMake
  3. Toolchains: Configure compiler and debugger paths
  4. Run Configurations: Add configurations for different build types

Visual Studio (Windows)

  1. Open Folder: File → Open → Folder → Select SDR++CE directory
  2. CMake Settings: Project → CMake Settings → Configure
  3. vcpkg Integration: Ensure vcpkg toolchain is configured

Debugging Setup

GDB/LLDB Configuration

Create .gdbinit in project root:

set print pretty on
set confirm off
handle SIGPIPE nostop noprint pass

Address Sanitizer

cmake .. \
  -DCMAKE_BUILD_TYPE=Debug \
  -DCMAKE_CXX_FLAGS="-fsanitize=address -g"

Valgrind (Linux)

# Install valgrind
sudo apt install valgrind

# Run with memory checking
valgrind --leak-check=full --show-leak-kinds=all ./sdrpp_ce

Testing Framework

Setting up Google Test

# Linux
sudo apt install libgtest-dev

# macOS
brew install googletest

# Add to CMakeLists.txt
find_package(GTest REQUIRED)
add_executable(tests test/test_main.cpp)
target_link_libraries(tests GTest::GTest GTest::Main)

Running Tests

# Build tests
cmake .. -DOPT_BUILD_TESTS=ON
make tests

# Run tests
./tests

Continuous Integration

GitHub Actions Template

Create .github/workflows/build.yml:

name: Build

on: [push, pull_request]

jobs:
  linux:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Install dependencies
      run: |
        sudo apt update
        sudo apt install cmake libfftw3-dev libglfw3-dev
    - name: Build
      run: |
        mkdir build && cd build
        cmake ..
        make -j$(nproc)

Troubleshooting

Common Build Issues

"Cannot find module.h"

# Ensure core headers are in include path
export CPLUS_INCLUDE_PATH="/path/to/sdrpp/core/src:$CPLUS_INCLUDE_PATH"

"FFTW not found"

# Linux
sudo apt install libfftw3-dev

# macOS  
brew install fftw

# Windows
vcpkg install fftw3:x64-windows

"OpenGL headers missing"

# Linux
sudo apt install libgl1-mesa-dev

# macOS - included with Xcode
# Windows - included with Windows SDK

Performance Issues

Slow Debug Builds

  • Use RelWithDebInfo instead of Debug for better performance
  • Disable expensive debug checks in hot paths

Memory Usage

  • Monitor with htop or Task Manager during development
  • Use memory profilers to identify leaks

Platform-Specific Issues

macOS Code Signing

# For development, disable code signing requirement
sudo spctl --master-disable

Windows Antivirus

  • Add SDR++CE build directory to antivirus exclusions
  • Some security software flags development builds

Linux Permissions

# Add user to plugdev group for USB device access
sudo usermod -a -G plugdev $USER

Next Steps:

Clone this wiki locally