Skip to content

Patch librealsense v2.44.0 to include <chrono> for system_clock - #7074

Merged
ssheorey merged 4 commits into
isl-org:mainfrom
StephanTLavavej:include-chrono
Jul 19, 2025
Merged

Patch librealsense v2.44.0 to include <chrono> for system_clock#7074
ssheorey merged 4 commits into
isl-org:mainfrom
StephanTLavavej:include-chrono

Conversation

@StephanTLavavej

Copy link
Copy Markdown
Contributor

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 microsoft/STL#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 realsenseai/librealsense#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.

Fixes:
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'

And cascaded:
C:\gitP\isl-org\Open3D\build_amd64\librealsense\src\ext_librealsense\src\backend.cpp(28,88): error C2039: 'system_clock': is not a member of 'std::chrono'
C:\gitP\isl-org\Open3D\build_amd64\librealsense\src\ext_librealsense\src\mf\mf-backend.h(31,26): error C2039: 'high_resolution_clock': is not a member of 'std::chrono'
C:\gitP\isl-org\Open3D\build_amd64\librealsense\src\ext_librealsense\src\mf\mf-backend.cpp(26,9): error C2512: 'std::chrono::time_point': no appropriate default constructor available
@update-docs

update-docs Bot commented Nov 24, 2024

Copy link
Copy Markdown

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@ssheorey ssheorey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @StephanTLavavej !

@ssheorey
ssheorey merged commit 29e6c81 into isl-org:main Jul 19, 2025
@StephanTLavavej
StephanTLavavej deleted the include-chrono branch November 13, 2025 13:06
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.

2 participants