![]() |
SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
|
This document describes how to build the SmartSpectra SDK from source on Ubuntu 22.04 or Mint 21. Note that on these systems, since installable packages are available, this step is not required if you just want to develop a standalone C++ application using the SDK (see Supported Systems & Architectures for more details on supported platforms and package availability). However, building from source allows you to build the SDK examples, understand how SDK source code works, and even contribute your own desired features to the SDK.
All commands below demonstrate how to build from a terminal (e.g., Ctrl+Alt+T by default on Ubuntu or Activities (Super key) → Terminal). We encourage you to use IDEs, editors, and other GUI tools that wrap around any of the given terminal commands at your discretion.
Before building from source, ensure you have the following tools available:
Note: If you just want to use the SDK (not build from source), see the main README for package installation instructions.
Install essential build tools (required for CMAKE_MAKE_PROGRAM and CMAKE_CXX_COMPILER):
CMake 3.27.0 or newer is required. Ubuntu 22.04 comes with an older version:
Option A: Install from Kitware Repository (Recommended)
Option B: Direct Download from GitHub
Install Ninja (recommended) or verify Make is available:
Install or build the Physiology Edge library.
Side Note: the Physiology Edge library, packaged as libphysiologyedge-dev, is the C++ backend that all SmartSpectra SDKs rely on to provide a uniform experience across all languages and platforms. This is where some of the computation and communication with Physiology Core API on the cloud takes place. Meanwhile, the SmartSpectra C++ SDK, packages as libsmartspectra-dev, is the C++ open-source library that wraps around the Physiology Edge library to provide a convenient, simple API for C++ developers.
Update the apt database:
Install (or upgrade) the Physiology Edge library:
Clone this repository.
Navigate to the C++ SDK root within the cloned repository, e.g.:
Using Ninja:
Using Make (on macOS, substitute $(sysctl -n hw.ncpu) for $(nproc) below):
shell mkdir build cd build cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON .. make -j$(nproc)
Adjust CMake build flags in the above cmake calls as needed.
You can cross-compile the SDK and examples for the Linux arm64 architecture when building on an amd64 Linux machine.
Install the required cross-compilation tools:
Specify the provided toolchain file to CMake. E.g., from within SmartSpectra/cpp (assuming SmartSpectra is the root of the repository), run :
Use cpack to generate the desired package in the build folder. E.g., from within SmartSpectra/cpp (assuming SmartSpectra is the root of the repository), run:
For the above example, if there are no errors in the output, you should see a *.deb package file appear in the build directory.