-
Notifications
You must be signed in to change notification settings - Fork 222
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
Build failure on Fedora 30 (using GCC9) #402
Comments
I think it's a combination of rviz_rendering setting -Werror, and the addition of -Wdeprecated-copy in gcc-9. It appears that Eigen triggers this new warning because it defines an assignment operator without a copy constructor in a bunch of its classes. There's a couple failures in assimp types too. rviz_rendering should remove -Werror from the default build flags. |
Looks like assimp has the same issue. Making things worse, I'm seeing some sort of compiler problem that causes messages like this:
...whenever any I'm not suggesting we merge these changes, but I hacked around the problems in the |
I'm seeing the same things with disabling deprecated-copy via $CXXFLAGS. From the manual:
Basically, gcc suppresses the The variadic macro warning is tested here. It should be testing for the positive $ cat << EOF > test.cpp
int main(return 0;}
EOF
$ g++ -c test.cpp -Wno-gnu-zero-variadic-macro-arguments
$ g++ -c test.cpp -Wgnu-zero-variadic-macro-arguments
g++: error: unrecognized command line option ‘-Wgnu-zero-variadic-macro-arguments’ |
That's some great investigation, @richmattes. I never would have expected that behavior. Let's try switching to the positive argument test and see if that passes CI. Since you discovered the root cause, would you like to make the PR? |
@cottsay I recently built ROS 2 with GCC 10 (off svn). I had to add two patches to make it build, so I'll just paste them here as a workaround instead of PRing them in (since they don't solve the root cause). diff --git a/rviz_common/CMakeLists.txt b/rviz_common/CMakeLists.txt
index 4a460c49..8010209f 100644
--- a/rviz_common/CMakeLists.txt
+++ b/rviz_common/CMakeLists.txt
@@ -26,10 +26,11 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
# TODO(wjwwood): try to remove this -- currently needed to pass on CI
include(CheckCXXCompilerFlag)
- check_cxx_compiler_flag(-Wno-gnu-zero-variadic-macro-arguments HAS_W_FLAG)
- if(HAS_W_FLAG)
- add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)
- endif()
+ add_compile_options(-Wno-error=deprecated-copy)
+# check_cxx_compiler_flag(-Wno-gnu-zero-variadic-macro-arguments HAS_W_FLAG)
+# if(HAS_W_FLAG)
+# add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)
+# endif()
endif() diff --git a/rviz_rendering/CMakeLists.txt b/rviz_rendering/CMakeLists.txt
index 7f7769ed..1522474a 100644
--- a/rviz_rendering/CMakeLists.txt
+++ b/rviz_rendering/CMakeLists.txt
@@ -8,7 +8,7 @@ if(NOT CMAKE_CXX_STANDARD)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- add_compile_options(-Wall -Wextra -Wpedantic -Werror)
+ add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wno-error=deprecated-copy)
endif()
# Tests currently only run on OS X @ OSRF jenkins @wjwwood Is there a reason to have |
Those are the same problems we're seeing with GCC9, @allenh1. Looks like there isn't anything new in GCC 10, but please try building the |
Nah, there's no good reason, other than I was trying to make sure it didn't have warnings, but now I do that with |
I can PR a fix for the |
I'm seeing a lot of messages related to
-Werror=deprecated-copy
. Adding--cmake-args -DCMAKE_CXX_FLAGS=-Wno-error=deprecated-copy
allows the build to proceed. The problem might be in Eigen - I'm not sure yet.Example failure:
The text was updated successfully, but these errors were encountered: