0
$\begingroup$

Rosanswers logo

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. 

Originally posted by LukeAI on ROS Answers with karma: 131 on 2021-05-21

Post score: 0


Original comments

Comment by gvdhoorn on 2021-05-21:
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.

Comment by KennyDeDavion on 2021-09-23:
ahoj,abych nemusel idiotsky opravovat kazdy z 229 balicku,existuje uz konecne reseni globalni? dekuji za odpoved, Jacob

Comment by gvdhoorn on 2021-09-24:
Please post only in English.

Comment by KennyDeDavion on 2021-10-01:
Gvdhoorn-> You are stupid,or cannot use translator?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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} ) 

Originally posted by LukeAI with karma: 131 on 2021-05-22

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by LukeAI on 2021-05-22:
I'll wait a while and see if somebody has a better solution before accepting

Comment by LukeAI on 2021-09-24:
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

$\endgroup$