ros2 source install macos 10.15.1: qt_gui_cpp fails
I am building ROS2 from source on macOS 10.15.1 Catalina. I've followed the instructions here about dependencies, disabled SIP, ignored the ROS1<->2 bridge, and ignoring additional DDS vendors.
I run the following:
mkdir -p ~/ros2foxy/src
cd ~/ros2foxy
wget https://raw.githubusercontent.com/ros2/ros2/531a84a621771a6f4b947d1acad65eb9132f38de/ros2.repos
vcs import src < ros2.repos
and then colcon build --symlink-install
. The package qt_gui_cpp
fails (see log below).
I am confused by the introduced in macOS 10.15
error, which led me to update from 10.14 Mojave to 10.15 Catalina in the first place. It seems like it may have something to do with how xcodebuild
is handling deps?
$ xcodebuild -version
Xcode 11.2.1
Build version 11B500
$ colcon build --symlink-install --packages-select qt_gui_cpp
Starting >>> qt_gui_cpp
--- stderr: qt_gui_cpp
In file included from ros_pluginlib_plugin_provider_for_plugin_providers.sip:9:
In file included from /Users/candice/Documents/parkerdev/ros2_ws/src/ros-visualization/qt_gui_core/qt_gui_cpp/src/qt_gui_cpp_sip/../../include/qt_gui_cpp/ros_pluginlib_plugin_provider_for_plugin_providers.h:37:
In file included from /Users/candice/Documents/parkerdev/ros2_ws/src/ros-visualization/qt_gui_core/qt_gui_cpp/src/qt_gui_cpp_sip/../../include/qt_gui_cpp/ros_pluginlib_plugin_provider.h:46:
In file included from /Users/candice/Documents/parkerdev/ros2_ws/install/pluginlib/include/pluginlib/./class_loader.hpp:370:
/Users/candice/Documents/parkerdev/ros2_ws/install/pluginlib/include/pluginlib/./class_loader_imp.hpp:545:30: error: 'exists' is unavailable: introduced in macOS 10.15
if (pluginlib::impl::fs::exists(*it)) {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:1617:39: note: 'exists' has been explicitly marked unavailable here
inline _LIBCPP_INLINE_VISIBILITY bool exists(const path& __p) {
^
In file included from ros_pluginlib_plugin_provider_for_plugin_providers.sip:9:
In file included from /Users/candice/Documents/parkerdev/ros2_ws/src/ros-visualization/qt_gui_core/qt_gui_cpp/src/qt_gui_cpp_sip/../../include/qt_gui_cpp/ros_pluginlib_plugin_provider_for_plugin_providers.h:37:
In file included from /Users/candice/Documents/parkerdev/ros2_ws/src/ros-visualization/qt_gui_core/qt_gui_cpp/src/qt_gui_cpp_sip/../../include/qt_gui_cpp/ros_pluginlib_plugin_provider.h:46:
In file included from /Users/candice/Documents/parkerdev/ros2_ws/install/pluginlib/include/pluginlib/./class_loader.hpp:370:
/Users/candice/Documents/parkerdev/ros2_ws/install/pluginlib/include/pluginlib/./class_loader_imp.hpp:545:37: error: 'path' is unavailable: introduced in macOS 10.15
if (pluginlib::impl::fs::exists(*it)) {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:773:3: note: 'path' has been explicitly marked unavailable here
path(const _Source& __src, format = format::auto_format) {
^
/////// more of the same //////
In file included from recursive_plugin_provider.sip:8:
In file included from /Users/candice/Documents/parkerdev/ros2_ws/src/ros-visualization/qt_gui_core/qt_gui_cpp/src/qt_gui_cpp_sip/../../include/qt_gui_cpp/recursive_plugin_provider.h:37:
In file included from /Users/candice/Documents/parkerdev/ros2_ws/src/ros-visualization/qt_gui_core/qt_gui_cpp/src/qt_gui_cpp_sip/../../include/qt_gui_cpp/ros_pluginlib_plugin_provider_for_plugin_providers.h:37:
In file included from /Users/candice/Documents/parkerdev/ros2_ws/src/ros-visualization/qt_gui_core/qt_gui_cpp/src/qt_gui_cpp_sip/../../include/qt_gui_cpp/ros_pluginlib_plugin_provider.h:46:
In file included from /Users/candice/Documents/parkerdev/ros2_ws/install/pluginlib/include/pluginlib/./class_loader.hpp:370:
/Users/candice/Documents/parkerdev/ros2_ws/install/pluginlib/include/pluginlib/./class_loader_imp.hpp:628:49: error: 'path' is unavailable: introduced in macOS 10.15
std::string package_file_path = (parent / "package.xml").string();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:773:3: note: 'path' has been explicitly marked unavailable here
path(const _Source& __src, format = format::auto_format) {
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
20 errors generated.
make[3]: *** [siplibqt_gui_cpp_sipqt_gui_cppRosPluginlibPluginProvider_ForPluginProviders.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [siplibqt_gui_cpp_sipqt_gui_cppRosPluginlibPluginProvider_ForPlugins.o] Error 1
20 errors generated.
make[3]: *** [siplibqt_gui_cpp_sipqt_gui_cppRecursivePluginProvider.o] Error 1
make[2]: *** [src/qt_gui_cpp_sip/libqt_gui_cpp_sip.dylib] Error 2
make[1]: *** [src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all] Error 2
make: *** [all] Error 2
---
Failed <<< qt_gui_cpp [ Exited with code 2 ]
Summary: 0 packages finished [4.63s]
1 package failed: qt_gui_cpp
1 package had stderr output: qt_gui_cpp
Asked by plusk01 on 2019-11-28 20:51:21 UTC
Answers
Hey, I think I may have figured it out. The issue seems to be that XCode has turned on the C++17 features but not the C++17 standard library in versions less than macOS 10.15. Therefore to be able to compile in Mojave and older, you will need to add the -mmacosx-version-min=10.15
flag in your CMakeLists.txt
file as such:
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -mmacosx-version-min=10.15)
endif()
EDIT:
I do have to say that the issue with this method is that you are now targeting 10.15 instead of the version of macOS you are using. What that means is that anything you compile with this method can only be run on macOS 10.15.
Asked by zmk5 on 2020-01-28 00:10:49 UTC
Comments
I have a similar problem when I was building ros2 from the source. It's a different package called "pluginlib". Did you happen to solve the issue?
Asked by KKKKKyle on 2020-01-07 23:03:20 UTC