Install the SmartSpectra C++ SDK on Ubuntu 24.04 or Linux Mint 22 (noble) for amd64 and arm64.
Warning — Experimental platform: Linux support for the SmartSpectra C++
SDK is experimental. If you have any issues running SmartSpectra,
contact Presage support for assistance.
This guide covers the noble apt suite, which supports both amd64 and
arm64. If you are on Ubuntu 22.04 / Mint 21, follow the
Ubuntu 22.04 / Mint 21 guide instead.
Installation
Prerequisites
CMake 3.22.1 or later (the version shipped with Ubuntu 24.04 / Mint 22 is sufficient)
C++17 compiler such as GCC or Clang
Vulkan-capable graphics driver — Linux builds use Vulkan inference by default. The SDK package installs the Vulkan loader dependency through apt, but the host must provide a working Vulkan driver.
cmake, curl, gpg, and pkg-config — used by the build, install, and verify steps below. Install with sudo apt install cmake curl gpg pkg-config if they are not already present.
The signed-by= source entry scopes the Presage signing key to the Presage
apt repository. APT selects the package matching your system's
dpkg --print-architecture (amd64 or arm64) automatically.
The SmartSpectra SDK package is self-contained. You do not need to install
protobuf, curl, OpenSSL, or other SDK runtime libraries separately.
Verify that the package is visible to build tools:
pkg-config --modversion SmartSpectra
The command prints the installed SDK version (for example, 3.3.0). If it
prints nothing or reports that the package is missing, reinstall
libsmartspectra-dev and confirm you are on a supported Ubuntu 24.04 /
Mint 22 (amd64 or arm64) host.
Example
This quick start creates a minimal CMake project that links against the
installed SmartSpectra::SDK package and reads from the default camera.
You will create exactly these files:
hello_vitals/hello_vitals.cpp
hello_vitals/CMakeLists.txt
Result you should get
At the end, the app should show console output with:
a successful CMake configure and build
Processing... Press Ctrl+C to stop.
Cardio metrics: log lines when cardio metrics are available
Breathing metrics: log lines when breathing metrics are available
The example requests breathing and cardio metrics. Add FaceMetrics() or other
metric groups with config.AddMetrics(...) when your app expects those outputs.
Step 4 - Create CMakeLists.txt
Open a new file named CMakeLists.txt in the same directory and paste this
entire file:
A successful build produces the executable at build/hello_vitals. If CMake
reports that it cannot locate SmartSpectra, rerun
pkg-config --modversion SmartSpectra to confirm the SDK is installed
correctly before continuing.
Sit centered in front of the webcam, well-lit, and stay reasonably still. The
app logs breathing and cardio metrics until you stop it with Ctrl+C. If no
face is detected the app still runs and exits cleanly, but no metrics callbacks
fire. An internet connection is required for subscription validation when using
the standard SDK.
What success looks like
When your program is running, you should see all of these:
Processing... Press Ctrl+C to stop. prints after launch
the camera starts without a source creation error
Cardio metrics: or Breathing metrics: logs print while you sit centered and well-lit
the process exits after Ctrl+C without a Stop failed message
Expected API key check
The first measurement should start after the executable launches with a valid
API key argument or SMARTSPECTRA_API_KEY environment variable. If startup
fails with an authentication error, verify that the key is authorized for this
app and that your shell did not include extra quotes or whitespace.
Common manual mistakes
If the console output does not match the target state, check these first:
the Presage apt source was added for the wrong Ubuntu or Mint suite
libsmartspectra-dev did not finish installing before CMake was run
the API key argument or SMARTSPECTRA_API_KEY environment variable is missing
the binary is an older build from before the latest source change
Running headless (Docker, CI, no desktop)
A desktop Ubuntu or Mint session provides D-Bus and a Secret Service backend
(gnome-keyring) automatically. Without one — in a Docker container, on a CI
runner, or in an SSH session with no desktop — the SDK cannot persist its
device identity and aborts at initialization with:
Load secret 'key_id' failed: D-Bus Secret Service is not reachable
Install a D-Bus launcher and a Secret Service backend, then start a session
bus and unlock a fresh keyring before running your binary:
dbus-launch --sh-syntax writes export DBUS_SESSION_BUS_ADDRESS=…; to
stdout so the eval exports the address into the current shell's
environment, and gnome-keyring-daemon --unlock --components=secrets opens
the secrets backend with an empty passphrase so libsecret reads and writes
keys unattended. The same three commands also satisfy the SDK on a stock
Ubuntu Server install. (Without --sh-syntax, dbus-launch prints bare
KEY=value lines that eval treats as shell-local assignments rather
than env exports, so the SDK subprocess does not inherit the bus address.)
Build the Provided Samples
The SDK package does not install the sample source code. To build the repository
samples against the installed SDK, clone the SmartSpectra repository after
installing libsmartspectra-dev:
To run headlessly against a recording instead of the default camera, add
--input_video_path=/path/to/video.mp4.
Advanced apt workflows
Most users only need the stable noble repository above. Use these when you
intentionally need release-candidate packages, version pinning, or repository
removal.
Pinning the installed SDK version
To keep a working machine on the currently installed SDK version while you test
or stage a rollout, hold the package:
sudo apt-mark hold libsmartspectra-dev
Release the hold when you are ready to take SDK updates again:
sudo apt-mark unhold libsmartspectra-dev
Release-candidate channel
Release-candidate builds are published to the parallel noble-rc apt suite
signed by the same Presage key:
If you are upgrading an older C++ integration, start with the C++ Migration Guide.
If your binary fails at startup with Load secret 'key_id' failed: D-Bus Secret Service is not reachable, you are on a host without a desktop session
— see Running headless for the
D-Bus and keyring bootstrap.
Debian Signed-By conflict
Older Debian instructions installed the Presage key in
/etc/apt/trusted.gpg.d/ and used a source line without signed-by=. If
apt update reports E: Conflicting values set for option Signed-By regarding source https://packages.presagetech.com/apt/ubuntu/ noble, remove the legacy key copy and run apt update again: