Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

StephanTLavavej
Copy link

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 IntelRealSense/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
Copy link

update-docs bot commented Nov 24, 2024

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

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