Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Patch librealsense v2.44.0 to include `<chrono>` for `system_clock`

Open StephanTLavavej opened this issue 1 year ago • 1 comments

I work on Microsoft Visual C++, where we regularly build popular open-source projects, including yours, with development builds of our compiler and libraries to detect and prevent shipping regressions that would affect you. This also allows us to provide advance notice of breaking changes, which is the case here.

I just merged https://github.com/microsoft/STL/pull/5105, which revealed a conformance issue in librealsense used by Open3D.

Compiler error with this STL change:

C:\gitP\isl-org\Open3D\build_amd64\librealsense\src\ext_librealsense\src\backend.h(108,79): error C2039: 'system_clock': is not a member of 'std::chrono'

librealsense was assuming that including <thread> makes the chrono::system_clock type available, which is not guaranteed by the C++ Standard.

I'm adding a patch to properly include <chrono> and updating librealsense.cmake to apply it.

(Note that upstream librealsense needs a different patch, for which I've created https://github.com/IntelRealSense/librealsense/pull/13537. This would be relevant if you merged an update like #6714.)

I've verified that building Open3D with microsoft/STL main fails without this patch and succeeds with it.

StephanTLavavej avatar Nov 24 '24 05:11 StephanTLavavej