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

issues installing ros2 foxy fitzroy on macos 10.15 - rcutils

asked 2020-06-20 23:01:13 -0600

33thou gravatar image

updated 2020-09-17 13:07:56 -0600

I'm new to ROS, and trying to get up and running using these instructions:

  1. I've installed the system dependencies globally using homebrew
  2. I've installed the python dependencies in a Python virtual environment
  3. I did not disable SIP because I didn't feel comfortable doing this without understanding the implications. Reading #409 and #457 it sounds like some things might work and others won't, so I don't know if SIP causing the issues
  4. I performed the "Get the ROS 2 code" step which populated ~/ros2_foxy/src
  5. I did not install additional DDS vendors
  6. I tried running colcon build --symlink-install which began populating build, install, and log:

This resulted in:

Summary: 73 packages finished [12min 59s]
  1 package failed: rcutils
  3 packages aborted: ament_index_cpp fastrtps orocos_kdl
  5 packages had stderr output: foonathan_memory_vendor libyaml_vendor rcutils uncrustify_vendor yaml_cpp_vendor
  224 packages not processed

The error related to rcutils was:

--- stderr: rcutils
CMake Error at /usr/local/Cellar/cmake/3.17.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find PythonExtra (missing: PythonExtra_LIBRARIES)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.17.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  /Users/d/ros2_foxy/install/python_cmake_module/share/python_cmake_module/cmake/Modules/FindPythonExtra.cmake:216 (find_package_handle_standard_args)
  /Users/d/ros2_foxy/install/launch_testing_ament_cmake/share/launch_testing_ament_cmake/cmake/launch_testing_ament_cmake-extras.cmake:18 (find_package)
  /Users/d/ros2_foxy/install/launch_testing_ament_cmake/share/launch_testing_ament_cmake/cmake/launch_testing_ament_cmakeConfig.cmake:41 (include)
  /Users/d/ros2_foxy/install/ament_lint_auto/share/ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake:36 (find_package)
  CMakeLists.txt:128 (ament_lint_auto_find_test_dependencies)

It sounds from this error like some Python dependency might be missing, but it's not clear to me which one.

After this, I tried running running the environment setup. I tried this in bash (normally I run fish):

bash-5.0$ . ~/ros2_foxy/install/setup.bash 
bash-5.0$ which ros2
bash-5.0$ ros2
bash: ros2: command not found

I'm not sure where the ros2 command is supposed to be located. Inspecting setup.bash it doesn't seem to modify my $PATH, and searching for this name only turns up the directory ./src/ros2:

bash-5.0$ ls
build       install     log     ros2.repos  src
bash-5.0$ find . -name ros2
./src/ros2

Thank you for any assistance!

At this point I'll try installing on an Ubuntu machine instead, but I was really hoping to be able to develop using my mac.

edit retag flag offensive close merge delete

Comments

1

You can always try, but this is stated at the top of the page you link to (under System requirements):

We support macOS 10.14 (Mojave).

you seem to be trying to do this on 10.15, which is not supported at the moment.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-21 03:53:10 -0600 )edit

I didn't notice that, thanks for pointing it out.

33thou gravatar image 33thou  ( 2020-06-21 03:56:41 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-09-13 19:55:48 -0600

33thou gravatar image

updated 2020-09-17 13:52:57 -0600

Answering my own question here:

From FindPythonExtra.cmake I determined the culprit to be some kind of interaction between cmake, python3-config, brew, pyenv, and pipenv.

This was exacerbated by the cmake cache, which persisted incorrectly returned results from python3-config --ldflags between runs.

First, note that for debugging, it's useful to pass --cmake-args=" --log-level=STATUS" --cmake-clean-cache to colcon in order to see status messages and avoid caching broken values of the python3-config output between runs.

It appears that when you're using pyenv+pipenv and your virtual environment is pointing to a brew-installed python, python3-config returns incorrect information. For example:

➜ pipenv shell
(ros2_foxy) ➜ which python  
/Users/me/ros2_foxy/.venv/bin/python
(ros2_foxy) ➜ python --version        
Python 3.8.5
(ros2_foxy) ➜ which python3-config
/Users/me/.pyenv/shims/python3-config
(ros2_foxy) ➜ python3-config --ldflags
-L/Users/me/.pyenv/versions/3.7.6/lib/python3.7/config-3.7m-darwin -lpython3.7m -ldl -framework CoreFoundation
(ros2_foxy) ➜ python3-config --includes
-I/Users/me/.pyenv/versions/3.7.6/include/python3.7m -I/Users/me/.pyenv/versions/3.7.6/include/python3.7m

This results in the ros2 _FindPythonExtra.cmake_ file failing with the error Could NOT find PythonExtra (missing: PythonExtra_LIBRARIES).

On the other hand, if pipenv and pyenv are set up to use a pyenv-installed rather than brew-installed version of Python in the virtual environment, things seem to work. This can be done by explicitly setting an alternate version, e.g.

➜ pipenv shell --python 3.7

Now the results of python3-config are consistent with the virtual environment:

(ros2_foxy) ➜ which python
/Users/me/ros2_foxy/.venv/bin/python
(ros2_foxy) ➜ python --version
Python 3.7.6
(ros2_foxy) ➜ which python3-config
/Users/me/.pyenv/shims/python3-config
(ros2_foxy) ➜ python3-config --ldflags
-L/Users/me/.pyenv/versions/3.7.6/lib/python3.7/config-3.7m-darwin -lpython3.7m -ldl -framework CoreFoundation
(ros2_foxy) ➜ python3-config --includes
-I/Users/me/.pyenv/versions/3.7.6/include/python3.7m -I/Users/me/.pyenv/versions/3.7.6/include/python3.7m

And rcutils builds:

(ros2_foxy) ➜ colcon build --symlink-install --packages-select rcutils --cmake-args=" --log-level=STATUS" --cmake-clean-cache
[1.572s] WARNING:colcon.colcon_core.verb:Trigger build
Starting >>> rcutils 
[1.972s] WARNING:colcon.colcon_cmake.task.cmake.build:MAKE
[1.973s] WARNING:colcon.colcon_cmake.task.cmake.build:CONFIGURE ['--log-level=STATUS', '-DAMENT_CMAKE_SYMLINK_INSTALL=1']
[1.973s] WARNING:colcon.colcon_cmake.task.cmake.build:==================================================================
[1.973s] WARNING:colcon.colcon_cmake.task.cmake.build:context         <colcon_core.task.TaskContext object at 0x105ca6f10>
[1.974s] WARNING:colcon.colcon_cmake.task.cmake.build:exec            ['/usr/local/bin/cmake', '/Users/me/ros2_foxy/src/ros2/rcutils', '--log-level=STATUS', '-DAMENT_CMAKE_SYMLINK_INSTALL=1', '-DCMAKE_INSTALL_PREFIX=/Users/me/ros2_foxy/install/rcutils']
[1.974s] WARNING:colcon.colcon_cmake.task.cmake.build:cwd             /Users/me/ros2_foxy/build/rcutils
[1.974s] WARNING:colcon.colcon_cmake.task.cmake.build:==================================================================
--- stderr: rcutils                              
_python_version_no_dots 37
_python_version 3.7
_library_paths /Users/me/.pyenv/versions/3.7.6/lib/python3.7/config-3.7m-darwin
NO_SYSTEM_ENVIRONMENT_PATH 
Using PythonExtra_LIBRARIES: /Users/me/.pyenv/versions/3.7.6/lib/python3.7/config-3.7m-darwin/libpython3.7m.a
---
Finished <<< rcutils [6.88s]

Summary: 1 package finished [8.12s]
  1 package had stderr output: rcutils

Success! Well, sort of: I ... (more)

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2020-06-20 23:01:13 -0600

Seen: 1,713 times

Last updated: Sep 17 '20