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

address gcc6 build error #423

Merged
merged 3 commits into from
Mar 5, 2017
Merged

Conversation

rojkov
Copy link
Contributor

@rojkov rojkov commented Jan 24, 2017

With gcc6, compiling fails with stdlib.h: No such file or directory,
as including '-isystem /usr/include' breaks with gcc6, cf.,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129.

This commit addresses this issue for this package in almost the same way
it was addressed in various other ROS packages. A list of related
commits and pull requests is at:

https://github.com/ros/rosdistro/issues/12783

Particularly when searching for the Boost library CMake sets
Boost_INCLUDE_DIRS to @sysRoot@/usr/include which should be
avoided in the -isystem option of gcc.
The same goes for OpenCV.

Fortunately neither Boost nor OpenCV trigger build warnings when their include dirs are not marked as system ones.

Dmitry Rozhkov added 2 commits January 24, 2017 16:42
With gcc6, compiling fails with `stdlib.h: No such file or directory`,
as including '-isystem /usr/include' breaks with gcc6, cf.,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129.

This commit addresses this issue for this package in almost the same way
it was addressed in various other ROS packages. A list of related
commits and pull requests is at:

    ros/rosdistro#12783

Particularly when searching for the Boost library CMake sets
Boost_INCLUDE_DIRS to @sysRoot@/usr/include which should be
avoided in the `-isystem` option of gcc.
The same goes for OpenCV.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
@rojkov
Copy link
Contributor Author

rojkov commented Jan 25, 2017

Added two more commits:

  • drop unused build dependency on Qt4;
  • do explicit type conversion to fix compilation failure with gcc6.2

Copy link
Contributor

@de-vri-es de-vri-es left a comment

Choose a reason for hiding this comment

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

I messed up the review inline-comments v.s. summary here and I can't seem to delete this comment. Just ignore this =]

Copy link
Contributor

@de-vri-es de-vri-es left a comment

Choose a reason for hiding this comment

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

Thanks for looking in to it, and checking the warnings. One small point, but looks good to me other than that.

@@ -63,7 +63,7 @@ void planning_scene_monitor::TrajectoryMonitor::setSamplingFrequency(double samp

bool planning_scene_monitor::TrajectoryMonitor::isActive() const
{
return record_states_thread_;
return !!record_states_thread_.get();
Copy link
Contributor

@de-vri-es de-vri-es Jan 25, 2017

Choose a reason for hiding this comment

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

On the kinetic-devel branch this is currently already fixed as return static_cast<bool>(record_states_thread_); Not sure why we didn't backport it, but I think it's best to use the same fix here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. static_cast would be much better here. Will fix!

When building with gcc6.2 and hardened compiler options used in
Ostro project the build fails with the following error:

  moveit-ros-planning/moveit_ros/planning/planning_scene_monitor
  /src/trajectory_monitor.cpp:67:10: error: cannot convert 'const
  boost::scoped_ptr<boost::thread>' to 'bool' in return

The patch does explicit conversion of boost::scoped_ptr to bool.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
@rojkov
Copy link
Contributor Author

rojkov commented Jan 26, 2017

Updated the type conversion to use static cast

@davetcoleman davetcoleman merged commit 6f8871c into moveit:indigo-devel Mar 5, 2017
@davetcoleman
Copy link
Member

Thanks for working on these details

@davetcoleman
Copy link
Member

PRs opened for J/K

JafarAbdi pushed a commit to JafarAbdi/moveit that referenced this pull request Mar 24, 2022
Co-authored-by: AndyZe <zelenak@picknik.ai>
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.

None yet

3 participants