Ask Your Question
0

ros2 fails to build at rcl_logging_log4cxx

asked 2021-11-12 18:45:24 -0500

Legendary2 gravatar image

updated 2021-11-13 05:48:22 -0500

Hi, I was building ROS2-Galactic on my Mac and I encountered the following error which I have not been able to fix so far:

Finished <<< libyaml_vendor [3.76s]                                       
running egg_info

writing rosidl_generator_c.egg-info/PKG-INFO
writing dependency_links to rosidl_generator_c.egg-info/dependency_links.txt
writing entry points to rosidl_generator_c.egg-info/entry_points.txt
writing top-level names to rosidl_generator_c.egg-info/top_level.txt
reading manifest file 'rosidl_generator_c.egg-info/SOURCES.txt'
writing manifest file 'rosidl_generator_c.egg-info/SOURCES.txt'
In file included from /Users/henry/ros2_galactic/src/ros2/rcl_logging/rcl_logging_log4cxx/src/rcl_logging_log4cxx/rcl_logging_log4cxx.cpp:23:
In file included from /usr/local/include/log4cxx/logger.h:30:
In file included from /usr/local/include/log4cxx/helpers/appenderattachableimpl.h:27:
In file included from /usr/local/include/log4cxx/spi/appenderattachable.h:26:
In file included from /usr/local/include/log4cxx/logstring.h:28:
In file included from /usr/local/include/log4cxx/log4cxx.h:45:
/usr/local/include/log4cxx/boost-std-configuration.h:10:18: error: no type named 'shared_mutex' in namespace 'std'
    typedef std::shared_mutex shared_mutex;
            ~~~~~^
Starting >>> rcl_logging_spdlog
[ 49%] Built target test_validate_node_name
[ 88%] Linking CXX executable class_loader_fviz_test
[100%] Built target ament_cmake_python_build_rosidl_generator_c_egg
Finished <<< rviz_rendering_tests [3.62s]                                 
Finished <<< rcl_logging_noop [1.98s]                                     
[ 50%] Linking CXX executable test_allocators
[ 92%] Built target class_loader_fviz_test
In file included from /Users/henry/ros2_galactic/src/ros2/rcl_logging/rcl_logging_log4cxx/src/rcl_logging_log4cxx/rcl_logging_log4cxx.cpp:29:
In file included from /usr/local/include/log4cxx/patternlayout.h:27:
In file included from /usr/local/include/log4cxx/pattern/loggingeventpatternconverter.h:21:
/usr/local/include/log4cxx/pattern/patternconverter.h:76:44: warning: extra ';' inside a class [-Wextra-semi]
                DECLARE_LOG4CXX_PATTERN(PatternConverter);
                                                         ^
[ 96%] Linking CXX executable class_loader_unique_ptr_test
1 warning and 1 error generated.                                          
make[2]: *** [CMakeFiles/rcl_logging_log4cxx.dir/src/rcl_logging_log4cxx/rcl_logging_log4cxx.cpp.o] Error 1
make[1]: *** [CMakeFiles/rcl_logging_log4cxx.dir/all] Error 2
make: *** [all] Error 2
[ 52%] Built target test_allocators
-- Install configuration: ""                                              
-- Execute custom install script
-- Up-to-date symlink: /Users/henry/ros2_galactic/install/rosidl_generator_c/share/ament_index/resource_index/rosidl_generator_packages/rosidl_generator_c
-- Up-to-date symlink: /Users/henry/ros2_galactic/install/rosidl_generator_c/share/rosidl_generator_c/environment/pythonpath.sh
--- stderr: rcl_logging_log4cxx
In file included from /Users/henry/ros2_galactic/src/ros2/rcl_logging/rcl_logging_log4cxx/src/rcl_logging_log4cxx/rcl_logging_log4cxx.cpp:23:
In file included from /usr/local/include/log4cxx/logger.h:30:
In file included from /usr/local/include/log4cxx/helpers/appenderattachableimpl.h:27:
In file included from /usr/local/include/log4cxx/spi/appenderattachable.h:26:
In file included from /usr/local/include/log4cxx/logstring.h:28:
In file included from /usr/local/include/log4cxx/log4cxx.h:45:
/usr/local/include/log4cxx/boost-std-configuration.h:10:18: error: no type named 'shared_mutex' in namespace 'std'
    typedef std::shared_mutex shared_mutex;
            ~~~~~^
In file included from /Users/henry/ros2_galactic/src/ros2/rcl_logging/rcl_logging_log4cxx/src/rcl_logging_log4cxx/rcl_logging_log4cxx.cpp:29:
In file included from /usr/local/include/log4cxx/patternlayout.h:27:
In file included from /usr/local/include/log4cxx/pattern/loggingeventpatternconverter.h:21:
/usr/local/include/log4cxx/pattern/patternconverter.h:76:44: warning: extra ';' inside a class [-Wextra-semi]
                DECLARE_LOG4CXX_PATTERN(PatternConverter);
                                                         ^
1 warning and 1 error generated.
make[2]: *** [CMakeFiles/rcl_logging_log4cxx.dir/src/rcl_logging_log4cxx/rcl_logging_log4cxx.cpp.o] Error 1
make[1]: *** [CMakeFiles/rcl_logging_log4cxx.dir/all ...
(more)
edit retag flag offensive close merge delete

Comments

1

Possible to invoke colcon with the --event-handlers console_direct+ argument to get more detailed output? Unfortunately the make error doesn't lend any information to work with.

aprotyas gravatar image aprotyas  ( 2021-11-13 02:10:46 -0500 )edit

I've run this and will update the post with the error I'm getting. Thank you!

Legendary2 gravatar image Legendary2  ( 2021-11-13 05:42:14 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-11-14 03:02:31 -0500

aprotyas gravatar image

I would say this is a "bug" - the CMakeLists.txt file for rcl_logging_log4cxx does not default to the C++17 standard, and unfortunately std::shared_mutex is only a thing post-C++17. I'm not sure where the maintainers stand on this though, since rcl_logging_log4cxx has been recently removed entirely from rcl_logging. In any case, applying the changes from this PR should let you build. https://github.com/ros2/rcl_logging/p...

If applying the change is not possible, you will have to wait for the maintainers to either also remove rcl_logging_log4cxx from Galactic or to merge the linked PR into the galactic branch.

edit flag offensive delete link more

Comments

I'll give it a go. Thank you!

Legendary2 gravatar image Legendary2  ( 2021-11-14 12:16:07 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-11-12 18:41:46 -0500

Seen: 58 times

Last updated: Nov 14 '21