Skip to content

Instantly share code, notes, and snippets.

@mikepurvis
Last active June 20, 2020 17:52
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save mikepurvis/9837958 to your computer and use it in GitHub Desktop.
Save mikepurvis/9837958 to your computer and use it in GitHub Desktop.
ROS Indigo on Mavericks/Yosemite (Homebrew with brewed Python)

ROS on Mac OS X

These instructions have been supplanted by an automated, scripted installer, which lives here:

https://github.com/mikepurvis/ros-install-osx

Please try it out, and file bugs as required. Feel free to browse past versions of this gist as a historical curiosity, but I won't be monitoring or supporting it any more.

@kpykc
Copy link

kpykc commented Jun 12, 2014

In my case, i also installed manually:

brew install opencv --with-qt --with-eigen --with-tbb
brew install lz4

Brew has Ogre 1.7 by default, rviz uses Ogre 1.8, so i got a fault first time. You need to install Ogre from HEAD:

brew install ogre --HEAD

Well, i'm building it now, so i'm not sure if this will be the only issue, even if it will help.

http://answers.ros.org/question/94771/building-ros-on-osx-109-solution/

cd <ROS WORKSPACE DIR>

cd src/robot_state_publisher
curl https://github.com/ros/robot_state_publisher/pull/5.patch | patch -p1
cd ..
rm -r build_isolated /robot_state_publisher

cd src/robot_model
curl https://github.com/ros/robot_model/pull/43.patch | patch -p1
cd ..
rm -r build_isolated/kdl_parser

Other: add to src/geometry/tf/CMakeLists.txt

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1")

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

@mikepurvis
Copy link
Author

@rasit Yes, I have added catkin_tools to the pip install, among other changes.

@kpykc The geometry changes are no longer necessary. Due to segfault issues with Ogre 1.9, the current version of the directions uses Hydro's rviz.

@lorenzoriano
Copy link

Doing rosinstall_generator rviz --rosdistro hydro --tar >> indigo.rosinstall doesn't work in my case. I still have the "could not serialize mesh" error.

My solution has been to manually fetch rviz from github and change the branch to hydro. Also, since rosinstall_generator desktop already pulls in rviz, doesn't the second line create a conflict?

@soulslicer
Copy link

It seems Mavericks does not have these paths:
" -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/include/python2.7"

I tried searching for the above dylib as well and was unable to find it

@mikepurvis
Copy link
Author

@soulslicer This recipe is using brewed Python; those paths only exist assuming you have installed Python using Homebrew, and that your Homebrew install is in the standard location.

@Juxi
Copy link

Juxi commented Dec 23, 2014

when doing the catkin command for building/installing I get the following error:
catkin: error: unrecognized arguments: --install --install-space

@mikepurvis
Copy link
Author

@Juxi The command line interface for catkin_tools changed slightly. I've updated the gist accordingly.

I've also switched this to be a desktop_full install, which seems to work well for me.

@davetcoleman
Copy link

On a completely new install of Yosemite (hard drive wipe) in Jan 2015 I did the following for Indigo:

I had to manually install pydot with the -H flag:

sudo -H pip install -U pydot

After rosdep install completed, I still had to run

pip install empy

@pgorczak
Copy link

pgorczak commented Feb 5, 2015

Thanks for the recipe.
It seems like the location of brew recently changed to
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

@mikepurvis
Copy link
Author

@davetcoleman, it's odd to me that pydot would require a manual installation— it's clearly in the rosdep index. Is it rqt_graph, or is there some other package you're thinking should have the dependency?

@mikepurvis
Copy link
Author

Now installing on my Yosemite machine. A few other updates including changing the paths for Python 2.7.9, using skip-keys and as-root in the rosdep invocation, and adding sphinx to the upfront pip install (for the sake of a homebrew dependency).

@giogadi
Copy link

giogadi commented Mar 18, 2015

Thanks for this Gist! I'm trying to build on Yosemite.

I almost made it to the end with no problems, but I got an error when trying to build rviz:

[rviz] ==> '/Users/luis/indigo_desktop_ws/build/rviz/build_env.sh /usr/bin/make -j4 -l4' in '/Users/luis/indigo_desktop_ws/build/rviz'
[  0%] Generating moc_tool_properties_panel.cxx
[  0%] Generating moc_display.cxx
[  1%] Generating moc_displays_panel.cxx
[  1%] Generating moc_failed_panel.cxx
[  1%] Generating moc_frame_manager.cxx
[  2%] Generating moc_frame_position_tracking_view_controller.cxx
[  2%] Generating moc_help_panel.cxx
[  2%] Generating image/moc_image_display_base.cxx
[  2%] Generating moc_loading_dialog.cxx
[  3%] Generating moc_message_filter_display.cxx
usr/local/Cellar/boost/1.57.0/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse error at "BOOST_JOIN"
make[2]: *** [src/rviz/moc_message_filter_display.cxx] Error 1
make[1]: *** [src/rviz/CMakeFiles/rviz.dir/all] Error 2
make: *** [all] Error 2
make: INTERNAL: Exiting with 5 jobserver tokens available; should be 4!                                                                                                              
[rviz] <== '/Users/luis/indigo_desktop_ws/build/rviz/build_env.sh /usr/bin/make -j4 -l4' failed with return code '2'

It looks like this is an issue that's fixed in indigo-devel; is this happening because we're using hydro's rviz?

@mikepurvis
Copy link
Author

Yes, I think so. I've updated to use the new ogre-1.9 formula from @wjwwood, so Indigo's rviz now works.

@giogadi
Copy link

giogadi commented Mar 22, 2015

I'm trying the new version, and at the rosdep install step, it's still trying to install ogre-1.7 even though I've already installed ogre-1.9. This causes homebrew to error out because of conflicting files in the two installs. Should rosdep install be trying to install ogre-1.7? I'm using --skip-keys=ogre gazebo as in the gist.

@kjeremy
Copy link

kjeremy commented Apr 2, 2015

@mikepurvis I'm having the same issue as @giogadi where it's still trying to install ogre-1.7

@justinthomas
Copy link

@giogadi and @kjeremy, I think I might be having the same issue, but explicitly, I get the following error:

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rviz: Missing resource ogre

@fferri
Copy link

fferri commented Apr 19, 2015

it fails with Xcode 6.3 / Xcode CLT 6.3. I had to downgrade to 6.2 (fails compilation of roscpp and several other packages in the catkin build last step)

@fferri
Copy link

fferri commented Apr 19, 2015

also: if the "pip install -U ..." step fails, try first to do "pip install -U pip", then "pip install -U setuptools", and then repeat the pip install step with all arguments

@fferri
Copy link

fferri commented Apr 19, 2015

also: I don't know if this was related to the issue introduced by Xcode 6.3, but that recipe for ogre used to fail on my machine. I ended up doing:

wget https://raw.githubusercontent.com/NikolausDemmel/homebrew-simulation/ogre-fixes/ogre1.9.rb
sed -i -e 's/aa9b0c6d371802e0535515758e88c4893045cd5f/45535a9f5a1e462965cf999e222f0b86c3ef679c/g' ogre1.9.rb
brew install ogre1.9.rb --devel
brew install https://raw.githubusercontent.com/NikolausDemmel/homebrew-simulation/ogre-fixes/gazebo2.rb

(but I didn't check if it worked correctly after downgrading to Xcode 6.2)

@csik
Copy link

csik commented Apr 30, 2015

Thank you so much for sharing, worked like a charm on 10.10.3. Wish I'd found this a day or two ago!
One modification, this patch:
http://answers.ros.org/question/207470/error-compiling-rosbag_storage-on-mac-os-x-yosemite/
... then a fresh catkin build.

@cm85
Copy link

cm85 commented May 8, 2015

Thanks

@markusachtelik
Copy link

Thanks a lot for this gist and for sharing all the tricks!
Here is what I needed to do for indigo under 10.10.3:

  • I downgraded to xcode command line tools 6.2, since I wanted to have gazebo5
  • pcl_ros did not find glew, altough it was installed through homebrew. This did the trick: PointCloudLibrary/pcl#1133

@rhellman
Copy link

rhellman commented Jun 9, 2015

Thank you for posting!
@markusachtelik are you able to launch rviz? I can't figure out why rviz keeps crashing.

@markusachtelik
Copy link

sorry, did not get a notification for this -- rviz runs fine. I however haven't done much more than showing tf frames so far.

@Agachon06
Copy link

Hello,
Thanks for you posting !
I tried to install ROS on my yosemite (10.10.3) on clean system but I have an error during
"brew install https://github.com/osrf/homebrew-simulation/raw/ogre_1_9/ogre-1.9.rb".
Here is the link to gist error
https://gist.github.com/154441d1b3f374e3f7c8
Can you help me please ?

@WalaaAlSumari
Copy link

@mikepurvis I'm installing the ros on my OS X Yosemite 10.10.4, the python version is now 2.7.10
I went through the path in my computer and now it's 2.7.10_1,

catkin build
-DCMAKE_BUILD_TYPE=Release
-DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/include/python2.7

but it still not working. The step fails at [106 out of 224] where the Python.h is not found.

Referring to you comment at mar 17 "Now installing on my Yosemite machine. A few other updates including changing the paths for Python 2.7.9, using skip-keys and as-root in the rosdep invocation, and adding sphinx to the upfront pip install (for the sake of a homebrew dependency). "

can you guide me on how to fix it?

@mikepurvis
Copy link
Author

Hi all,

I don't get notifications of new comments on this gist, so I apologize for the non-timely responses. I've reverted the instruction to use Ogre 1.9, as this still seems to cause problems— it's easier still, I think, to stick to Ogre 1.7 and the rviz from ROS Hydro. I'll be switching this guide over to Jade at some point, which I think has a slightly cleaner story for this stuff.

I've also scripted the Python path discovery, so that should be a little more automatic going forward.

@grafoteka
Copy link

Hi all! Finally 2 weeks later, i've successfully installed ROS with RVIZ.

I'm on a mac early 2011 with OS X 10.10.4, I did what @markusachtelik said.
Remove Xcode 6.3 and downgrade to 6.2, then run the script.

Now, my problem is that all the packages are continue in the /src folder, can I move them to any other folder? Because I can be waiting more than 45 minutes every time that I make a new change.

Thank you very much! (:

@ghernati
Copy link

can you help me :

Scanning dependencies of target pointcloud_to_pcd
[ 26%] Building CXX object CMakeFiles/pointcloud_to_pcd.dir/tools/pointcloud_to_pcd.cpp.o
[ 30%] Linking CXX executable /Users/Ghernati_Amine/indigo_desktop_full_ws/devel/lib/pcl_ros/convert_pcd_to_image
[ 30%] Linking CXX executable /Users/Ghernati_Amine/indigo_desktop_full_ws/devel/lib/pcl_ros/pcd_to_pointcloud
ld: library not found for -lvtkRenderingFreeTypeOpenGL
ld: library not found for -lvtkRenderingFreeTypeOpenGL
clangclang: : errorerror: : linker command failed with exit code 1 (use -v to see invocation)linker command failed with exit code 1 (use -v to see invocation)

make[2]: make[2]: * [/Users/Ghernati_Amine/indigo_desktop_full_ws/devel/lib/pcl_ros/convert_pcd_to_image] Error 1* [/Users/Ghernati_Amine/indigo_desktop_full_ws/devel/lib/pcl_ros/pcd_to_pointcloud] Error 1

make[1]: *** [CMakeFiles/pcd_to_pointcloud.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/convert_pcd_to_image.dir/all] Error 2
[ 31%] Linking CXX executable /Users/Ghernati_Amine/indigo_desktop_full_ws/devel/lib/pcl_ros/convert_pointcloud_to_image
ld: library not found for -lvtkRenderingFreeTypeOpenGL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/Ghernati_Amine/indigo_desktop_full_ws/devel/lib/pcl_ros/convert_pointcloud_to_image] Error 1
make[1]: *** [CMakeFiles/convert_pointcloud_to_image.dir/all] Error 2
[ 33%] Linking CXX executable /Users/Ghernati_Amine/indigo_desktop_full_ws/devel/lib/pcl_ros/pointcloud_to_pcd
ld: library not found for -lvtkRenderingFreeTypeOpenGL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/Ghernati_Amine/indigo_desktop_full_ws/devel/lib/pcl_ros/pointcloud_to_pcd] Error 1
make[1]: *** [CMakeFiles/pointcloud_to_pcd.dir/all] Error 2
make: *** [all] Error 2
[pcl_ros] <== '/Users/Ghernati_Amine/indigo_desktop_full_ws/build/pcl_ros/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j' failed with return code '2'

Failed <== pcl_ros [ 26.3 seconds ]
Finished <== gazebo_ros [ 1 minute and 39.5 seconds ]
[build] There were '1' errors:

Failed to build package 'pcl_ros' because the following command:

Command to reproduce:

cd /Users/Ghernati_Amine/indigo_desktop_full_ws/build/pcl_ros && /Users/Ghernati_Amine/indigo_desktop_full_ws/build/pcl_ros/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j; cd -

Path to log:

cat /Users/Ghernati_Amine/indigo_desktop_full_ws/build/build_logs/pcl_ros.log

Exited with return code: 2

[build] Runtime: 27 minutes and 0.7 seconds

@TheInfamousWayne
Copy link

During the installation, I faced this issue. Any suggestions as to how to fix this?

executing command [brew install gazebo8]
==> Installing gazebo8 from osrf/simulation
==> Installing dependencies for osrf/simulation/gazebo8: ignition-msgs0, ignition-transport3, libtar, sdformat5 and simbody
==> Installing osrf/simulation/gazebo8 dependency: ignition-msgs0
==> Downloading https://osrf-distributions.s3.amazonaws.com/ign-msgs/releases/ig
Already downloaded: /Users/vaibhavagrawal/Library/Caches/Homebrew/downloads/14859241ed3734983429fe41356ed996483801ce265d311d1e1d03bf0c6f02f7--ignition-msgs-0.7.0.tar.bz2
==> cmake . -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG
Last 15 lines from /Users/vaibhavagrawal/Library/Logs/Homebrew/ignition-msgs0/01.cmake:
-- Build Type: Release
-- Install path: /usr/local/Cellar/ignition-msgs0/0.7.0_7
CMake Error at /usr/local/share/cmake/ignition-cmake2/cmake2/IgnUtils.cmake:782 (message):
ign_add_library(<target_name> ) is deprecated. Instead, use
ign_create_core_library(SOURCES ). It will determine the library
target name automatically from the project name. To add a component
library, use ign_add_component(~). Be sure to pass the CXX_STANDARD
argument to these functions in order to set the C++ standard that they
require.
Call Stack (most recent call first):
ignition/msgs/CMakeLists.txt:221 (ign_add_library)

-- Configuring incomplete, errors occurred!
See also "/tmp/ignition-msgs0-20191110-11860-1ku5e4x/ignition-msgs-0.7.0/CMakeFiles/CMakeOutput.log".

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/osrf/homebrew-simulation/issues

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment