Skip to content

Development Environment

decltype(auto) edited this page Nov 10, 2021 · 8 revisions

Development Environment

Contents:

General principles

The software we use

As outlined in our README file, to work on libSMCE you will need:

  • A C++20 compiler
  • CMake >= 3.16 (as well as a build system; best is Ninja)
  • Boost >= 1.74 (or else it will be fetched during build configuration)
  • OpenSSL

What is not required for building or running libSMCE, but is very handy for development, is listed below:

  • ClangFormat & ClangTidy
  • Doxygen
  • Debugger (GDB, LLDB, WinDbg)
  • Memory analyzer (Valgrind)
  • MQTT broker (Eclipse Mosquitto, Hummingbird, and alike)
  • Packaging tools
    • Debian/Ubuntu: Debian package development tools (dpkg-dev)
    • RHEL/Fedora & openSUSE: RPM development tools (rpmdevtools)
    • Windows: WiX Toolset

Supported compilers

  • Linux/BSD: both GCC and Clang/LLVM are great.

  • Windows: MSVC (the C++ toolchain of Microsoft Visual Studio) or Clang-cl are your options.

  • macOS: AppleClang (from XCode command line tools), GCC and Clang/LLVM will work.

Note that the more compilers you have at hand, the better for debugging.

Picking an IDE

As long as you have syntax highlighting for C++ and CMake, whatever you are most used to is probably best.

We use CLion, along with the CMake Plus plugin, since it has integrations for all the surrounding tools we need.

Windows recommended setup

  1. Install Chocolatey
  2. Install CMake:
    choco install cmake -y --installargs 'ADD_CMAKE_TO_PATH=System'
  3. Install OpenSSL, Ninja, Git, Doxygen, and WiX:
    choco install openssl ninja git doxygen.install wixtoolset -y
  4. Install MSVC (warning: may take some time):
    choco install visualstudio2019buildtools -y --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --passive --locale en-US"

macOS recommended setup

  1. Install Homebrew
  2. Install CMake:
    brew install --cask cmake
  3. Install Boost, OpenSSL, ArduinoCLI, Ninja, Doxygen, and Git:
    brew install boost openssl ninja doxygen git
  4. Install GCC & Clang/LLVM:
    brew install gcc llvm
  5. Install AppleClang:
    xcode-select --install

Note: If you are running macOS Catalina or earlier, you might get a message saying that the software is no longer present on Apple's update servers. In that case, go download the latest stable (non-beta) package on the Apple Developer Downloads page.