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

Don't enforce C++11 standard #2914

Merged
merged 1 commit into from
Jan 2, 2024
Merged

Conversation

rhaschke
Copy link
Contributor

The default in Ubuntu 18.04 and 20.04 is C++14.
Ubuntu 22.04 uses C++17 as the gcc default, which is required by log4cxx there.

@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 2.8.3)
project(realsense2_camera)
add_compile_options(-std=c++11)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we need C++14 instead of C++17 as this is the minimal C++ version we require?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We prefer the compilation to fail if C++17 or higher code is added

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then this won't compile on Ubuntu 22.04.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh sorry just noticed that this is for the ros1 branch which we do not support/maintain anymore..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is for the ROS1 branch. If you don't actively support that anymore, be happy about community contributions like this ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not libRS, but realsense-ros. To build that for ROS1 on Ubuntu 22 (which you probably never tried), we need to enable C++17 support, which is required by log4cxx 0.12 shipped with Ubuntu 22. Explicitly requiring a specific standard, fixes C++ to this standard even if the system-default is newer. Specifically, fixing to C++11 or C++14, disables the Ubuntu22-system default of C++17, which is required for log4cxx, which in turn is pulled in by rosconsole.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the CI failed as well, we will have to dive into this.
If you can take a look it will be great.
Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CI failures are not related to my change, I think. Looks like the installed em python-module (found in /usr/local/lib) is not compatible with ROS' message generation:
AttributeError: module 'em' has no attribute 'RAW_OPT'

On a native ROS system, em comes from /usr/lib/python3/dist-packages/em.py.
The wrong version is installed by the ros-tooling action via pip:
Invoking "sudo pip3 install --upgrade ... empy ..."

Copy link
Collaborator

Choose a reason for hiding this comment

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

I updated the GitHub actions and now it should work, can you please rebase?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the GitHub actions and now it should work, can you please rebase?

Done.

@Nir-Az Nir-Az closed this Dec 31, 2023
@Nir-Az Nir-Az reopened this Dec 31, 2023
The default in Ubuntu 18.04 and 20.04 is C++14.
Ubuntu 22.04 uses C++17 as the gcc default, which is required by log4cxx there.
@Nir-Az Nir-Az merged commit b14ce43 into IntelRealSense:ros1-legacy Jan 2, 2024
1 check passed
@Nir-Az
Copy link
Collaborator

Nir-Az commented Jan 2, 2024

@rhaschke I appreciate your help to promote and maintain our ROS repo.
Even that we do not use to merge unsupported branched PRs I merged your PR as it shown a small risk and will help you and the community as well, and we always glad to have community contributions.
Wish you a happy new year and keep up the good work :)

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