ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Annoying build warnings: how to suppress?

asked 2021-05-21 04:38:13 -0500

LukeAI gravatar image

On ros melodic, catkin tools, PCL 1.8, cmake 3.20.2, g++, 10.3.0 I get this build warning when doing plane regression.

/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: warning: ‘pcl::SAC_SAMPLE_SIZE’ is deprecated: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class [-Wdeprecated-declarations]
   99 |   SAC_SAMPLE_SIZE (sample_size_pairs, sample_size_pairs + sizeof (sample_size_pairs) / sizeof (SampleSizeModel));
      |   ^~~~~~~~~~~~~~~

It's pretty annoying. The same warning was noted back in 2016 here - the solution people found there was to manually edit the PCL source code to comment this out.

I realise I might be asking for too much, but - Is there some "reasonable" way that I can stop our project/package from emitting this specific warning?

By "reasonable" I mean - doesn't force every user to manually edit PCL source code on their computers and doesn't involve just suppressing all warnings. Maybe, for example, there is something I can add to the CMakeLists.txt or some way I can configure cmake to suppress warnings specifically from PCL but not from elsewhere?

Related: also every c++ package gives me Googletest warnings like:

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):

  Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at /usr/src/googletest/CMakeLists.txt:4 (cmake_minimum_required):   Compatibility with CMake < 2.8.12 will be removed from a future version of   CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions.

  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at /usr/src/googletest/googletest/CMakeLists.txt:56 (cmake_minimum_required):   Compatibility with CMake < 2.8.12 will be removed from a future version of   CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions.
edit retag flag offensive close merge delete

Comments

1

Tbh this isn't really a ROS-specific question. It's more CMake or PCL or Googletest.

Those are all system dependencies, not ROS packages.

gvdhoorn gravatar image gvdhoorn  ( 2021-05-21 04:40:34 -0500 )edit

ahoj,abych nemusel idiotsky opravovat kazdy z 229 balicku,existuje uz konecne reseni globalni? dekuji za odpoved, Jacob

KennyDeDavion gravatar image KennyDeDavion  ( 2021-09-23 16:25:35 -0500 )edit

Please post only in English.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-24 01:09:46 -0500 )edit

Gvdhoorn-> You are stupid,or cannot use translator?

KennyDeDavion gravatar image KennyDeDavion  ( 2021-10-01 04:21:48 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2021-05-22 04:42:50 -0500

LukeAI gravatar image

updated 2021-05-22 04:44:40 -0500

I have partially worked this out:

Disable googletest warnings by disabling testing

catkin config -DCATKIN_ENABLE_TESTING=0

This is obviously no good if you actually want testing enabled. Unfortunately I found that upgrading google test to the latest (final) release from a PPA didn't fix these warnings. They are fixed upstream, but googletest don't do releases anymore, so you have to manually install from github master branch. alternatively could manually edit the CMakeLists.txt under /usr/src/googletest which some people have reported success with. either could work but don't want to recommend to users.

Disable PCL warnings (and indeed all 3rd party warnings - maybe not desirable?) by modifying CMakeLists.txt like:

include_directories(
 SYSTEM # suppress warnings from 3rd party libs that we can't control
 ${catkin_INCLUDE_DIRS}
)
edit flag offensive delete link more

Comments

I'll wait a while and see if somebody has a better solution before accepting

LukeAI gravatar image LukeAI  ( 2021-05-22 04:43:26 -0500 )edit

The Disable PCL warnings was good.

To suppress the cmake warnings I ended up rolling back cmake version a little to CMAKE 3.18.4

LukeAI gravatar image LukeAI  ( 2021-09-24 03:09:46 -0500 )edit
0

answered 2021-05-21 08:50:10 -0500

Mbuijs gravatar image

Why are you using version PCL version 1.8? Starting from 1.9 this map and deprecation warning have been removed.

Based on the cmake and g++ version you're on a recent version of some distro. For example in Ubuntu PCL 1.10 has been included in 20.04 already.

edit flag offensive delete link more

Comments

I'm on 18.04, using newer cmake and g++ because I need support for a couple of specific things, otherwise using default PCL provided with ROS melodic

LukeAI gravatar image LukeAI  ( 2021-05-21 08:51:42 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-05-21 04:38:13 -0500

Seen: 3,242 times

Last updated: Sep 23 '21