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

Failed Build - Debian - rosidl_generator_traits::is_message #479

Closed
gramss opened this issue Apr 30, 2020 · 5 comments · Fixed by #512
Closed

Failed Build - Debian - rosidl_generator_traits::is_message #479

gramss opened this issue Apr 30, 2020 · 5 comments · Fixed by #512
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@gramss
Copy link

gramss commented Apr 30, 2020

Bug report

Required Info:

  • Operating System:
  • Installation type:
    • from source
  • Version or commit hash:
    • ros2-eloquent latest
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • N/A

Steps to reproduce issue

https://index.ros.org/doc/ros2/Installation/Eloquent/Linux-Development-Setup/
--> step: colcon build
https://github.com/ros2/ros2/issues/470#issuecomment-371141641 (cmake from source)

Expected behavior

Build ros eloquent from Source on debian. Already build cmake 10 from source for https support in libcurl.

Actual behavior

[Processing: rosidl_generator_cpp, rviz_assimp_vendor, rviz_ogre_vendor]
[Processing: rosidl_generator_cpp, rviz_assimp_vendor, rviz_ogre_vendor]
--- stderr: rosidl_generator_cpp
/home/pt1/gits/ros2_eloquent/src/ros2/rosidl/rosidl_generator_cpp/test/test_traits.cpp:32:33: error: specialization of
template<class T> struct rosidl_generator_traits::is_message’ in different namespace [-fpermissive]
 struct rosidl_generator_traits::is_message<Message2>: std::true_type {};
                                 ^~~~~~~~~~~~~~~~~~~~
In file included from /home/pt1/gits/ros2_eloquent/build/rosidl_generator_cpp/rosidl_generator_cpp/rosidl_generator_cpp/msg/empty__traits.hpp:9:0,
                 from /home/pt1/gits/ros2_eloquent/build/rosidl_generator_cpp/rosidl_generator_cpp/rosidl_generator_cpp/msg/empty.hpp:8,
                 from /home/pt1/gits/ros2_eloquent/src/ros2/rosidl/rosidl_generator_cpp/test/test_traits.cpp:16:
/home/pt1/gits/ros2_eloquent/src/ros2/rosidl/rosidl_generator_cpp/include/rosidl_generator_cpp/traits.hpp:34:8: error:   from definition of ‘template<class T> struct rosidl_generator_traits::is_message’ [-fpermissive]
 struct is_message : std::false_type {};
        ^~~~~~~~~~
make[2]: *** [CMakeFiles/test_traits.dir/test/test_traits.cpp.o] Error 1
make[1]: *** [CMakeFiles/test_traits.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< rosidl_generator_cpp       [ Exited with code 2 ]
Aborted  <<< rviz_assimp_vendor
Aborted  <<< rviz_ogre_vendor

Summary: 94 packages finished [1h 11min 17s]
  1 package failed: rosidl_generator_cpp
  2 packages aborted: rviz_assimp_vendor rviz_ogre_vendor
  1 package had stderr output: rosidl_generator_cpp
  201 packages not processed```
#### Additional information
@DentOpt
Copy link

DentOpt commented May 1, 2020

Exactly same issue for ros2 Foxy on tinkerboard armv7l GNU/Linux

@clalancette
Copy link
Contributor

Debian is one of the Tier 3 platforms for Eloquent and Foxy. That means that while we aim to support it, its primarily a community effort to keep it running (see https://www.ros.org/reps/rep-2000.html#support-tiers for details).

Thus, we would happily review any pull requests to fix things on Debian (9 or 10), but we probably will not have the time to look into it ourselves.

@clalancette clalancette added bug Something isn't working help wanted Extra attention is needed labels May 1, 2020
@DentOpt
Copy link

DentOpt commented May 5, 2020

To solve the issue above, I needed to configure locale, install assimp via apt and update to newest CMAKE by building from source.

Remove check to False in Line 303 /usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py

cwd=os.path.abspath(str(setup_py.parent)), check=False, env=env)

However, now I get QT/Opengl errors.
Does anyone have experience if this is caused by an old opengl version?

[ 13%] Building CXX object CMakeFiles/rviz_common.dir/src/rviz_common/transformation_panel.cpp.o
In file included from /usr/include/arm-linux-gnueabihf/qt5/QtGui/qopenglextrafunctions.h:47:0,
                 from /usr/include/arm-linux-gnueabihf/qt5/QtGui/QtGui:55,
                 from /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/QtWidgetsDepends:4,
                 from /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/QtWidgets:3,
                 from /home/linaro/ros2_dashing/src/ros2/rviz/rviz_common/src/rviz_common/transformation_panel.cpp:40:
/usr/include/arm-linux-gnueabihf/qt5/QtGui/qopenglfunctions.h: In member function ‘void QOpenGLFunctions::glBindTexture(GLenum, GLuint)’:
/usr/include/arm-linux-gnueabihf/qt5/QtGui/qopenglfunctions.h:595:5: error: ‘::glBindTexture’ has not been declared
     ::glBindTexture(target, texture);
     ^~


/usr/include/arm-linux-gnueabihf/qt5/QtGui/qopenglfunctions.h: In member function ‘void QOpenGLFunctions::glVertexAttrib4fv(GLuint, const GLfloat*)’:
/usr/include/arm-linux-gnueabihf/qt5/QtGui/qopenglfunctions.h:2152:5: error: ‘::glVertexAttrib4fv’ has not been declared
     ::glVertexAttrib4fv(indx, values);
     ^~
/usr/include/arm-linux-gnueabihf/qt5/QtGui/qopenglfunctions.h: In member function ‘void QOpenGLFunctions::glVertexAttribPointer(GLuint, GLint, GLenum, GLboolean, GLsizei, const void*)’:
/usr/include/arm-linux-gnueabihf/qt5/QtGui/qopenglfunctions.h:2163:5: error: ‘::glVertexAttribPointer’ has not been declared
     ::glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
     ^~
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-gnu-zero-variadic-macro-arguments’ [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/rviz_common.dir/src/rviz_common/transformation_panel.cpp.o] Error 1
make[1]: *** [CMakeFiles/rviz_common.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< rviz_common	[ Exited with code 2 ]
Aborted  <<< tlsf_cpp                                                                                                 
Aborted  <<< ros2test
Aborted  <<< ros2msg                                       

Summary: 189 packages finished [3min 2s]
  1 package failed: rviz_common
  3 packages aborted: ros2msg ros2test tlsf_cpp
  2 packages had stderr output: CMake rviz_common
  79 packages not processed

@shoeffner
Copy link
Contributor

I had the same issue on Debian 9.

This seems to be a bug in gcc, and despite it saying the target milestone was 7 it still occurred when I installed gcc 7.5. Anyways, the original bug report states that:

namespace Foo 
{
    template <typename T>
    struct Meow
    {
    };
}

template <>
struct Foo::Meow<int>
{
};

failed, while

The code is accepted if a declaration (without definition) of the specialization is placed in the namespace.

So changing

template<>
struct rosidl_generator_traits::is_message<Message2>: std::true_type {};

to

namespace rosidl_generator_traits
{

template<>
struct is_message<Message2>: std::true_type {};

}

Resolves this issue. To keep the current functionality, one option would be to check the compiler, something along these lines (untested):

#if defined(__GNUC__)
  #if __GNUC__ > 7
template<>
struct rosidl_generator_traits::is_message<Message2>: std::true_type {};
  #else
namespace rosidl_generator_traits
{

template<>
struct is_message<Message2>: std::true_type {};

}
  #endif
#endif

But this might get messy over time.

In any case, here's the patch I mentioned above:

From 5f3845f0e915fcc26330cd86061dc79db11aa1b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20H=C3=B6ffner?= <info@sebastian-hoeffner.de>
Date: Wed, 5 Aug 2020 18:32:07 +0200
Subject: [PATCH] Declaring is_message in namespace rosidl_generator_traits.

Resolves issues with older GCC versions, as described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480

Resolves #479
---
 rosidl_generator_cpp/test/test_traits.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rosidl_generator_cpp/test/test_traits.cpp b/rosidl_generator_cpp/test/test_traits.cpp
index eb3d5fc..dc9dcc6 100644
--- a/rosidl_generator_cpp/test/test_traits.cpp
+++ b/rosidl_generator_cpp/test/test_traits.cpp
@@ -28,8 +28,13 @@ struct Message {};
 // Empty testing struct, with template instantiation
 struct Message2 {};
 
+namespace rosidl_generator_traits
+{
+
 template<>
-struct rosidl_generator_traits::is_message<Message2>: std::true_type {};
+struct is_message<Message2>: std::true_type {};
+
+}
 
 TEST(Test_rosidl_generator_traits, is_message) {
   // A message is not a service
-- 
2.11.0

@dirk-thomas
Copy link
Member

In any case, here's the patch I mentioned above:

@shoeffner If you would like this proposed patch to be reviewed and considered please create a pull request.

dirk-thomas pushed a commit that referenced this issue Aug 11, 2020
Resolves issues with older GCC versions, as described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480

Resolves #479

Signed-off-by: Sebastian Höffner <info@sebastian-hoeffner.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants