Skip to content

Enable macOS build for the face-auth path#191

Open
marinmarian wants to merge 1 commit into
realsenseai:masterfrom
prosus-robotics:add-macos-support
Open

Enable macOS build for the face-auth path#191
marinmarian wants to merge 1 commit into
realsenseai:masterfrom
prosus-robotics:add-macos-support

Conversation

@marinmarian
Copy link
Copy Markdown

Summary

Enables building the face-auth path of the RealSense ID SDK on macOS (Apple Silicon). The existing LinuxSerial implementation is pure POSIX, so the same serial transport works unchanged on macOS — the patch just opts macOS into the existing code paths via APPLE (CMake) and __APPLE__ (preprocessor).

What's included

  • cmake/OS.cmake: new APPLE branch matching the existing ANDROID style.
  • src/PacketManager/CMakeLists.txt: include LinuxSerial on macOS, with a comment explaining why reuse is safe.
  • Four platform guards extended to also match __APPLE__:
    • DeviceControllerImpl.cc
    • FaceAuthenticatorCommon.cc
    • FwUpdaterCommF45x.cc
    • FwUpdaterCommF50x.cc
  • Readme.md: macOS added to Platforms list + macOS Notes subsection.

~10 lines of code across 6 files.

Out of scope (happy to follow up)

  • Preview / libuvc support on macOS — libuvc is already excluded for Apple upstream. AVFoundation would be the macOS-native replacement.
  • IOKit-based discover_devices() — the function currently walks /sys/bus/usb/ and returns an empty list on macOS. Documented as a known limitation in the macOS Notes.

Tested

  • Build: Apple Silicon (M-series), macOS 26, Apple Clang 21, CMake 4.3, Python 3.13, with -DRSID_PY=ON -DRSID_PREVIEW=OFF.
  • End-to-end face-auth (enroll, identify, query, remove) against an F455 over USB.
  • F500 firmware-updater file gets the matching guard but isn't runtime-tested (no F500 hardware on hand).
  • Intel Mac not tested.

The face-auth path (FaceAuthenticator, DeviceController, FwUpdater)
is platform-agnostic apart from the serial transport. The existing
LinuxSerial implementation uses only POSIX APIs (termios.h /
unistd.h / fcntl.h), so it builds and runs on macOS unchanged.

Changes:
- cmake/OS.cmake: add an APPLE branch matching the existing ANDROID
  style (no platform-specific defines needed).
- src/PacketManager/CMakeLists.txt: include LinuxSerial on APPLE too,
  with a comment explaining why the same source is reused.
- Four platform guards extended from '#elif defined(__linux__)' to
  '#elif defined(__linux__) || defined(__APPLE__)' so the LinuxSerial
  header is selected on macOS:
    src/DeviceController/DeviceControllerImpl.cc
    src/FaceAuthenticator/Impl/FaceAuthenticatorCommon.cc
    src/FwUpdate/F45x/FwUpdaterCommF45x.cc
    src/FwUpdate/F50x/FwUpdaterCommF50x.cc
- Readme.md: add macOS to the Platforms list and a macOS Notes
  subsection documenting the build flag (RSID_PREVIEW=OFF) and the
  discover_devices() limitation.

Out of scope (separate PRs welcome):
- Preview / libuvc support on macOS (libuvc is excluded for Apple
  upstream; AVFoundation would be the macOS-native replacement).
- IOKit-based discover_devices() so applications can enumerate
  devices without hardcoding the serial port path.

Tested on Apple Silicon (M-series, macOS 26, Apple Clang 21,
Python 3.13) with an F455 over USB. Build:

    cmake -DRSID_PY=ON -DRSID_PREVIEW=OFF \
          -DRSID_SAMPLES=OFF -DRSID_TOOLS=OFF ..
    make

End-to-end face-auth verified: enroll, identify, query users, remove.
F500 firmware update guard updated to match but not runtime-tested
(no F500 hardware on hand).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant