Skip to content

Building Micro-XRCE-DDS Agent fails with clang #54

Closed

Description

@ralph-lange

Describe the bug
When building the micro-ROS Agent for ROS 2 Rolling on Ubuntu 20.04, I received a build error during the build of the Micro-XRCE-DDS Agent.

To Reproduce

The problem seems to be the use of a log function with a dds::xrce::TransportAddress type.

In file included from /home/rl/micro-ros_rolling_ws/build/microxrcedds_agent/temp_install/spdlog-1.4.2/include/spdlog/common.h:38:
In file included from /home/rl/micro-ros_rolling_ws/build/microxrcedds_agent/temp_install/spdlog-1.4.2/include/spdlog/fmt/fmt.h:22:
/home/rl/micro-ros_rolling_ws/build/microxrcedds_agent/temp_install/spdlog-1.4.2/include/spdlog/fmt/bundled/core.h:844:50: error: no matching member function for call to 'map'
    type_constant<decltype(arg_mapper<Context>().map(std::declval<T>())),
                           ~~~~~~~~~~~~~~~~~~~~~~^~~
/home/rl/micro-ros_rolling_ws/build/microxrcedds_agent/temp_install/spdlog-1.4.2/include/spdlog/fmt/bundled/core.h:1000:10: note: in instantiation of template type alias 'mapped_type_constant' requested here
  return mapped_type_constant<Arg, Context>::value |
         ^
/home/rl/micro-ros_rolling_ws/build/microxrcedds_agent/temp_install/spdlog-1.4.2/include/spdlog/fmt/bundled/core.h:1001:11: note: in instantiation of function template specialization 'fmt::v6::internal::encode_types<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char>, dds::xrce::TransportAddress>' requested here
         (encode_types<Context, Args...>() << 4);

System information:

  • OS: Ubuntu 20.04
  • ROS 2: Rolling (as of 12 March 2021)

Additional context
Workaround: In Logger.hpp disable logging by #undef UAGENT_LOGGER_PROFILE

Activity

  1. ralph-lange commented on Mar 12, 2021

    @ralph-lange
    Author

    //Cc: @pablogs9

  2. ralph-lange commented on Mar 16, 2021

    @ralph-lange
    Author

    Just tried the tutorial under Foxy and ran into the same issue.

  3. pablogs9 commented on Mar 17, 2021

    @pablogs9
    Member

    Hi Ralph, this night the CI has passed OK: https://github.com/micro-ROS/micro_ros_setup/runs/2127704213?check_suite_focus=true

    I'm going to check this manually.

  4. ralph-lange commented on Mar 17, 2021

    @ralph-lange
    Author

    Hi @pablogs9, on a second machine (also Ubuntu 20.04 and ROS 2 Foxy) I could not reproduce the error - even after apt update && apt upgrade. Very strange.

  5. ralph-lange commented on Mar 17, 2021

    @ralph-lange
    Author

    Okay, I've found it: On the first machine I used clang not gcc.

  6. pablogs9 commented on Mar 18, 2021

    @pablogs9
    Member

    Ok, closing since solved. Thanks Ralph.

  7. ralph-lange commented on Mar 18, 2021

    @ralph-lange
    Author

    I would not call this solved, since clang is also a widely used compiler.

  8. pablogs9 commented on Mar 18, 2021

    @pablogs9
    Member

    @Acuadros95 could you test this compilation process using clang instead of gcc?

  9. changed the title [-]Building Micro-XRCE-DDS Agent fails under ROS 2 Rolling[/-] [+]Building Micro-XRCE-DDS Agent fails with clang[/+] on Mar 19, 2021
  10. Acuadros95 commented on Mar 23, 2021

    @Acuadros95
    Contributor

    @ralph-lange Hi Ralph, clang couldn't find the formatter for the dds::xrce::TransportAddress type.

    We have just merged a solution for this issue here, the Agent build should be fine with clang now. I am closing the issue, let us know if you encounter further problems regarding this problem.

  11. ralph-lange commented on Mar 23, 2021

    @ralph-lange
    Author

    Thank you for fixing this issue, @Acuadros95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions