-
Notifications
You must be signed in to change notification settings - Fork 279
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
Setting CMAKE_CXX_STANDARD in melodic #936
Comments
At least OSX (with homebrew have a rolling release) this is already an issue for all distros, not just for melodic, since dependencies like
I agree that setting this in There might be an argument to enable this by default not only for melodic, at least on some platforms that are currently already broken. Ofc it needs to be carefully considered, but my suspicion is that no one will complain if we enable this for OSX also for older distros to make builds succeed without need to manually pass |
For the record, I've had success with passing additionally |
In terms of building on Mac, I had been picturing that I would have to handle this with another CMake arg passed in here (as described by @NikolausDemmel above): However, assuming this is going to affect other rolling release systems, I would agree with handling it centrally in tl;dr 👍 from me to this. |
I am not sure if hard coding any kind of value (even if only for macOS) is the best approach. Some higher level packages might not even work with the changed setting? Wouldn't it be easier to add this to the from-source instructions for macOS? And the end of the day I don't mind how it is done for macOS. If you would like to add a conditional block which set the flag in |
Sorry for being late to the party. My perspective is of a person compiling the code for a platform Melodic is not officially not released on, ie. one of the people for whom handling the issue centrally would help, no matter the platform (macOS or not) Even if the value is not hard coded, throwing a proper error makes sense to inform the user that the issue would not be handled by the maintainers. Simply adding this on the wiki/Installation/Source would also resolve the issue (instead of one redirection away at REP 3). One alternative to the CMake solution might be official C++ macros to check the version/capabilities as used in core packages. This might increase the load on the maintainers but allows more compatibility (such as fallback on boost if std version is not enough). Another potential instead of For me, the best solution might be a CMake one itself. It'd be a complicated one which checks for default standard, if it's less than 14, then sets it to 14 with a warning message. This would be possible with |
This was already proposed in ros/catkin#936
Closing since there is nothing to be done in this repo. |
Following up on ros-infrastructure/rep#139 (comment).
Basically, some packages now use C++11/14 stuff in their headers, and if downstream packages do not set the compiler standard themselves, but use those headers you get errors like this on macOS:
These occur because even though the compiler on macOS supports C++11/14/17, it still defaults to C++03. This might change in the future, but there's no ETA on this. So for now, source builds are broken without intervention.
In the above linked discussion, there seemed to be a preference for doing something like:
In one of the "core" packages. I also think this is the best thing we can do for now.
I believe
catkin
makes the most sense for this conditional setting, for a few reasons:find_package()
'ed by almost everything that depends on itWe (@mikaelarguedas and I) considered other packages like
cmake_modules
,roslib
, orros_environment
.However, none of these options are
find_package
'ed by all of ROS. In order for the above logic to work, every package needs to either directly or indirectlyfind_package
the package which contains the logic.ros_environment
is used byroslib
and gets into almost every workspace, but many packages would not have their cmake logic affected.So, I think
catkin
makes the most sense. However, it would require us to fork formelodic-devel
(in my opinion).But I wanted to get feedback on the idea before spending more time on it.
An alternative, but less attractive (from a user point of view), solution would be to have people building on machines where this is an issue (essentially just on macOS right now) include the cmake argument
-DCMAKE_CXX_STANDARD=14
anywhere they invoke a build. That would be withcatkin_make
,catkin_make_isolated
,catkin_tools
, or just plain invokingcmake
.I'm interested to know what you think about this option @mikepurvis.
The text was updated successfully, but these errors were encountered: