[Documentation] [TitleIndex] [WordIndex

Installation Instructions for Kinetic in OS X

This page describes how to install ROS Kinetic on OS X. OS X is not officially supported by ROS and the installation might fail.

Install guide for Melodic is now available: melodic/Installation/macOS/Homebrew/Source

This is a work in progress! It really won't work right now...

Setup

Homebrew

First, go to http://brew.sh to install homebrew and install some additional software:

Add our ROS dependencies tap and the Homebrew science tap so you can get some non-standard formulae:

Note: if you are upgrading from previous ROS distro try this before installing:

$ brew untap ros/DISTRO

In general it is not recommended to try and install multiple ROS versions at the same time on OS X due to conflicting system dependencies.

Setup Environment

You will need to tell python about modules installed by homebrew. The recommended way of doing this are the following commands:

Additional Tools

Finally, we need to install a few ROS python tools using 'pip'.

If you don't already have pip, install it with:

$ brew install python  # brew Python comes with pip and is installed as python2
$ sudo -H python2 -m pip install -U pip  # Update pip
$ sudo -H python2 -m pip install wxPython # Install python-wxtools

Install the following packages using 'pip':

In order to use rosdep, we need to initialize it:

Installation

Start by building the core ROS packages.

Building the catkin Packages

ROS is in the process of converting to the catkin build system, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.

Create a catkin Workspace

In order to build the core packages, you will need a catkin workspace. Create one now:

  • $ mkdir ~/ros_catkin_ws
    $ cd ~/ros_catkin_ws

Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:

Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

  • $ rosinstall_generator desktop_full --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-full-wet.rosinstall
    $ wstool init -j8 src kinetic-desktop-full-wet.rosinstall

Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries

  • $ rosinstall_generator desktop --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-wet.rosinstall
    $ wstool init -j8 src kinetic-desktop-wet.rosinstall

ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

  • $ rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
    $ wstool init -j8 src kinetic-ros_comm-wet.rosinstall

This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.

In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:

$ rosinstall_generator robot --rosdistro kinetic --deps --wet-only --tar > kinetic-robot-wet.rosinstall
$ wstool init -j8 src kinetic-robot-wet.rosinstall

If wstool init fails or is interrupted, you can resume the download by running:

wstool update -j 4 -t src

Resolving Dependencies

Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:

  • $ rosdep install --from-paths src --ignore-src --rosdistro kinetic -y

This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.

The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.

After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.

Building the catkin Workspace

Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.

Invoke catkin_make_isolated:

  • $ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).

Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/kinetic argument to your catkin_make_isolated call.

For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/kinetic just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.

Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.

Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.

Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:

  • $ source ~/ros_catkin_ws/install_isolated/setup.bash

Maintaining a Source Checkout

If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.

Update the workspace

To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.

$ mv -i hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old
$ rosinstall_generator desktop_full --rosdistro hydro --deps --wet-only --tar > hydro-desktop-full-wet.rosinstall

Then, compare the new rosinstall file to the old version to see which packages will be updated:

$ diff -u hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old

If you're satified with these changes, incorporate the new rosinstall file into the workspace and update your workspace:

$ wstool merge -t src hydro-desktop-full-wet.rosinstall
$ wstool update -t src

Rebuild your workspace

Now that the workspace is up to date with the latest sources, rebuild it:

$ ./src/catkin/bin/catkin_make_isolated --install

If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace

Once your workspace has been rebuilt, you should source the setup files again:

$ source ~/ros_catkin_ws/install_isolated/setup.bash

Troubleshooting

In this section feel free to compile any tips or workarounds found for installing Kinetic on OS X.

Troubleshooting from previous releases of ROS are located here:

os/OSX/Homebrew/troubleshooting

'No definition of [google-mock] for OS [osx]' error during rosdep install

Add --skip-keys google-mock to rosdep install

Eigen numext issues

Ran into issues with Eigen complaining about numext. Includes appeared to be optional so edited src/opencv3/opencv_contrib/rgbd/src/odometry.cpp to remove them.

PyQt5 module not found

Be sure to install PyQt5 with Python 2.7 support:

If PyQt5 is already installed:

Qt naming issue

Fix some path names when looking for sip stuff during install

More Qt naming issues

During the build process, ld complains about -lQtCore et al. In both build_isolated/qt_gui_cpp/sip/qt_gui_cpp_sip/Makefile and devel_isolated/rviz/bin/sip/rviz_sip/Makefile, the LIBS variable needs the -lQtX flags changed to /usr/local/lib/QtX.framework/QtX (were at end of line).

Wrong inclusion of some header files

During the build process, the compiler may include the wrong header file from kernel framework instead of standard library, which may cause "no member named xxx in the global namespace".

It's reported that the nodelet_tutorial_math and rqt_gui_cpp packages have such problem.

There are 2 workarouds for this issue, for details, you can refer to the links below:

https://gist.github.com/bgromov/0db00b3e7edae34c0d289d4649369f44

https://github.com/ros/rosdistro/issues/13333

DYLD_LIBRARY_PATH Problems

Copying /usr/bin/env to /usr/local/bin effectively removes SIP checks for env acting as the script interpreter allowing DYLD_LIBRARY_PATH to be passed through. Unfortunately bash is also considered protected so need to set the variable in /opt/ros/<ROS_DISTRO>/bin/rosrun:

Also, some old errors can be found here:

empy fails

Download the package directly from the author: http://www.alcyone.com/software/empy/empy-latest.tar.gz and install manually:

sudo pip uninstall empy
tar xzf empy-latest.tar.gz
cd empy-3.3
sudo python setup.py install

tf2 fails

TF2 is not necessary to build ROS. The easiest way to fix this is to delete the tf2 folders.

pydot fails to install

See:

PyQWT fails to install from brew

When running rosdep on your variant if it tries to install pyqwt and fails with:

executing command [brew install pyqwt]
==> Downloading http://sourceforge.net/projects/pyqwt/files/pyqwt5/PyQwt-5.2.0/PyQwt-5.2.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/pyqwt-5.2.0.tar.gz
==> Patching
patching file configure/configure.py
==> python configure.py --module-install-path=/usr/local/Cellar/pyqwt/5.2.0/lib/python2.7/site-packages/PyQt4/Qwt5 --sip-install-path=/usr/local/Cellar/pyqwt/5.2.0/share/sip/Qwt5 --uic-install-path=/u
 'timelines': [],
 'trace': '',
 'uic_install_path': '/usr/local/Cellar/pyqwt/5.2.0/lib/python2.7/site-packages/PyQt4'}

Requires at least PyQt-4.2 and its development tools.

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

ERROR: the following rosdeps failed to install
  homebrew: command [brew install pyqwt] failed

Then you need to make sure your PYTHONPATH has the homebrew path added to it (see here. This is part of the instructions above and can be seen as a caveat of pyqt (brew info pyqt).

pcl build problems

Resolving the problems with building PCL 1.6 on OS X is on going. When building the desktop variant, PCL is included but not explicitly required. Therefore the easiest method to get around the PCL build problems is to remove it from the workspace:

camera_calibration_parsers build problems

When building camera_calibration_parsers you might get:

==> Processing catkin package: 'camera_calibration_parsers'
==> Building with env: '/opt/ros/hydro/env_cached.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/bcharrow/ros_catkin_ws/build_isolated/camera_calibration_parsers'
==> make -j2 in '/Users/bcharrow/ros_catkin_ws/build_isolated/camera_calibration_parsers'
[ 25%] Building CXX object CMakeFiles/camera_calibration_parsers.dir/src/parse_yml.cpp.o
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp: In function ‘void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)’:
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:53: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"rows")) >> rows’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:55: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"cols")) >> cols’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:59: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = int](((const int&)((const int*)(& i)))) >> *(m->camera_calibration_parsers::SimpleMatrix::data + ((double*)(((long unsigned int)i) * 8ul)))’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp: In function ‘bool camera_calibration_parsers::readCalibrationYml(std::istream&, std::string&, sensor_msgs::CameraInfo&)’:
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:119: error: ‘class YAML::Parser’ has no member named ‘GetNextDocument’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:121: error: ‘class YAML::Node’ has no member named ‘FindValue’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:122: error: no match for ‘operator>>’ in ‘* name_node >> camera_name’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:126: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) [with Key = char [12]](((const char (&)[12])(& camera_calibration_parsers::WIDTH_YML_NAME))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::width’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:127: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) [with Key = char [13]](((const char (&)[13])(& camera_calibration_parsers::HEIGHT_YML_NAME))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::height’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:138: error: ‘class YAML::Node’ has no member named ‘FindValue’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:139: error: no match for ‘operator>>’ in ‘* model_node >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::distortion_model’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:148: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"rows")) >> D_rows’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:149: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"cols")) >> D_cols’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:153: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = int](((const int&)((const int*)(& i)))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::D. std::vector<_Tp, _Alloc>::operator[] [with _Tp = double, _Alloc = std::allocator<double>](((long unsigned int)i))’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
make[2]: *** [CMakeFiles/camera_calibration_parsers.dir/src/parse_yml.cpp.o] Error 1
make[1]: *** [CMakeFiles/camera_calibration_parsers.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'camera_calibration_parsers':
  Command '/opt/ros/hydro/env_cached.sh make -j2' returned non-zero exit status 2
Command failed, exiting.

As of January 1, 2013, homebrew's version of yaml-cpp was upgraded to 0.5.0 which uses a different API than camera_calibration_parsers requires.

This is the old solution:

To fix, revert yaml-cpp to 0.3.0:

  $ cd /usr/local/Cellar
  $ brew uninstall yaml-cpp
  $ brew versions yaml-cpp
  0.5.0    git checkout 78b895b /usr/local/Library/Formula/yaml-cpp.rb
  0.3.0    git checkout 6e32f8c /usr/local/Library/Formula/yaml-cpp.rb
  0.2.5    git checkout ebe6663 /usr/local/Library/Formula/yaml-cpp.rb
  $ git checkout 6e32f8c /usr/local/Library/Formula/yaml-cpp.rb
  $ brew install yaml-cpp

A more permanent solution is that I added a yaml-cpp-0.3 formula to the homebrew-groovy repository: https://github.com/ros/homebrew-groovy/blob/master/yaml-cpp-0.3.rb

A more permanent solution is that I added a yaml-cpp-0.3 formula to the homebrew-hydro repository: https://github.com/ros/homebrew-hydro/blob/master/yaml-cpp-0.3.rb

And updated the rosdep entry so that it will install yaml-cpp-0.3 rather than yaml-cpp from the upstream Homebrew repository.

The only problem with this approach is that if yaml-cpp 0.5.0 is already installed from brew, 0.3 will fail to link properly, in that event:

$ brew uninstall yaml-cpp yaml-cpp-0.3
$ brew install yaml-cpp-0.3

If you get an error like

Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/libcv_bridge.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
[ 50%] Built target cv_bridge
Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
Undefined symbols for architecture x86_64:
  "_PyErr_SetString", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyExc_TypeError", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyImport_ImportModule", referenced from:
      init_module_cv_bridge_boost() in module.cpp.o
  "_PyInt_FromLong", referenced from:
      boost::python::to_python_value<int const&>::operator()(int const&) const in module.cpp.o
  "_PyInt_Type", referenced from:
      boost::python::to_python_value<int const&>::get_pytype() const in module.cpp.o
  "_PyObject_AsWriteBuffer", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_PyObject_CallObject", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyObject_GetAttrString", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyString_AsString", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_Py_BuildValue", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "__Py_NoneStruct", referenced from:
      boost::python::api::object::object() in module.cpp.o
ld: symbol(s) not found for architecture x86_64

Apply this patch

diff --git a/cv_bridge/src/CMakeLists.txt b/cv_bridge/src/CMakeLists.txt
index 03a02b8..6c8a69f 100644
--- a/cv_bridge/src/CMakeLists.txt
+++ b/cv_bridge/src/CMakeLists.txt
@@ -20,6 +20,7 @@ include_directories(SYSTEM ${PYTHON_INCLUDE_PATH}
 add_library(${PROJECT_NAME}_boost module.cpp)
 target_link_libraries(${PROJECT_NAME}_boost ${Boost_LIBRARIES}
                                             ${catkin_LIBRARIES}
+                                            ${PYTHON_LIBRARIES}
                                             ${PROJECT_NAME}
 )

More info in http://answers.ros.org/question/52341/building-cv_bridge-with-catkin-fails/

No builder module in catkin

If catkin is already installed in homebrew, you may get the following message when trying to run catkin_make_isolated

Traceback (most recent call last):
  File "./src/catkin/bin/catkin_make_isolated", line 13, in <module>
    from catkin.builder import build_workspace_isolated
ImportError: No module named builder

A quick solution is to remove catkin brew installation from the system

brew remove catkin

bondcpp fails

If bondcpp fails with:

==> Processing catkin package: 'bondcpp'
==> Building with env: '/Users/william/ros_catkin_ws/install_isolated/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/william/ros_catkin_ws/build_isolated/bondcpp'
==> make -j1 in '/Users/william/ros_catkin_ws/build_isolated/bondcpp'
Linking CXX shared library /Users/william/ros_catkin_ws/devel_isolated/bondcpp/lib/libbondcpp.dylib
ld: library not found for -luuid
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/ros_catkin_ws/devel_isolated/bondcpp/lib/libbondcpp.dylib] Error 1
make[1]: *** [CMakeFiles/bondcpp.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'bondcpp':
  KeyboardInterrupt
Command failed, exiting.

Update brew and rosdep:

Rerun rosdep:

  • $ rosdep install --from-paths src --ignore-src --rosdistro groovy -y

  • $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y

Then it should build.

Pyside brew installation fails with segmentation fault

The output presented denotes a segmentation fault when using shiboken package as part of the pyside compilation process.

/bin/sh: line 1: 22299 Segmentation fault: 11  /usr/local/Cellar/shiboken/1.1.2/bin/shiboken --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero /tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/pyside_global.h --include-paths=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide:/usr/local/Cellar/qt/4.8.5/Frameworks --typesystem-paths=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide:/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide/QtCore --output-directory=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/QtCore --license-file=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide/QtCore/../licensecomment.txt /tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/QtCore/typesystem_core.xml --api-version=4.8 --drop-type-entries=""

A previous version of qt must be brewed. Uninstall pyside, shiboken and qt

brew uninstall pyside
brew uninstall shiboken
brew uninstall qt

and then follow this steps

cd `brew --prefix`
brew uninstall qt
git checkout 7fc8cc0 /usr/local/Library/Formula/qt.rb
brew uninstall qt  # Might not be necessary on your machine
brew install pyside

More information in https://github.com/mxcl/homebrew/issues/21289.

rviz

Link error:

Linking CXX executable /Users/william/ros_catkin_ws/devel_isolated/rviz/lib/rviz/image_view
Undefined symbols for architecture x86_64:
  "_GetCurrentProcess", referenced from:
      _main in main.cpp.o
  "_SetFrontProcess", referenced from:
      _main in main.cpp.o
  "_TransformProcessType", referenced from:
      _main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/ros_catkin_ws/devel_isolated/rviz/lib/rviz/image_view] Error 1
make[1]: *** [src/image_view/CMakeFiles/rviz_image_view.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'rviz':
  KeyboardInterrupt
Command failed, exiting.

Install error:

-- Installing: /Users/william/ros_catkin_ws/install_isolated/lib/libdefault_plugin.dylib
-- Installing: /Users/william/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rviz/librviz_shiboken.dylib
CMake Error at src/python_bindings/sip/cmake_install.cmake:31 (FILE):
  file INSTALL cannot find
  "/Users/william/ros_catkin_ws/devel_isolated/rviz/lib/python2.7/site-packages/rviz/librviz_sip.dylib".
Call Stack (most recent call first):
  src/python_bindings/cmake_install.cmake:33 (INCLUDE)
  src/cmake_install.cmake:35 (INCLUDE)
  cmake_install.cmake:155 (INCLUDE)


make: *** [install] Error 1

<== Failed to process package 'rviz':
  KeyboardInterrupt
Command failed, exiting.

Both of these errors are solved in this pull request:

https://github.com/ros-visualization/rviz/pull/563

Runtime error:

∫ rosrun rviz rviz
[ INFO] [1358386092.761466000]: rviz version 1.9.19
[ INFO] [1358386092.761550000]: compiled against OGRE version 1.7.4 (Cthugha)
[ WARN] [1358386096.686693000]: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /usr/local/Cellar/ogre/1.7.4/lib/RenderSystem_GL.  System Error: dlopen(/usr/local/Cellar/ogre/1.7.4/lib/RenderSystem_GL.dylib, 9): image not found in DynLib::load at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreDynLib.cpp (line 91)
terminate called throwing an exceptionAbort trap: 6

Pull request: https://github.com/ros-visualization/rviz/pull/564

Runtime error:

[ INFO] [1358387448.148951000]: rviz version 1.9.19
[ INFO] [1358387448.149035000]: compiled against OGRE version 1.7.4 (Cthugha)
2013-01-16 17:50:52.329 rviz[29323:5c03] invalid drawable
[ WARN] [1358387452.385106000]: OGRE EXCEPTION(7:InternalErrorException): Cannot compile GLSL high-level shader : rviz/box.geom Cannot compile GLSL high-level shader : rviz/box.geom ERROR: 0:1: '' :  version '150' is not supported
ERROR: 0:18: ';' : syntax error Uniform blocks may not have identifiers in GLSL 140
ERROR: 0:23: 'layout' : syntax error syntax error
 in GLSLProgram::compile at /tmp/ogre-w5AP/ogre_src_v1-7-4/RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp (line 65)
[ WARN] [1358387452.387979000]: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp (line 1425)
[ WARN] [1358387452.390215000]: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp (line 1425)
[ WARN] [1358387452.391235000]: OGRE EXCEPTION(7:InternalErrorException): Cannot compile GLSL high-level shader : rviz/include/pass_depth.geom Cannot compile GLSL high-level shader : rviz/include/pass_depth.geom ERROR: 0:1: '' :  version '150' is not supported
 in GLSLProgram::compile at /tmp/ogre-w5AP/ogre_src_v1-7-4/RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp (line 65)
terminate called throwing an exceptionAbort trap: 6

https://github.com/ros-visualization/rviz/pull/558

orocos_kdl fails on rosmake -a

orocos_kdl may fail during rosmake -a outputting long error messages that include the line

ld: symbol(s) not found for architecture i386

Erase "i386," from the following line in the Makefile located in orocos_kdl folder

-DCMAKE_OSX_ARCHITECTURES="i386,x86_64"

Deleting build/CMakeCache.txt file may also be necessary for the package to finally compile.

rosdep permission issues

Installing rosdep as sudo may lead to permission issues during installation of dependencies

ERROR: Rosdep experienced an internal error: [Errno 13] Permission denied: '~/.ros/rosdep/sources.cache/index'
Please go to the rosdep page [1] and file a bug report with the stack trace below.
[1] : http://wiki/rosdep

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 116, in rosdep_main
    exit_code = _rosdep_main(args)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 257, in _rosdep_main
    return _package_args_handler(command, parser, options, args)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 334, in _package_args_handler
    lookup = _get_default_RosdepLookup(options)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 107, in _get_default_RosdepLookup
    verbose=options.verbose)
  File "/Library/Python/2.7/site-packages/rosdep2/sources_list.py", line 501, in create_default
    sources = load_cached_sources_list(sources_cache_dir=sources_cache_dir, verbose=verbose)
  File "/Library/Python/2.7/site-packages/rosdep2/sources_list.py", line 419, in load_cached_sources_list
    with open(cache_index, 'r') as f:
IOError: [Errno 13] Permission denied: '~/.ros/rosdep/sources.cache/index'

To resolve, recursively change the owner on the ~/.ros directory to the current user:

sudo chown -R <user> /Users/<user>/.ros

tf2_ros fails to build

If you are getting this error while building tf2_ros:

==> make -j4 -l4 in '/Users/Yeison/ros_catkin_ws/build_isolated/tf2_ros'
Linking CXX shared library /Users/Yeison/ros_catkin_ws/devel_isolated/tf2_ros/lib/libtf2_ros.dylib
Undefined symbols for architecture x86_64:

try to edit src/tf2_ros/CMakeLists.txt according to https://github.com/ros/geometry-experimental/pull/6

CMAKE_OSX_DEPLOYMENT_TARGET errors

Errors such like these:

  CMake Error at /usr/local/Cellar/cmake/2.8.10.2/share/cmake/Modules/Platform/Darwin.cmake:190 (message):
    CMAKE_OSX_DEPLOYMENT_TARGET is '10.6' but CMAKE_OSX_SYSROOT:

     ""

    is not set to a MacOSX SDK with a recognized version.  Either set
    CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
    empty.

were fixed by commenting one line in ~/ros_catkin_ws/install_isolated/share/ros/core/rosbuild/public.cmake as shown below:

  if(APPLE)
    #SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "Deployment target for OSX" FORCE)
  endif(APPLE)

"Library not found" errors

A fix to errors like this one

ld: library not found for -l:/usr/local/lib/libboost_signals-mt.dylib

consists in the removal of extra ':' in *.pc files. This can be done automatically using the commands

$ cd ~/ros_catkin_ws/install_isolated/lib/pkgconfig
$ find *.pc -print0 | xargs -0 sed -i .bak 's/\-l:/\-l/g'

Note that usually need to make clean the packages where the error occurs.

nodelet_tutorial_math fails to build

If nodelet_tutorial_math fails to build with errors like

-------------------------------------------------------------------------------
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /Users/alex/ros_ws/common_tutorials/nodelet_tutorial_math/build
  cd build && make -j -l8
  Scanning dependencies of target rospack_genmsg_libexe
  [  0%] Built target rospack_genmsg_libexe
  Scanning dependencies of target rosbuild_precompile
  [  0%] Built target rosbuild_precompile
  Scanning dependencies of target nodelet_math
  [100%] Building CXX object CMakeFiles/nodelet_math.dir/src/plus.cpp.o
  Linking CXX shared library ../lib/libnodelet_math.dylib
  clang: warning: argument unused during compilation: '-pthread'
  Undefined symbols for architecture x86_64:
    "class_loader::class_loader_private::AbstractMetaObjectBase::addOwningClassLoader(class_loader::ClassLoader*)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::setAssociatedLibraryPath(std::string)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::AbstractMetaObjectBase(std::string const&, std::string const&)", referenced from:
        class_loader::class_loader_private::AbstractMetaObject<nodelet::Nodelet>::AbstractMetaObject(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::~AbstractMetaObjectBase()", referenced from:
        class_loader::class_loader_private::AbstractMetaObject<nodelet::Nodelet>::AbstractMetaObject(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getFactoryMapForBaseClass(std::string const&)", referenced from:
        std::map<std::string, class_loader::class_loader_private::AbstractMetaObjectBase*, std::less<std::string>, std::allocator<std::pair<std::string const, class_loader::class_loader_private::AbstractMetaObjectBase*> > >& class_loader::class_loader_private::getFactoryMapForBaseClass<nodelet::Nodelet>() in plus.cpp.o
    "class_loader::class_loader_private::getCurrentlyActiveClassLoader()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getCurrentlyLoadingLibraryName()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getPluginBaseToFactoryMapMapMutex()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::hasANonPurePluginLibraryBeenOpened(bool)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "console_bridge::log(char const*, int, console_bridge::LogLevel, char const*, ...)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
        __GLOBAL__I_a in plus.cpp.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[3]: *** [../lib/libnodelet_math.dylib] Error 1
  make[2]: *** [CMakeFiles/nodelet_math.dir/all] Error 2
  make[1]: *** [all] Error 2
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package nodelet_tutorial_math written to:
[ rosmake ]    /Users/alex/.ros/rosmake/rosmake_output-20130302-173409/nodelet_tutorial_math/build_output.log
[rosmake-5] Finished <<< nodelet_tutorial_math [FAIL] [ 41.04 seconds ]

Add a dependency to class_loader in nodelet_tutorial_math/manifest.xml

<depend package="class_loader"/>

Fix taken from herehttps://github.com/ros/common_tutorials/issues/3

If rosmake -a fails with an error related to "BOOST_JOIN", e.g. with

usr/local/Cellar/boost/1.53.0/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse error at "BOOST_JOIN"

As described here you need an updated version of ros-tutorials. I had to do the following to make this update work

$ cd ~/ros_catkin_ws
$ rm -rf src/ros_tutorials src/roscpp_tutorials src/rospy_tutorials src/turtlesim
$ cd src
$ git clone https://github.com/ros/ros_tutorials.git
$ cd ..
$ rm -rf build_isolated
$ catkin_make_isolated --install

orocos_kdl Fails to build on OS X 10.9 (Mavericks)

See this issue: https://github.com/orocos/orocos_kinematics_dynamics/pull/4 And check out the more complete write-up: http://answers.ros.org/question/94771/building-octomap-orocos_kdl-and-other-packages-on-osx-109-solution/

PIL fails to install on OS X 10.9 (Mavericks)

$ sudo ln -s /usr/local/include/freetype2 /usr/local/include/freetype
$ sudo pip install pil --allow-external pil --allow-unverified pil

Notice that there's a report (with work around) that ogre failed to be installed via brew.

[ 12%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreGpuProgramParams.cpp.o
cd /tmp/ogre-4JyI/ogre_src_v1-7-4/build/OgreMain && /usr/local/Library/ENV/4.3/clang++   -DBOOST_ALL_NO_LIB -DFREEIMAGE_LIB -DOGRE_NONCLIENT_BUILD -DOgreMain_EXPORTS -D_MT -D_USRDLL -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fPIC -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4/build/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/include/OSX -I/usr/local/include -I/opt/X11/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Carbon.framework/Headers -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Cocoa.framework/Headers -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/nedmalloc    -pthread -o CMakeFiles/OgreMain.dir/src/OgreGpuProgramParams.cpp.o -c /tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp
/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/OgreFont.cpp:44:10: fatal error: 'freetype.h' file not found
#include FT_FREETYPE_H

clang: error: unknown argument: '-mno-fused-madd'

Seen on OS X 10.9 (Mavericks) while rosdep, particularly with pil, netifaces. Error output is something similar as follows:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.9-intel-2.7/_imaging.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

This can be worked around by using -E option in sudo (ref.):

$ export CFLAGS=-Qunused-arguments
$ export CPPFLAGS=-Qunused-arguments
$ sudo -E pip install PIL

gtk+ fails to install in brew

If an error like the following is displayed:

gtk+: Unsatisfied dependency: XQuartz 2.3.6

XQuartz system must be installed from http://xquartz.macosforge.org/.

rospack fails build with cmake3 - Can't find PythonLibs

ref.

Seen on OS X 10.9 (Mavericks) Hydro with brewed cmake versions 3.0.0 & 3.0.2

Error looks like

-- catkin 0.5.88
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   system CMake Error at /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:136 (message):   Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)   (Required is at least version "2.7") Call Stack (most recent call first):   /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)   /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPythonLibs.cmake:197 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)   CMakeLists.txt:7 (find_package)

To fix: In rospack/CMakeLists.txt replace

set(PythonLibs_FIND_VERSION "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
find_package(PythonLibs REQUIRED)

with

find_package(PythonLibs "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" REQUIRED)

You could also use the commit which fixes this for hydro:

Error compiling rosbag_storage on Yosemite

ref.

Seen on Yosemite 10.10.3. When compiling rosbag_storage, error looks like:

/usr/local/include/boost/format/format_fwd.hpp:24:69: error: no type named 'allocator' in namespace 'std'
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                               ~~~~~^
/usr/local/include/boost/format/format_fwd.hpp:24:78: error: expected ',' or '>' in template-parameter-list
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                                             ^
/usr/local/include/boost/format/format_fwd.hpp:24:83: error: expected unqualified-id
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                                                  ^
/usr/local/include/boost/format/format_fwd.hpp:27:13: error: unknown type name 'basic_format'
    typedef basic_format<char >     format;
            ^
/usr/local/include/boost/format/format_fwd.hpp:27:25: error: expected unqualified-id
    typedef basic_format<char >     format;
                        ^
/usr/local/include/boost/format/format_fwd.hpp:30:13: error: unknown type name 'basic_format'
    typedef basic_format<wchar_t >  wformat;
            ^
/usr/local/include/boost/format/format_fwd.hpp:30:25: error: expected unqualified-id
    typedef basic_format<wchar_t >  wformat;

To fix, apply this patch provided by crazyorc:

--- src/roscpp_core/roscpp_traits/include/ros/message_forward.h.orig    2015-04-22 15:04:29.000000000 -0700
+++ src/roscpp_core/roscpp_traits/include/ros/message_forward.h 2015-04-22 15:46:31.000000000 -0700
@@ -28,6 +28,11 @@
 #ifndef ROSLIB_MESSAGE_FORWARD_H
 #define ROSLIB_MESSAGE_FORWARD_H

+// Make sure that either __GLIBCXX__ or _LIBCPP_VERSION is defined.
+#include <cstddef>
+
 // C++ standard section 17.4.3.1/1 states that forward declarations of STL types
 // that aren't specializations involving user defined types results in undefined
 // behavior. Apparently only libc++ has a problem with this and won't compile it.

homebrew: Failed to detect successful installation of pyqt

This error could happen with other module and is not specific to ROS at all. Here we show the error with pyqt as an example.

$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y --as-root pip:no --skip-keys="gazebo"
executing command [brew install pyqt]
Warning: pyqt-4.11.3 already installed, it's just not linked
ERROR: the following rosdeps failed to install
  homebrew: Failed to detect successful installation of [pyqt]

Simply (re)link pyqt.

$ brew link pyqt

2024-03-23 12:34