Compiling the Robot Operating System (ROS) Indigo on Mac OS X can be quite a challenge. Here is a well tested recipe originally created by Mike Purvis and updated by me for OS X Yosemite 10.10.2:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# NOTE: These instructions do not represent a robust, self-troubleshooting install; they # are definitely not suitable for dumping to a giant script and running as one. If you # use them, they should be run one at a time, with an eye out for errors or problems # along the way. # # The #1 issue you are likely to encounter is with Homebrew or Python packages whose # binary components link against system Python. This will result in runtime segfaults, # especially in rviz. If you suspect this is occurring, you can attempt to remove and # reinstall the offending packages, or go for the nuclear option--- empty your Cellar # and site-packages folders and start over with brewed python from the beginning. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # If a cleanup is necessary, proceed with extreme caution!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Remove old ROS installations rm -rf /opt/ros rm -rf ~/ros_catkin_ws # Uninstall homebrew brew install wget wget https://gist.githubusercontent.com/mxcl/1173223/raw/a833ba44e7be8428d877e58640720ff43c59dbad/uninstall_homebrew.sh bash uninstall_homebrew.sh rm uninstall_homebrew.sh rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup rm -rf /usr/local/Library/Taps # Clean up all confusing python packages sudo rm -rf /Library/Python/2.7/site-packages sudo rm -rf $(brew --prefix)/lib/python2.7/site-packages # Now we are ready to start fresh. # If you haven't already, install XQuartz using the installer from its own website: # https://xquartz.macosforge.org # Install Homebrew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" echo export PATH='/usr/local/bin:$PATH' >> ~/.zshrc source .zshrc brew doctor brew update # Install brewed python brew install python mkdir -p ~/Library/Python/2.7/lib/python/site-packages echo "$(brew --prefix)/lib/python2.7/site-packages" >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth # Homebrew taps for prerequisites brew tap ros/deps brew tap osrf/simulation brew tap homebrew/versions brew tap homebrew/science # Prerequisites brew install cmake libyaml lz4 theora brew install boost --with-python brew install opencv --with-qt --with-eigen --with-tbb brew install https://raw.githubusercontent.com/NikolausDemmel/homebrew-simulation/ogre-fixes/ogre1.9.rb --devel brew install https://raw.githubusercontent.com/NikolausDemmel/homebrew-simulation/ogre-fixes/gazebo2.rb # Install the ROS infrastructure tools, you may have to run this several times until all python deps are properly installed pip install -U setuptools rosdep rosinstall_generator wstool rosinstall catkin_tools catkin_pkg bloom empy sphinx sudo rosdep init rosdep update # Download the ROS sources mkdir ros_catkin_ws && cd ros_catkin_ws rosinstall_generator desktop_full --rosdistro indigo --deps --tar > indigo.rosinstall wstool init -j8 src indigo.rosinstall # Install the ROS dependencies rosdep install --from-paths src --ignore-src --rosdistro indigo -y --skip-keys ogre --skip-keys gazebo # Parallel build sudo mkdir -p /opt/ros/indigo sudo chown $USER /opt/ros/indigo catkin config --install --install-space /opt/ros/indigo catkin build \ -DCMAKE_BUILD_TYPE=Release \ -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib \ -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 #Now you can source your new ros installation source /opt/ros/indigo/setup.zsh |