0
$\begingroup$

I am getting an error while building ROS workspace using catkin_make. I am not sure but it seems to be related with anaconda. Here are the details:-

yograj@yograj-Inspiron-5537:~/catkin_ws$ catkin_make Base path: /home/yograj/catkin_ws Source space: /home/yograj/catkin_ws/src Build space: /home/yograj/catkin_ws/build Devel space: /home/yograj/catkin_ws/devel Install space: /home/yograj/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/yograj/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/yograj/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /home/yograj/anaconda2/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/yograj/catkin_ws/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7 CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):   execute_process(/home/yograj/anaconda2/bin/python   "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py"   "/opt/ros/kinetic/share/catkin/cmake/../package.xml"   "/home/yograj/catkin_ws/build/catkin/catkin_generated/version/package.cmake") returned error code No such file or directory Call Stack (most recent call first):   /opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process)   /opt/ros/kinetic/share/catkin/cmake/all.cmake:151 (_catkin_package_xml)   /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)   CMakeLists.txt:52 (find_package)


-- Configuring incomplete, errors occurred! See also "/home/yograj/catkin_ws/build/CMakeFiles/CMakeOutput.log". See also "/home/yograj/catkin_ws/build/CMakeFiles/CMakeError.log". Makefile:1732: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Error 1 Invoking "make cmake_check_build_system" failed

Here is CMakeLists.txt

# toplevel CMakeLists.txt for a catkin workspace
# catkin/cmake/toplevel.cmake

cmake_minimum_required(VERSION 2.8.3)

set(CATKIN_TOPLEVEL TRUE)

# search for catkin within the workspace
set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}")
execute_process(COMMAND ${_cmd}
  RESULT_VARIABLE _res
  OUTPUT_VARIABLE _out
  ERROR_VARIABLE _err
  OUTPUT_STRIP_TRAILING_WHITESPACE
  ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT _res EQUAL 0 AND NOT _res EQUAL 2)
  # searching fot catkin resulted in an error
  string(REPLACE ";" " " _cmd_str "${_cmd}")
  message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}")
endif()

# include catkin from workspace or via find_package()
if(_res EQUAL 0)
  set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake")
  # include all.cmake without add_subdirectory to let it operate in same scope
  include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE)
  add_subdirectory("${_out}")

else()
  # use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
  # or CMAKE_PREFIX_PATH from the environment
  if(NOT DEFINED CMAKE_PREFIX_PATH)
    if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
      string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
    endif()
  endif()

  # list of catkin workspaces
  set(catkin_search_path "")
  foreach(path ${CMAKE_PREFIX_PATH})
    if(EXISTS "${path}/.catkin")
      list(FIND catkin_search_path ${path} _index)
      if(_index EQUAL -1)
        list(APPEND catkin_search_path ${path})
      endif()
    endif()
  endforeach()

  # search for catkin in all workspaces
  set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE)
  find_package(catkin QUIET
    NO_POLICY_SCOPE
    PATHS ${catkin_search_path}
    NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  unset(CATKIN_TOPLEVEL_FIND_PACKAGE)

  if(NOT catkin_FOUND)
    message(FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.")
  endif()
endif()

catkin_workspace()
$\endgroup$
  • $\begingroup$ Can you edit your post to include your CMakeLists.txt file? $\endgroup$ – koverman47 Jul 12 '18 at 14:34
  • $\begingroup$ when I run catkin build there is no error. $\endgroup$ – Yograj Singh Mandloi Jul 13 '18 at 10:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.