Mac OS X Installation Instructions (10.6 or later)

SVN Based Install (download-and-compile)

Pre Install

  1. Install Apple's Developer Tools: http://developer.apple.com/Tools

  2. Install MacPorts http://www.macports.org/install.php

ROS uses Python 2.6 ("py26").

  • sudo port -v selfupdate
    sudo port install wget cmake python_select subversion mercurial py26-yaml libyaml
    sudo port select --set python python26

ROS on OS X uses MacPorts, which requires additional environment setup. If you haven't already configured your computer to use MacPorts libraries, add the following to your .bashrc:

  • export CPATH=/opt/local/include
    export LIBRARY_PATH=/opt/local/lib
    export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/opt/local/lib
    export PATH=/opt/local/bin:$PATH
    # To ensure that MacPorts pkg-config can find stuff that rosdep installs in /usr
    export PKG_CONFIG_PATH=/usr/lib/pkgconfig

You may need to run easy_install to install libyaml:

sudo easy_install -U pyyaml

If your .profile doesn't already source .bashrc, you'll also need to do that:

  • echo 'source .bashrc' >> .profile

NOTE: Check symbolic links (e.g. using which and ls -la) for python and easy_install to make sure they link to the correct version (/opt/local/bin not /usr/...).

If easy_install is not in /opt/local/bin, you will need to install python-setuptools:

sudo port install py26-setuptools

You may need to add this symbolic link in /opt/local/bin:

sudo ln -fsv /opt/local/bin/easy_install-2.6 easy_install

rosinstall

The following lines will download the ROS source code using the rosinstall tool, and bootstrap the installation. The installation downloads all ROS stacks in subdirectories inside the ~/ros directory, one subdirectory for each stack in the rosinstall file.

First install rosinstall:

  • sudo easy_install -U rosinstall

There are many different libraries and tools in ROS. We provided four default configurations to get you started.

  • Desktop-Full Install: (Recommended): ROS Full, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=desktop-full&overlay=no"

    Desktop Install: : ROS Full, rviz, and robot-generic libraries

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=desktop&overlay=no"

    ROS-Full: ROS package, build, communication, and graphical tools.

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=ros-full&overlay=no"

    ROS-Base: (Bare Bones) ROS package, build, and communication libraries.

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=ros-base&overlay=no"

NOTE: the instructions above download all stacks inside the ~/ros folder. If you prefer a different location, simply change the ~/ros in the commands above.

Please reference REP 108 for description of other available configurations.

Environment Setup

Shell language:   Bash     Zsh    

You'll now need to update your environment. You can do this by typing:

source ~/ros/setup.bash

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched, which you can do with the command below:

echo "source ~/ros/setup.bash" >> ~/.bashrc
. ~/.bashrc

For Zsh users, change the last line of ~/ros/setup.zsh to

source $ROS_ROOT/tools/rosbash/roszsh

before running source ~/ros/setup.zsh Similarly, have the setup script called at the start of each new shell session with

echo "source ~/ros/setup.zsh" >> ~/.zshrc
. ~/.zshrc

Troubleshooting

For Mac OS X, you may need to create these symbolic links:

  • sudo ln -sv /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/rosinstall rosinstall
    
    sudo ln -sv /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/roslocate roslocate

For Mac OS X, if you see this error when building rosrecord:

  •  Linking CXX executable ../bin/rosplay
      Undefined symbols:
        "boost::filesystem3::path::extension() const", referenced from:
            ros::record::Player::open(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::Time, bool)in rosplay.o
        "boost::filesystem3::path::wchar_t_codecvt_facet()", referenced from:
            ros::record::Player::open(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::Time, bool)in rosplay.o
      ld: symbol(s) not found

You will need to edit ~/ros/ros_comm/tools/rosrecord/CMakeLists.txt. Change line 22 from:

  • rosbuild_link_boost(rosplay iostreams system)

to:

  • rosbuild_link_boost(rosplay iostreams system filesystem)

and re-run the above rosinstall configuration.

Tutorials

Now, to test your installation, please proceed to the ROS Tutorials.

Wiki: diamondback/Installation/OSX (last edited 2011-07-27 16:40:28 by BrianGerkey)