cartographer: install error about gtest

I’m installing cartographer_ros in ubuntu 14.04 and ROS indigo. gcc version is 4.8. Through the instruction of https://google-cartographer-ros.readthedocs.io/en/latest/ I build a ros-workspace named cartographer_ws(Cause I already have a workspace named catkin_ws) When I try to execute catkin_make_isolated --install --use-ninja

I got output like that:

==> Processing catkin package: 'cartographer_ros'
==> Building with env: '/home/tyler/cartographer_ws/install_isolated/env.sh'
==> cmake /home/tyler/cartographer_ws/src/cartographer_ros/cartographer_ros -DCATKIN_DEVEL_PREFIX=/home/tyler/cartographer_ws/devel_isolated/cartographer_ros -DCMAKE_INSTALL_PREFIX=/home/tyler/cartographer_ws/install_isolated -G Ninja in '/home/tyler/cartographer_ws/build_isolated/cartographer_ros'
-- Found required Ceres dependency: Eigen version 3.2.8 in /usr/local/include/eigen3
-- Found required Ceres dependency: Glog in /usr/include
-- Found Ceres version: 1.11.0 installed in: /home/tyler/cartographer_ws/install_isolated
-- Build type: Release
-- Using CATKIN_DEVEL_PREFIX: /home/tyler/cartographer_ws/devel_isolated/cartographer_ros
-- Using CMAKE_PREFIX_PATH: /home/tyler/cartographer_ws/install_isolated;/opt/ros/indigo
-- This workspace overlays: /home/tyler/cartographer_ws/install_isolated;/opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/tyler/cartographer_ws/build_isolated/cartographer_ros/test_results
-- Found gtest: gtests will be built
CMake Error at /opt/ros/indigo/share/catkin/cmake/test/gtest.cmake:154 (add_library):
  add_library cannot create imported target "gtest" because another target
  with the same name already exists.
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/all.cmake:147 (include)
  /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:36 (find_package)


CMake Error at /opt/ros/indigo/share/catkin/cmake/test/gtest.cmake:156 (add_library):
  add_library cannot create imported target "gtest_main" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/all.cmake:147 (include)
  /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:36 (find_package)


-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.18
-- Using these message generators: gencpp;genlisp;genpy
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- looking for PCL_COMMON
-- looking for PCL_OCTREE
-- looking for PCL_IO
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   iostreams
-- Configuring incomplete, errors occurred!
See also "/home/tyler/cartographer_ws/build_isolated/cartographer_ros/CMakeFiles/CMakeOutput.log".
See also "/home/tyler/cartographer_ws/build_isolated/cartographer_ros/CMakeFiles/CMakeError.log".
<== Failed to process package 'cartographer_ros': 
  Command '['/home/tyler/cartographer_ws/install_isolated/env.sh', 'cmake', '/home/tyler/cartographer_ws/src/cartographer_ros/cartographer_ros', '-DCATKIN_DEVEL_PREFIX=/home/tyler/cartographer_ws/devel_isolated/cartographer_ros', '-DCMAKE_INSTALL_PREFIX=/home/tyler/cartographer_ws/install_isolated', '-G', 'Ninja']' returned non-zero exit status 1

Reproduce this error by running:
==> cd /home/tyler/cartographer_ws/build_isolated/cartographer_ros && /home/tyler/cartographer_ws/install_isolated/env.sh cmake /home/tyler/cartographer_ws/src/cartographer_ros/cartographer_ros -DCATKIN_DEVEL_PREFIX=/home/tyler/cartographer_ws/devel_isolated/cartographer_ros -DCMAKE_INSTALL_PREFIX=/home/tyler/cartographer_ws/install_isolated -G Ninja

Command failed, exiting.

When I directly install in in the catkin_ws, I got the same error.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 20 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Quite wired. it linked to clang3.7 Relink it to g++, now everything works.

Conclude that: comment line 34 google_enable_tesing() in src/cartographer_ros/cartographer_ros/CMakeLists.txt

Thank you very much @SirVer
Really help a lot.