0
$\begingroup$

Rosanswers logo

Hi I followed the exact step by step procedure suggested at https://google-cartographer-ros.readthedocs.io/en/latest/compilation.html to build the cartographer package. I came to the build and install step without any problems. when i use this command "catkin_make_isolated --install --use-ninja" i get an error and i couldn't figure it out for days.

The error I get is as follows.

Base path: /home/pi/elk_ws
Source space: /home/pi/elk_ws/src
Build space: /home/pi/elk_ws/build_isolated
Devel space: /home/pi/elk_ws/devel_isolated
Install space: /home/pi/elk_ws/install_isolated
Additional make Arguments: -l4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~  traversing 15 packages in topological order:
~~  - actionlib_msgs
~~  - cartographer (plain cmake)
~~  - common_msgs
~~  - diagnostic_msgs
~~  - geometry_msgs
~~  - cartographer_ros_msgs
~~  - nav_msgs
~~  - sensor_msgs
~~  - rplidar_ros
~~  - shape_msgs
~~  - stereo_msgs
~~  - trajectory_msgs
~~  - visualization_msgs
~~  - cartographer_ros
~~  - cartographer_rviz
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

==> Processing catkin package: 'actionlib_msgs'
build.ninja exists, skipping explicit cmake invocation...
==> ninja build.ninja in '/home/pi/elk_ws/build_isolated/actionlib_msgs'
ninja: no work to do.
==> ninja -l4 in '/home/pi/elk_ws/build_isolated/actionlib_msgs'
[3/3] cd /home/pi/elk_ws/build_isolated/actionlib_msgs && /home/pi/elk_ws/build_isolated/actionlib_msgs/catkin_genera..._check_deps.py actionlib_msgs /home/pi/elk_ws/src/common_msgs/actionlib_msgs/msg/GoalStatus.msg actionlib_msgs/GoalID
==> ninja install in '/home/pi/elk_ws/build_isolated/actionlib_msgs'
[3/4] Install the project...
-- Install configuration: ""
-- Up-to-date: /home/pi/elk_ws/install_isolated/_setup_util.py
-- Up-to-date: /home/pi/elk_ws/install_isolated/env.sh
-- Up-to-date: /home/pi/elk_ws/install_isolated/setup.bash
-- Up-to-date: /home/pi/elk_ws/install_isolated/local_setup.bash
-- Up-to-date: /home/pi/elk_ws/install_isolated/setup.sh
-- Up-to-date: /home/pi/elk_ws/install_isolated/local_setup.sh
-- Up-to-date: /home/pi/elk_ws/install_isolated/setup.zsh
-- Up-to-date: /home/pi/elk_ws/install_isolated/local_setup.zsh
-- Up-to-date: /home/pi/elk_ws/install_isolated/.rosinstall
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/msg/GoalID.msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/msg/GoalStatus.msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/msg/GoalStatusArray.msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/cmake/actionlib_msgs-msg-paths.cmake
-- Up-to-date: /home/pi/elk_ws/install_isolated/include/actionlib_msgs
-- Up-to-date: /home/pi/elk_ws/install_isolated/include/actionlib_msgs/GoalStatus.h
-- Up-to-date: /home/pi/elk_ws/install_isolated/include/actionlib_msgs/GoalStatusArray.h
-- Up-to-date: /home/pi/elk_ws/install_isolated/include/actionlib_msgs/GoalID.h
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs/msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs/msg/GoalStatusArray.l
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs/msg/GoalStatus.l
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs/msg/GoalID.l
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/roseus/ros/actionlib_msgs/manifest.l
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/_package_GoalStatus.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/_package_GoalID.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/_package_GoalStatusArray.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/GoalStatusArray.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/actionlib_msgs-msg.asd
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/GoalStatus.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/_package.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/common-lisp/ros/actionlib_msgs/msg/GoalID.lisp
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/gennodejs/ros/actionlib_msgs
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/gennodejs/ros/actionlib_msgs/_index.js
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/gennodejs/ros/actionlib_msgs/msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/gennodejs/ros/actionlib_msgs/msg/_index.js
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/gennodejs/ros/actionlib_msgs/msg/GoalID.js
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/gennodejs/ros/actionlib_msgs/msg/GoalStatusArray.js
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/gennodejs/ros/actionlib_msgs/msg/GoalStatus.js
Listing /home/pi/elk_ws/devel_isolated/actionlib_msgs/lib/python2.7/dist-packages/actionlib_msgs ...
Listing /home/pi/elk_ws/devel_isolated/actionlib_msgs/lib/python2.7/dist-packages/actionlib_msgs/msg ...
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/__init__.py
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/msg
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/msg/__init__.py
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/msg/_GoalStatusArray.pyc
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/msg/_GoalID.pyc
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/msg/_GoalID.py
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/msg/_GoalStatus.pyc
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/msg/_GoalStatusArray.py
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/msg/_GoalStatus.py
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/msg/__init__.pyc
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/python2.7/dist-packages/actionlib_msgs/__init__.pyc
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/pkgconfig/actionlib_msgs.pc
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/cmake/actionlib_msgs-msg-extras.cmake
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/cmake/actionlib_msgs-extras.cmake
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/cmake/actionlib_msgsConfig.cmake
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/cmake/actionlib_msgsConfig-version.cmake
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/package.xml
-- Up-to-date: /home/pi/elk_ws/install_isolated/lib/actionlib_msgs/genaction.py
-- Up-to-date: /home/pi/elk_ws/install_isolated/share/actionlib_msgs/cmake/actionbuild.cmake
<== Finished processing package [1 of 15]: 'actionlib_msgs'

==> Processing plain cmake package: 'cartographer'
==> Building with env: '/home/pi/elk_ws/install_isolated/env.sh'
build.ninja exists, skipping explicit cmake invocation...
==> ninja build.ninja in '/home/pi/elk_ws/build_isolated/cartographer/install'
ninja: no work to do.
==> ninja -l4 in '/home/pi/elk_ws/build_isolated/cartographer/install'
[1/117] Linking CXX executable cartographer_pbstream
FAILED: cartographer_pbstream 
: && /usr/bin/c++  -O3 -DNDEBUG  -rdynamic CMakeFiles/cartographer_pbstream.dir/cartographer/io/pbstream_main.cc.o  -o cartographer_pbstream  -Wl,-rpath,/usr/local/lib:  libcartographer.a  /usr/lib/libceres.so.1.14.0  -lglog  /usr/lib/arm-linux-gnueabihf/libgflags.so.2.2.2  -llua5.2  -lm  -lboost_iostreams  -lboost_regex  -lglog  /usr/lib/arm-linux-gnueabihf/libgflags.so.2.2.2  -lpthread  -lcairo  /usr/local/lib/libprotobuf.so  /usr/local/lib/libabsl_leak_check.a  /usr/local/lib/libabsl_hash.a  /usr/local/lib/libabsl_bad_variant_access.a  /usr/local/lib/libabsl_city.a  /usr/local/lib/libabsl_raw_hash_set.a  /usr/local/lib/libabsl_bad_optional_access.a  /usr/local/lib/libabsl_hashtablez_sampler.a  /usr/local/lib/libabsl_str_format_internal.a  /usr/local/lib/libabsl_synchronization.a  /usr/local/lib/libabsl_stacktrace.a  /usr/local/lib/libabsl_graphcycles_internal.a  /usr/local/lib/libabsl_symbolize.a  /usr/local/lib/libabsl_malloc_internal.a  /usr/local/lib/libabsl_debugging_internal.a  /usr/local/lib/libabsl_demangle_internal.a  /usr/local/lib/libabsl_time.a  /usr/local/lib/libabsl_strings.a  /usr/local/lib/libabsl_strings_internal.a  /usr/local/lib/libabsl_throw_delegate.a  /usr/local/lib/libabsl_base.a  /usr/local/lib/libabsl_dynamic_annotations.a  /usr/local/lib/libabsl_spinlock_wait.a  -pthread  /usr/local/lib/libabsl_int128.a  /usr/local/lib/libabsl_civil_time.a  /usr/local/lib/libabsl_time_zone.a  -lpthread && :
/usr/bin/ld: /usr/local/lib/libabsl_spinlock_wait.a(spinlock_wait.cc.o): undefined reference to symbol '__atomic_load_8@@LIBATOMIC_1.0'
/usr/bin/ld: //lib/arm-linux-gnueabihf/libatomic.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
[6/117] Building CXX object CMakeFiles/cartographer.mapping.internal.3d.scan_matching.real_time_correlative_scan_matcher_3d_test.dir/cartographer/mapping/internal/3d/scan_matching/real_time_correlative_scan_matcher_3d_test.cc.o
ninja: build stopped: subcommand failed.
<== Failed to process package 'cartographer': 
  Command '['/home/pi/elk_ws/install_isolated/env.sh', 'ninja', '-l4']' returned non-zero exit status 1

Reproduce this error by running:
==> cd /home/pi/elk_ws/build_isolated/cartographer && /home/pi/elk_ws/install_isolated/env.sh ninja -l4

Command failed, exiting.

any help would be great. i am using raspberrypi 4b and rasbian buster OS. I installed ROS kinetic.


Originally posted by apprentice_user on ROS Answers with karma: 13 on 2022-01-31

Post score: 0


Original comments

Comment by Ramba on 2022-07-10:
I tried this but still I am getting the same error

AutoDiffLocalParameterization : public LocalParameterization {
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<CLIPPED>
/usr/bin/ld: libcartographer.a(histogram.cc.o): in function `cartographer::common::Histogram::ToString[abi:cxx11](int) const':
histogram.cc:(.text+0x372): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<std::basic_string_view<char, std::char_traits<char> > >)'
/usr/bin/ld: histogram.cc:(.text+0x94f): undefined reference to `absl::lts_20211102::strings_internal::AppendPieces(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::initializer_list<std::basic_string_view<char, std::char_traits<char> > >)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
<== Failed to process package 'cartographer': 
  Command '['ninja', '-j4', '-l4']' returned non-zero exit status 1.

Comment by jarvisschultz on 2022-07-11:
@Ramba, please don't post answers that are not actually answers. I've slightly edited your answer and reposted as a comment. If you are still having an issue, I'd recommend opening a new question and linking to this thread and explaining how the recommended fix is not working.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The part undefined reference to symbol __atomic_load_8 seems to be connected with similar problems:

Adding this line in the src/cartographer/CMakeLists.txt and _src/cartographer_ros/cartographer_ros/CMakeLists.txt set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")

  • there, with two ways of approach:

nano CMakeLists.txt

go to the bottom and add in the file:

set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")

I finally got it working by intsallint gcc 5 and trying again! sudo apt-get install gcc-5 g++-5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5

sudo update-alternatives --set gcc "/usr/bin/gcc-5"

Please comment if you tried these and what did you get.


Originally posted by ljaniec with karma: 3064 on 2022-01-31

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by osilva on 2022-02-01:
Very nice answer @ljaniec

Comment by apprentice_user on 2022-02-02:
thanks this solution solved my problem

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.