I'm trying to install Cartographer from source. My setup is as follows:
- ROS2 Humble
- Jetson Orin AGX
- Ubuntu 22.04.5 LTS
- JetPack 6.2 (via
nvidia-jetpack-runtime 6.2+b77) CUDA 12.6- TensorRT 10.3.0 from
tensorrt 10.3.0.30-1+cuda12.5 - OpenCV with CUDA installed via
nvidia-opencv 6.2+b77 - Ouster OS1-32 Lidar
Commands I've run so far
In my ~/cart_7_2/src, I've run: git clone https://github.com/ros2/cartographer_ros.git.
Then from ~/cart_7_2, I've run rosdep update and rosdep install --from-paths src --ignore-src -r -y.
I then ran: colcon build --symlink-install.
Failed Attempt #1
The build failed here because abseil wasn't installed.
I then cloned the abseil repository: git clone https://github.com/abseil/abseil-cpp.git, built, and installed it successfully.
Failed Attempt #2
I then attempted the cartographer build again: colcon build --symlink-install
But the build failed:
Starting >>> cartographer Starting >>> cartographer_ros_msgs Starting >>> absl Starting >>> cartographer_ouster Finished <<< cartographer_ouster [3.05s] Finished <<< cartographer_ros_msgs [6.13s] --- stderr: absl CMake Warning at CMakeLists.txt:74 (message): A future Abseil release will default ABSL_PROPAGATE_CXX_STD to ON for CMake 3.8 and up. We recommend enabling this option to ensure your project still builds correctly. --- Finished <<< absl [7.31s] --- stderr: cartographer CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (Lua) does not match the name of the calling package (LuaGoogle). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): cmake/modules/FindLuaGoogle.cmake:211 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:41 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. In file included from /home/danny/cart_7_2/src/cartographer/cartographer/common/thread_pool.h:28, from /home/danny/cart_7_2/src/cartographer/cartographer/common/internal/testing/thread_pool_for_testing.h:26, from /home/danny/cart_7_2/src/cartographer/cartographer/common/internal/testing/thread_pool_for_testing.cc:17: /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:41:18: error: expected ‘;’ at end of member declaration 41 | State GetState() LOCKS_EXCLUDED(mutex_); | ^ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:41:35: error: ‘mutex_’ has not been declared 41 | State GetState() LOCKS_EXCLUDED(mutex_); | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:44:45: error: expected ‘;’ at end of member declaration 44 | void SetWorkItem(const WorkItem& work_item) LOCKS_EXCLUDED(mutex_); | ^ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:44:62: error: ‘mutex_’ has not been declared 44 | void SetWorkItem(const WorkItem& work_item) LOCKS_EXCLUDED(mutex_); | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:44:47: error: ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ cannot be overloaded with ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ 44 | void SetWorkItem(const WorkItem& work_item) LOCKS_EXCLUDED(mutex_); | ^~~~~~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:41:20: note: previous declaration ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ 41 | State GetState() LOCKS_EXCLUDED(mutex_); | ^~~~~~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:48:52: error: expected ‘;’ at end of member declaration 48 | void AddDependency(std::weak_ptr<Task> dependency) LOCKS_EXCLUDED(mutex_); | ^ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:48:69: error: ‘mutex_’ has not been declared 48 | void AddDependency(std::weak_ptr<Task> dependency) LOCKS_EXCLUDED(mutex_); | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:48:54: error: ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ cannot be overloaded with ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ 48 | void AddDependency(std::weak_ptr<Task> dependency) LOCKS_EXCLUDED(mutex_); | ^~~~~~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:41:20: note: previous declaration ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ 41 | State GetState() LOCKS_EXCLUDED(mutex_); | ^~~~~~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:55:16: error: expected ‘;’ at end of member declaration 55 | void Execute() LOCKS_EXCLUDED(mutex_); | ^ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:55:33: error: ‘mutex_’ has not been declared 55 | void Execute() LOCKS_EXCLUDED(mutex_); | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:55:18: error: ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ cannot be overloaded with ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ 55 | void Execute() LOCKS_EXCLUDED(mutex_); | ^~~~~~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:41:20: note: previous declaration ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ 41 | State GetState() LOCKS_EXCLUDED(mutex_); | ^~~~~~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:58:54: error: expected ‘;’ at end of member declaration 58 | void SetThreadPool(ThreadPoolInterface* thread_pool) LOCKS_EXCLUDED(mutex_); | ^ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:58:71: error: ‘mutex_’ has not been declared 58 | void SetThreadPool(ThreadPoolInterface* thread_pool) LOCKS_EXCLUDED(mutex_); | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:58:56: error: ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ cannot be overloaded with ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ 58 | void SetThreadPool(ThreadPoolInterface* thread_pool) LOCKS_EXCLUDED(mutex_); | ^~~~~~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:41:20: note: previous declaration ‘int cartographer::common::Task::LOCKS_EXCLUDED(int)’ 41 | State GetState() LOCKS_EXCLUDED(mutex_); | ^~~~~~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:64:12: error: expected ‘;’ at end of member declaration 64 | WorkItem work_item_ GUARDED_BY(mutex_); | ^~~~~~~~~~ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:64:34: error: ‘mutex_’ has not been declared 64 | WorkItem work_item_ GUARDED_BY(mutex_); | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:65:24: error: expected ‘;’ at end of member declaration 65 | ThreadPoolInterface* thread_pool_to_notify_ GUARDED_BY(mutex_) = nullptr; | ^~~~~~~~~~~~~~~~~~~~~~ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:65:58: error: ‘mutex_’ has not been declared 65 | ThreadPoolInterface* thread_pool_to_notify_ GUARDED_BY(mutex_) = nullptr; | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:65:75: error: invalid pure specifier (only ‘= 0’ is allowed) before ‘;’ token 65 | ThreadPoolInterface* thread_pool_to_notify_ GUARDED_BY(mutex_) = nullptr; | ^ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:65:47: error: ‘int cartographer::common::Task::GUARDED_BY(int)’ cannot be overloaded with ‘int cartographer::common::Task::GUARDED_BY(int)’ 65 | ThreadPoolInterface* thread_pool_to_notify_ GUARDED_BY(mutex_) = nullptr; | ^~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:64:23: note: previous declaration ‘int cartographer::common::Task::GUARDED_BY(int)’ 64 | WorkItem work_item_ GUARDED_BY(mutex_); | ^~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:66:9: error: expected ‘;’ at end of member declaration 66 | State state_ GUARDED_BY(mutex_) = NEW; | ^~~~~~ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:66:27: error: ‘mutex_’ has not been declared 66 | State state_ GUARDED_BY(mutex_) = NEW; | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:66:40: error: invalid pure specifier (only ‘= 0’ is allowed) before ‘;’ token 66 | State state_ GUARDED_BY(mutex_) = NEW; | ^ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:66:16: error: ‘int cartographer::common::Task::GUARDED_BY(int)’ cannot be overloaded with ‘int cartographer::common::Task::GUARDED_BY(int)’ 66 | State state_ GUARDED_BY(mutex_) = NEW; | ^~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:64:23: note: previous declaration ‘int cartographer::common::Task::GUARDED_BY(int)’ 64 | WorkItem work_item_ GUARDED_BY(mutex_); | ^~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:67:16: error: expected ‘;’ at end of member declaration 67 | unsigned int uncompleted_dependencies_ GUARDED_BY(mutex_) = 0; | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:67:42: error: ‘int cartographer::common::Task::GUARDED_BY(int)’ cannot be overloaded with ‘int cartographer::common::Task::GUARDED_BY(int)’ 67 | unsigned int uncompleted_dependencies_ GUARDED_BY(mutex_) = 0; | ^~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:64:23: note: previous declaration ‘int cartographer::common::Task::GUARDED_BY(int)’ 64 | WorkItem work_item_ GUARDED_BY(mutex_); | ^~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:68:19: error: expected ‘;’ at end of member declaration 68 | std::set<Task*> dependent_tasks_ GUARDED_BY(mutex_); | ^~~~~~~~~~~~~~~~ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:68:47: error: ‘mutex_’ has not been declared 68 | std::set<Task*> dependent_tasks_ GUARDED_BY(mutex_); | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:68:36: error: ‘int cartographer::common::Task::GUARDED_BY(int)’ cannot be overloaded with ‘int cartographer::common::Task::GUARDED_BY(int)’ 68 | std::set<Task*> dependent_tasks_ GUARDED_BY(mutex_); | ^~~~~~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/task.h:64:23: note: previous declaration ‘int cartographer::common::Task::GUARDED_BY(int)’ 64 | WorkItem work_item_ GUARDED_BY(mutex_); | ^~~~~~~~~~ In file included from /home/danny/cart_7_2/src/cartographer/cartographer/common/internal/testing/thread_pool_for_testing.h:26, from /home/danny/cart_7_2/src/cartographer/cartographer/common/internal/testing/thread_pool_for_testing.cc:17: /home/danny/cart_7_2/src/cartographer/cartographer/common/thread_pool.h:67:58: error: expected ‘;’ at end of member declaration 67 | std::weak_ptr<Task> Schedule(std::unique_ptr<Task> task) | ^ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/thread_pool.h:68:22: error: ‘mutex_’ has not been declared 68 | LOCKS_EXCLUDED(mutex_) override; | ^~~~~~ /home/danny/cart_7_2/src/cartographer/cartographer/common/thread_pool.h:73:46: error: expected ‘;’ at end of member declaration 73 | void NotifyDependenciesCompleted(Task* task) LOCKS_EXCLUDED(mutex_) override; | ^ | ; /home/danny/cart_7_2/src/cartographer/cartographer/common/thread_pool.h:73:63: error: ‘mutex_’ has not been declared 73 | void NotifyDependenciesCompleted(Task* task) LOCKS_EXCLUDED(mutex_) override; Failed Attempt #3
I assumed these errors were caused by missing or improperly handled thread-safety annotations. So I modified CMakeLists.txt in the cartographer package by adding this line:
# Define macros to disable thread-safety attributes if not using Clang if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") add_definitions(-DTHREAD_ANNOTATION_ATTRIBUTE__(x)=) endif() I attempted another rebuild: colcon build --symlink-install, but got this error:
Starting >>> cartographer Starting >>> cartographer_ros_msgs Starting >>> absl Starting >>> cartographer_ouster --- stderr: absl CMake Warning at CMakeLists.txt:74 (message): A future Abseil release will default ABSL_PROPAGATE_CXX_STD to ON for CMake 3.8 and up. We recommend enabling this option to ensure your project still builds correctly. --- Finished <<< absl [2.59s] Finished <<< cartographer_ouster [3.11s] Finished <<< cartographer_ros_msgs [5.09s] --- stderr: cartographer CMake Warning (dev) at CMakeLists.txt:21: Syntax Warning in cmake code at column 53 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (Lua) does not match the name of the calling package (LuaGoogle). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): cmake/modules/FindLuaGoogle.cmake:211 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:47 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [googletest/CMakeFiles/gtest.dir/build.make:76: googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:2944: googletest/CMakeFiles/gtest.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... /bin/sh: 1: Syntax error: "(" unexpected /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:377: CMakeFiles/cartographer.dir/cartographer/common/fixed_ratio_sampler.cc.o] Error 2 gmake[2]: *** Waiting for unfinished jobs.... gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:405: CMakeFiles/cartographer.dir/cartographer/common/internal/ceres_solver_options.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:419: CMakeFiles/cartographer.dir/cartographer/common/internal/testing/thread_pool_for_testing.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:363: CMakeFiles/cartographer.dir/cartographer/common/configuration_file_resolver.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:391: CMakeFiles/cartographer.dir/cartographer/common/histogram.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:447: CMakeFiles/cartographer.dir/cartographer/common/task.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:433: CMakeFiles/cartographer.dir/cartographer/common/lua_parameter_dictionary.cc.o] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:335: CMakeFiles/cartographer.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2 --- Failed <<< cartographer [5.42s, exited with code 2] Summary: 3 packages finished [6.05s] 1 package failed: cartographer 2 packages had stderr output: absl cartographer 2 packages not processed Failed Attempt #4
I assumed these errors suggested something is setting CXX or CXXFLAGS incorrectly, so I attempted the build again by running:
unset CXX CXXFLAGS colcon build \ --symlink-install \ --cmake-clean-cache \ --cmake-args -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON The build failed again - this time with the following errors:
[0.740s] colcon.colcon_ros.prefix_path.ament WARNING The path '/home/danny/cart_7_2/install/cartographer_ouster' in the environment variable AMENT_PREFIX_PATH doesn't exist Starting >>> cartographer Starting >>> cartographer_ros_msgs Starting >>> absl Starting >>> cartographer_ouster Finished <<< cartographer_ouster [3.59s] --- stderr: cartographer CMake Warning (dev) at CMakeLists.txt:21: Syntax Warning in cmake code at column 53 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (Lua) does not match the name of the calling package (LuaGoogle). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): cmake/modules/FindLuaGoogle.cmake:211 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:47 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [googletest/CMakeFiles/gtest.dir/build.make:76: googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:2944: googletest/CMakeFiles/gtest.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... /bin/sh: 1: Syntax error: "(" unexpected /bin/sh: 1: Syntax error: "(" unexpected /bin/sh: 1: Syntax error: "(" unexpected /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:363: CMakeFiles/cartographer.dir/cartographer/common/configuration_file_resolver.cc.o] Error 2 gmake[2]: *** Waiting for unfinished jobs.... /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:377: CMakeFiles/cartographer.dir/cartographer/common/fixed_ratio_sampler.cc.o] Error 2 gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:391: CMakeFiles/cartographer.dir/cartographer/common/histogram.cc.o] Error 2 gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:405: CMakeFiles/cartographer.dir/cartographer/common/internal/ceres_solver_options.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:419: CMakeFiles/cartographer.dir/cartographer/common/internal/testing/thread_pool_for_testing.cc.o] Error 2 gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:447: CMakeFiles/cartographer.dir/cartographer/common/task.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:433: CMakeFiles/cartographer.dir/cartographer/common/lua_parameter_dictionary.cc.o] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:335: CMakeFiles/cartographer.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2 --- Failed <<< cartographer [11.6s, exited with code 2] Aborted <<< absl [20.8s] Aborted <<< cartographer_ros_msgs [20.9s] Summary: 1 package finished [21.6s] 1 package failed: cartographer 2 packages aborted: absl cartographer_ros_msgs 3 packages had stderr output: absl cartographer cartographer_ros_msgs 2 packages not processed Failed Attempt #5
Based on these errors, I assumed that sh is being used instead of bash, so I tried a workaround that explicitly forces bash as the shell for build commands running this command:
colcon build \ --symlink-install \ --cmake-clean-cache \ --cmake-args \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ -DCMAKE_SH=/bin/bash However, I got these errors:
[0.755s] colcon.colcon_ros.prefix_path.ament WARNING The path '/home/danny/cart_7_2/install/cartographer_ouster' in the environment variable AMENT_PREFIX_PATH doesn't exist Starting >>> cartographer Starting >>> cartographer_ros_msgs Starting >>> absl Starting >>> cartographer_ouster Finished <<< cartographer_ouster [4.97s] --- stderr: cartographer CMake Warning (dev) at CMakeLists.txt:21: Syntax Warning in cmake code at column 53 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (Lua) does not match the name of the calling package (LuaGoogle). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): cmake/modules/FindLuaGoogle.cmake:211 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:47 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning: Manually-specified variables were not used by the project: CMAKE_SH /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [googletest/CMakeFiles/gtest.dir/build.make:76: googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:2944: googletest/CMakeFiles/gtest.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:363: CMakeFiles/cartographer.dir/cartographer/common/configuration_file_resolver.cc.o] Error 2 gmake[2]: *** Waiting for unfinished jobs.... /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:377: CMakeFiles/cartographer.dir/cartographer/common/fixed_ratio_sampler.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:391: CMakeFiles/cartographer.dir/cartographer/common/histogram.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:405: CMakeFiles/cartographer.dir/cartographer/common/internal/ceres_solver_options.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:419: CMakeFiles/cartographer.dir/cartographer/common/internal/testing/thread_pool_for_testing.cc.o] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:335: CMakeFiles/cartographer.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2 --- Failed <<< cartographer [10.6s, exited with code 2] Aborted <<< absl [17.9s] Aborted <<< cartographer_ros_msgs [18.0s] Summary: 1 package finished [18.6s] 1 package failed: cartographer 2 packages aborted: absl cartographer_ros_msgs 3 packages had stderr output: absl cartographer cartographer_ros_msgs 2 packages not processed Failed Attempt #6
So I tried to force Make to use bash by exporting SHELL. I added a shell override to my environment:
export SHELL=/bin/bash and attempted to rebuild again:
colcon build \ --symlink-install \ --cmake-clean-cache \ --cmake-args -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON However, the build failed again:
[0.742s] colcon.colcon_ros.prefix_path.ament WARNING The path '/home/danny/cart_7_2/install/cartographer_ouster' in the environment variable AMENT_PREFIX_PATH doesn't exist Starting >>> cartographer Starting >>> cartographer_ros_msgs Starting >>> absl Starting >>> cartographer_ouster Finished <<< cartographer_ouster [3.97s] --- stderr: cartographer CMake Warning (dev) at CMakeLists.txt:21: Syntax Warning in cmake code at column 53 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (Lua) does not match the name of the calling package (LuaGoogle). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): cmake/modules/FindLuaGoogle.cmake:211 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:47 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [googletest/CMakeFiles/gtest.dir/build.make:76: googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:2944: googletest/CMakeFiles/gtest.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... /bin/sh: 1: Syntax error: "(" unexpected /bin/sh: 1: Syntax error: "(" unexpected /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:405: CMakeFiles/cartographer.dir/cartographer/common/internal/ceres_solver_options.cc.o] Error 2 gmake[2]: *** Waiting for unfinished jobs.... gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:363: CMakeFiles/cartographer.dir/cartographer/common/configuration_file_resolver.cc.o] Error 2 gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:377: CMakeFiles/cartographer.dir/cartographer/common/fixed_ratio_sampler.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:391: CMakeFiles/cartographer.dir/cartographer/common/histogram.cc.o] Error 2 /bin/sh: 1: Syntax error: "(" unexpected gmake[2]: *** [CMakeFiles/cartographer.dir/build.make:419: CMakeFiles/cartographer.dir/cartographer/common/internal/testing/thread_pool_for_testing.cc.o] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:335: CMakeFiles/cartographer.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2 --- Failed <<< cartographer [11.7s, exited with code 2] Aborted <<< absl [16.7s] Aborted <<< cartographer_ros_msgs [16.9s] Summary: 1 package finished [17.5s] 1 package failed: cartographer If anyone has any suggestions on how to install Cartographer for ROS2 Humble, it'd be much appreciated!