ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

CMake error when invoking catkin_make_isolated (Mac OS High Sierra)

asked 2020-08-04 17:37:26 -0600

jacobe90 gravatar image

updated 2020-08-05 08:06:22 -0600

Hello everyone,

Ros newbie here, I am following the tutorial on Ros Wiki for installation of Ros Melodic for Mac OS X, and am encountering an issue when attempting to invoke catkin_make_isolated to build catkin packages. I'm running OS X 10.13 on a MacBook Air.

    $./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release -DCMAKE_MACOSX_RPATH=ON -DCMAKE_INSTALL_RPATH=$HOME/ros_catkin_ws/install_isolated/lib

Here is what happens when I run the above command:

Base path: /$HOME/ros_catkin_ws
Source space: /$HOME/ros_catkin_ws/src
Build space: /$HOME/ros_catkin_ws/build_isolated
Devel space: /$HOME/ros_catkin_ws/devel_isolated
Install space: /$HOME/ros_catkin_ws/install_isolated
Additional CMake Arguments: -DCMAKE_BUILD_TYPE=Release -DCMAKE_MACOSX_RPATH=ON 
DCMAKE_INSTALL_RPATH=/Users/JacobEpstein/ros_catkin_ws/install_isolated/lib

-- Using CATKIN_DEVEL_PREFIX: /$HOME/ros_catkin_ws/devel_isolated/catkin
-- Using CMAKE_PREFIX_PATH: 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using default Python package layout
-- Using empy: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /$HOME/ros_catkin_ws/build_isolated/catkin/test_results
-- Found gtest: gtests will be built
-- Using Python nosetests: /Library/Frameworks/Python.framework/Versions/3.6/bin/nosetests
-- catkin 0.7.28
-- BUILD_SHARED_LIBS is on
Traceback (most recent call last):
  File "/$HOME/ros_catkin_ws/src/catkin/cmake/interrogate_setup_dot_py.py", line 46, in <module>
    import setuptools
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 21, in <module>
    import setuptools.version
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/version.py", line 1, in <module>
    import pkg_resources
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1380
    raise SyntaxError(e) from e
                            ^
SyntaxError: invalid syntax
CMake Error at cmake/safe_execute_process.cmake:11 (message):

  execute_process(/$HOME/ros_catkin_ws/build_isolated/catkin/catkin_generated/env_cached.sh
  "/usr/bin/python"
  "/$HOME/ros_catkin_ws/src/catkin/cmake/interrogate_setup_dot_py.py"
  "catkin" "/$HOME/ros_catkin_ws/src/catkin/setup.py"
  "/$HOME/ros_catkin_ws/build_isolated/catkin/catkin_generated/setup_py_interrogation.cmake")
  returned error code 1
Call Stack (most recent call first):
  cmake/catkin_python_setup.cmake:46 (safe_execute_process)
  CMakeLists.txt:23 (catkin_python_setup)

-- Configuring incomplete, errors occurred!

I am pretty sure something is going wrong when interrogate_setup_dot_py.py interrogates setup.py, but I do not know why this is. Any help would be much appreciated!

For reference, here is my setup.py file:

from catkin_pkg.python_setup import generate_distutils_setup
from setuptools import setup
import os

catkin_scripts = [
    'bin/catkin_find',
    'bin/catkin_init_workspace',
    'bin/catkin_make',
    'bin/catkin_make_isolated',
    'bin/catkin_test_results',
    'bin/catkin_topological_order',
]

if os.name == 'nt':
    import sys
    import shutil
    if sys.version_info.major == 2:
        # On Windows\Python2, Python scripts making use of multiprocessing
        # have to meet several requirements to work.
        # (catkin_pkg makes use of it to do parallel package parser.)
        #
        # One is that the scripts have to be ended with .py extension;
        # Otherwise, it will manifest as ImportError.
        if not os.path.isdir('build/bin'):
            os.makedirs('build/bin')
        for script in catkin_scripts:
            shutil.copyfile(script, 'build/%s.py' % script)
        catkin_scripts = ['build/%s.py' % script for script in catkin_scripts]

d = generate_distutils_setup(
    packages=['catkin'],
    package_dir={'': 'python'},
    scripts=catkin_scripts,
)

setup(**d)

It is unfortunately impossible for me to share my catkin build output at this ... (more)

edit retag flag offensive close merge delete

Comments

can you share your setup.py?

Also is it possible for you to share catkin build output?

Tahir M. gravatar image Tahir M.  ( 2020-08-05 04:40:45 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-08-09 17:32:47 -0600

jacobe90 gravatar image

updated 2020-08-09 17:52:35 -0600

I ended up organizing my python by downloading Anaconda, and successfully started the catkin_make_isolated process in an Anaconda environment with python 2.7.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-08-04 17:37:26 -0600

Seen: 346 times

Last updated: Aug 09 '20