-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
@@ -1,6 +1,5 @@ | |||
cmake_minimum_required(VERSION 2.8.3) | |||
project(realsense2_camera) | |||
add_compile_options(-std=c++11) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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..
There was a problem hiding this comment.
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 ;-)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ..."
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.
@rhaschke I appreciate your help to promote and maintain our ROS repo. |
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.