Skip to content

Instantly share code, notes, and snippets.

@jmtatsch
Forked from mikepurvis/gist:9837958
Last active March 15, 2017 13:00
Show Gist options
  • Save jmtatsch/3aa268d41ae40c89b35a to your computer and use it in GitHub Desktop.
Save jmtatsch/3aa268d41ae40c89b35a to your computer and use it in GitHub Desktop.
Install ROS Jade on OS X El Capitan
# 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, don't do this tutorial if you have several versions of ros installed
sudo rm -rf /opt/ros
rm -rf ~/ros_catkin_ws
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
# Clean up all python packages
sudo rm -rf /Library/Python/2.7/site-packages
# Uninstall homebrew, warning this will cause trouble for anything linked against older hombrewed libraries
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
rm -rf /usr/local/Library/Taps
# Comment everything related to ROS in your .bashrc/.zshrc
nano .zshrc
# 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)"
brew doctor
# Install zshell, if you want to use bash instead, you should change the sourced files from .zsh to .bash
brew install zsh
echo export PATH='/usr/local/bin:$PATH' >> ~/.zshrc
source .zshrc
# 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
brew tap homebrew/dupes
brew tap dartsim/dart
# Prerequisites
brew install cmake libyaml lz4 theora
brew install boost --with-python --c++11
brew install opencv --with-qt --with-eigen --with-tbb
brew install homebrew/science/pcl --HEAD --without-apps --without-qt #https://github.com/Homebrew/homebrew-science/issues/2593
#brew install opencv3 --with-qt --with-eigen --with-tbb
brew install fltk --devel
# Install the ROS infrastructure tools, you may have to run this several times until all python deps are properly installed
sudo -H pip install -U setuptools rosdep rosinstall_generator wstool rosinstall catkin_tools catkin_pkg bloom empy sphinx
# Download ROS sources
mkdir ros_catkin_ws && cd ros_catkin_ws
rosinstall_generator desktop_full --rosdistro jade --deps --tar > jade.rosinstall
wstool init -j8 src jade.rosinstall
# Install the necessary ROS dependencies
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro jade -y
# fix pcl_ros according to https://github.com/ros-perception/perception_pcl/issues/106#issuecomment-134948296
if [ -d src/perception_pcl/pcl_ros ]; then
sed -i -e 's/find_package(Eigen3 REQUIRED)/find_package(PkgConfig)\
pkg_search_module(Eigen3 REQUIRED eigen3)/g' src/perception_pcl/pcl_ros/CMakeLists.txt
fi
# fix Ogre 1.74 according to mike
# Grabbing these older meshes allows rviz to run with Ogre 1.7 rather than Ogre 1.8+. Although formulae and patches
# exist to build Ogre 1.9, rviz, and Gazebo together, I have found this approach to be the most solid and consistent.
if [ -d src/rviz ]; then
pushd src/rviz/ogre_media/models
curl https://raw.githubusercontent.com/ros-visualization/rviz/hydro-devel/ogre_media/models/rviz_cone.mesh > rviz_cone.mesh
curl https://raw.githubusercontent.com/ros-visualization/rviz/hydro-devel/ogre_media/models/rviz_cube.mesh > rviz_cube.mesh
curl https://raw.githubusercontent.com/ros-visualization/rviz/hydro-devel/ogre_media/models/rviz_cylinder.mesh > rviz_cylinder.mesh
curl https://raw.githubusercontent.com/ros-visualization/rviz/hydro-devel/ogre_media/models/rviz_sphere.mesh > rviz_sphere.mesh
popd
fi
# Build in parallel with catkin ~40 min on my computer, make sure the python version matches
sudo mkdir -p /opt/ros/jade
sudo chown $USER /opt/ros/jade
catkin config --install --install-space /opt/ros/jade
catkin build \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib \
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7
# to work around the dyld issue https://github.com/mikepurvis/ros-install-osx/issues/12#issuecomment-149336634
# well this patch doesnt work yet but you get the idea
sed -i 's/#!/usr/bin/env bash/export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/ros/jade/lib/g' /opt/ros/jade/bin/rosrun
# Source the build ROS, prepare the workspace and from then on only source this one
source /opt/ros/jade/setup.zsh
cd ~/ros_catkin_ws
mv src src_isolated
mv devel devel_isolated
mv build build_isolated
mkdir src
catkin_make
echo 'source ~/ros_catkin_ws/devel/setup.zsh' >> ~/.zshrc
@ffurrer
Copy link

ffurrer commented Sep 8, 2015

I had to install poco, boost-python, gtk+ and ros/deps/gtest, ros/deps/yaml-cpp-0.3, and I installed gazebo6 instead of gazebo 2.2.5 all with brew.

brew install poco boost-python gtk+ ros/deps/gtest ros/deps/yaml-cpp-0.3 gazebo6

Then, pcl_ros CMakeLists.txt needed to be updated according to:
http://wiki.ros.org/jade/Migration#Eigen_CMake_Module_in_cmake_modules
I had to fix the PCLConfig.cmake as suggested here: PointCloudLibrary/pcl#492 (comment)
and use the (ugly) fix as suggested here: ros-visualization/qt_gui_core#57 (comment)
Then I had to adjust the python paths in line 86 and 87, to match my python version (2.7.10_2 instead of 2.7.10). Otherwise this worked perfectly, thanks.
Not sure if all of this is actually needed, but like this it worked for me.

@jmtatsch
Copy link
Author

@ffurrer I've created pullrequests for most of the things you suggested. However rviz still segfaults (as usual) when installing all according to rosdep. Which ogre formula did you use?

@grafoteka
Copy link

Hi! when I try to try line 84: rosdep install --from-paths src --ignore-src --rosdistro jade -y --skip-keys libogre-dev -skip-keys gazebo-dev

I've got the next error:

Usage: rosdep [options]
Commands:

rosdep check ...
check if the dependencies of package(s) have been met.

rosdep install ...
generate a bash script and then execute it.

rosdep db
generate the dependency database and print it to the console.

rosdep init
initialize rosdep sources in /etc/ros/rosdep. May require sudo.

rosdep keys ...
list the rosdep keys that the packages depend on.

rosdep resolve
resolve to system dependencies

rosdep update
update the local rosdep database based on the rosdep sources.

rosdep what-needs ...
print a list of packages that declare a rosdep on (at least
one of)

rosdep where-defined ...
print a list of yaml files that declare a rosdep on (at least
one of)

rosdep fix-permissions
Recursively change the permissions of the user's ros home directory.
May require sudo. Can be useful to fix permissions after calling
"rosdep update" with sudo accidentally.

rosdep: error: no such option: -k

Does anyone know what i'm doing wrong?
Thanks

EDIT: Need to put - in skip-keys

rosdep install --from-paths src --ignore-src --rosdistro jade -y --skip-keys libogre-dev --skip-keys gazebo-dev

@grafoteka
Copy link

I've got the same problem as @mikepurvis I must install gazebo6 with ogre1.7

How did you do to link with ogre1.9?

@jmtatsch
Copy link
Author

@grafoteka I'm currently also stuck at building ogre1.9. Ogre1.7 and Gazebo 6 works but Rviz then is not properly fixed. Crescante seems to have a solution ros-visualization/rviz#782 (comment)

@jmtatsch
Copy link
Author

I went back to Ogre1.74 and Gazebo 5 which work well even with El Cap

@grafoteka
Copy link

Hi @jmtatsch!
I've done a clear installation of OS X El Capitan and I'm trying to install it again.
Everything goes right until the script begins to install ros packages, then it fails with console_bridge.cmake.

Do you know what can I do?

@MatthiasLehner
Copy link

Hi @grafoteka,

I occured the same error that you are describing and I managed to fix it by installing console_bridge by hand.
Just type "brew install console_bridge" and you should be set.

Edit: You should probably do the same for the packages urdfdom, poco, gtest and SIP.

@jacksonkr
Copy link

mid 2015 mbp OS X 10.11.1

under prerequisites (line 65) there is this line
brew install homebrew/science/pcl --HEAD --without-apps --without-qt

I kept getting errors similar to:

[ 28%] Built target pcl_filters
make: *** [all] Error 2
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/homebrew/science/issues

so I went with

brew install homebrew/science/pcl --HEAD --with-qt

At (line 104)
catkin build
-DCMAKE_BUILD_TYPE=Release
-DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7
I'm stuck on:

[python_orocos_kdl] ==> '/Users/Jackson/ros_catkin_ws/build/python_orocos_kdl/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j' in '/Users/Jackson/ros_catkin_ws/build/python_orocos_kdl'
[ 10%] Building CXX object CMakeFiles/python_module_PyKDL.dir/PyKDL/sipPyKDLpart0.o
In file included from /Users/Jackson/ros_catkin_ws/build/python_orocos_kdl/PyKDL/sipPyKDLpart0.cpp:7:
In file included from /Users/Jackson/ros_catkin_ws/build/python_orocos_kdl/PyKDL/sipAPIPyKDL.h:11:
/usr/local/include/sip.h:32:10: fatal error: 'Python.h' file not found
#include <Python.h>
         ^
[ 20%] Building CXX object CMakeFiles/python_module_PyKDL.dir/PyKDL/sipPyKDLpart1.o
In file included from /Users/Jackson/ros_catkin_ws/build/python_orocos_kdl/PyKDL/sipPyKDLpart1.cpp:7:
In file included from /Users/Jackson/ros_catkin_ws/build/python_orocos_kdl/PyKDL/sipAPIPyKDL.h:11:
/usr/local/include/sip.h:32:10: fatal error: 'Python.h' file not found
#include <Python.h>
         ^
1 error generated.
make[2]: *** [CMakeFiles/python_module_PyKDL.dir/PyKDL/sipPyKDLpart0.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [CMakeFiles/python_module_PyKDL.dir/PyKDL/sipPyKDLpart1.o] Error 1
make[1]: *** [CMakeFiles/python_module_PyKDL.dir/all] Error 2
make: *** [all] Error 2
[python_orocos_kdl] <== '/Users/Jackson/ros_catkin_ws/build/python_orocos_kdl/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j' failed with return code '2'

Finished <== visualization_tutorials          [ 1.3 seconds ]                   
Starting ==> rospack                                                            
Finished <== viz                              [ 1.3 seconds ]                   
Starting ==> rostime                                                            
Finished <== gencpp                           [ 1.3 seconds ]                   
Starting ==> xmlrpcpp                                                           
Finished <== geneus                           [ 1.3 seconds ]                   
Starting ==> pr2_description                                                    
Failed   <== python_orocos_kdl                [ 1.6 seconds ]                   
Finished <== genlisp                          [ 1.2 seconds ]                   
Finished <== genpy                            [ 1.3 seconds ]                   
Finished <== class_loader                     [ 1.4 seconds ]                   

[rospack] ==> '/Users/Jackson/ros_catkin_ws/build/rospack/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j' in '/Users/Jackson/ros_catkin_ws/build/rospack'
make[2]: *** No rule to make target `/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib', needed by `/Users/Jackson/ros_catkin_ws/devel/lib/librospack.dylib'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 11%] Building CXX object CMakeFiles/rospack.dir/src/rospack.cpp.o
/Users/Jackson/ros_catkin_ws/src/rospack/src/rospack.cpp:72:10: fatal error: 'Python.h' file not found
#include <Python.h>
         ^
1 error generated.
make[2]: *** [CMakeFiles/rospack.dir/src/rospack.cpp.o] Error 1
make[1]: *** [CMakeFiles/rospack.dir/all] Error 2
make: *** [all] Error 2
[rospack] <== '/Users/Jackson/ros_catkin_ws/build/rospack/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j' failed with return code '2'

Finished <== rostime                          [ 1.3 seconds ]                   
Finished <== xmlrpcpp                         [ 1.2 seconds ]                   
Finished <== pr2_description                  [ 2.7 seconds ]                   
Failed   <== rospack                          [ 3.3 seconds ]                   
[build] Runtime: 23.2 seconds 
Traceback (most recent call last):
  File "/usr/local/bin/catkin", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/commands/catkin.py", line 219, in main
    sys.exit(args.main(args) or 0)
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/verbs/catkin_build/cli.py", line 296, in main
    summarize_build=opts.summarize  # Can be True, False, or None
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/verbs/catkin_build/build.py", line 756, in build_isolated_workspace
    set_error_state(error_state)
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/verbs/catkin_build/build.py", line 695, in set_error_state
    executors[x].should_shutdown = True
KeyError: 0

Any suggestions?

@fangbq
Copy link

fangbq commented Jan 1, 2016

when I run line 65 code, I failed like this

OS X 10.11.2

➜  Desktop git:(master) ✗ brew install homebrew/science/pcl --HEAD --without-apps --without-qt
==> Installing pcl from homebrew/science
==> Installing dependencies for homebrew/science/pcl: cminpack, qhull, libusb, glew, freetype, fontconfig, vtk
==> Installing homebrew/science/pcl dependency: cminpack
==> Downloading http://devernay.free.fr/hacks/cminpack/cminpack-1.3.4.tar.gz

curl: (7) Failed to connect to devernay.free.fr port 80: Operation timed out
Error: Failed to download resource "cminpack"
Download failed: http://devernay.free.fr/hacks/cminpack/cminpack-1.3.4.tar.gz

@rgerndt
Copy link

rgerndt commented Jan 18, 2016

I had an issue with line 65 (brew install homebrew/science/pcl --HEAD --without-apps --without-qt) terminating with
make[2]: *** No rule to make target `/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib', needed by ...(with python 2.7.11 installed)

So I created the directory branch manually and copied the file:
cp /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
and restarted the instruction (doing the script manually line by line now).

@rgerndt
Copy link

rgerndt commented Jan 19, 2016

Any ideas on this one?

catkin build (line 104) leaves me with:

[cpp_common] ==> '/Users/[...]/ros_catkin_ws/build/cpp_common/build_env.sh /usr/local/bin/cmake /Users/[...]/ros_catkin_ws/src/roscpp_core/cpp_common -DCATKIN_DEVEL_PREFIX=/Users/[...]/ros_catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/opt/ros/jade -DCMAKE_PREFIX_PATH=console_bridge -DCMAKE_BUILD_TYPE=Release -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7' in '/Users/[...]/ros_catkin_ws/build/cpp_common'
-- Boost version: 1.60.0
-- Found the following Boost libraries:
-- system
-- thread
CMake Error at CMakeLists.txt:5 (find_package):
By not providing "Findconsole_bridge.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"console_bridge", but CMake did not find one.

Could not find a package configuration file provided by "console_bridge"
with any of the following names:

console_bridgeConfig.cmake
console_bridge-config.cmake

Add the installation prefix of "console_bridge" to CMAKE_PREFIX_PATH or set
"console_bridge_DIR" to a directory containing one of the above files. If
"console_bridge" provides a separate development package or SDK, be sure it
has been installed.

@ahkhan03
Copy link

I am getting following error

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

What is the reason of this error and how to resolve it?

@rgerndt
Copy link

rgerndt commented Jan 27, 2016

@ ameerhamzakhan03101992 and BluFoot:
this (http://answers.ros.org/question/224956/no-definition-of-procps-for-os-osx/) should do (at least partially):

"Put a file named CATKIN_IGNORE in the opencv_apps package, so that catkin doesn't try to build it. Obviously this doesn't get you a complete install, but you should be able to proceed.
You may also need to run rosdep with the --skip-keys=procps option to make it ignore the bad dependency."

good luck

@rgerndt
Copy link

rgerndt commented Jan 27, 2016

Here is the whole picture of my recent attempts to install Jade on OSX:
Following (most of) the steps (and some of them multiple times with and eventually without errors) installed 'some ROS', which, however, was not fully operational.
Some 'solutions' are rather work arounds and may not reflect good programming practice.
Following is the original setup.sh with additional comments, corrections and new instructions that were required in my case (after a number of attempts and possibly messing up part of my system). Some of the steps may not be necessary in other cases. (During the attempts I never uninstalled homebrew and I never tried to use zsh.)
'.bashrc' on a MAC should be the '.profile' file in the home directory. Please have a look at the man pages - OSX apparently only reads the first out of number of configuration files

"
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 number 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, don't do this tutorial i have several versions of ros installed
sudo rm -rf /opt/ros
rm -rf ~/ros_catkin_ws
mikepurvis/ros-install-osx#9

Original script proposes 'sudo rm /etc/ros/rosdep/sources.list.d/20-default.list'
solutions to some problems (later down the road) propose the following (which actually should not make a difference):
sudo rm -rf /etc/ros/rosdep

Uninstall a few things if installed
brew uninstall cmake libyaml lz4 theora
brew uninstall boost
brew uninstall opencv
brew uninstall homebrew/science/pcl
brew uninstall fltk

Clean up all python packages
sudo rm -rf /Library/Python/2.7/site-packages

Uninstall homebrew, warning this will cause trouble for anything linked against older hombrewed libraries
never did so
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
rm -rf /usr/local/Library/Taps

Comment everything related to ROS in your .bashrc/.zshrc
vi .profile

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)"

Do this manually and check for additional remarks
brew update
brew doctor

Install zshell, if you want to use bash instead, you should change the sourced files from .zsh to .bash
brew install zsh
echo export PATH='/usr/local/bin:$PATH' >> ~/.profile
source .profile

Install brewed python
brew install python
pip install --upgrade pip setuptools
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
brew tap homebrew/dupes
brew tap dartsim/dart

Prerequisites
brew install cmake libyaml lz4 theora
brew install boost --with-python --c++11
brew install opencv --with-qt --with-eigen --with-tbb
brew install homebrew/science/pcl --HEAD --without-apps --without-qt #https://github.com/Homebrew/homebrew-science/issues/2593
(brew install opencv3 --with-qt --with-eigen --with-tbb)
brew install fltk --devel

Install the ROS infrastructure tools, you may have to run this several times until all python deps are properly installed
strangely during some attemts it was necessary to run twice:
sudo -H pip install -U setuptools rosdep rosinstall_generator wstool rosinstall catkin_tools catkin_pkg bloom empy sphinx
sudo -H pip install -U setuptools rosdep rosinstall_generator wstool rosinstall catkin_tools catkin_pkg bloom empy sphinx

Download ROS sources
mkdir ros_catkin_ws && cd ros_catkin_ws
rosinstall_generator desktop_full --rosdistro jade --deps --tar > jade.rosinstall
wstool init -j8 src jade.rosinstall
Aaccording to 'official' instruction (http://wiki.ros.org/jade/Installation/OSX/Homebrew/Source) - tried both and can't remember any difference (during install)
rosinstall_generator desktop_full --rosdistro jade --deps --wet-only --tar > jade-desktop-full-wet.rosinstall
wstool init -j8 src jade-desktop-full-wet.rosinstall

Install the necessary ROS dependencies
sudo rosdep init
rosdep update

There my be the following eror during the next instruction, with the solution one can find somewhere.
The 'doesn't get you a complete install' may also be the reason for some later problems, but I could not figure out a better solution:
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
opencv_apps: No definition of [procps] for OS [osx]
Resolve like this:
Put a file named CATKIN_IGNORE in the opencv_apps package, so that catkin doesn't try to build it. Obviously this doesn't get you a complete install, but you should be able to proceed.
You may also need to run rosdep with the --skip-keys=procps option to make it ignore the bad dependency.
http://answers.ros.org/question/224956/no-definition-of-procps-for-os-osx/

Furthermore there may be error in 'executing command [brew install vtk --with-qt]':
Warning: homebrew/science/vtk-6.3.0 already installed
ERROR: the following rosdeps failed to install
homebrew: Failed to detect successful installation of [vtk --with-qt]
May possibly be resolved by uninstalling vtk first (vtk seems to be reinstalled by the following 'rosdep...' then)
brew uninstall vtk

rosdep install --from-paths src --ignore-src --rosdistro jade -y

fix pcl_ros according to ros-perception/perception_pcl#106 (comment)
well this patch doesnt work yet but you get the idea
The sed-instruction n the original script does not work on a MAC (with the 'offical' sed) (it is the 'newline' that causes the problems)
General remark: carefully check 'solutions' from the web - there are some differences in MAC/linux syntax.
if [ -d src/perception_pcl/pcl_ros ]; then
sed -i -e 's/find_package(Eigen3 REQUIRED)/find_package(PkgConfig)
pkg_search_module(Eigen3 REQUIRED eigen3)/g' src/perception_pcl/pcl_ros/CMakeLists.txt
fi

fix Ogre 1.74 according to mike
Grabbing these older meshes allows rviz to run with Ogre 1.7 rather than Ogre 1.8+. Although formulae and patches
exist to build Ogre 1.9, rviz, and Gazebo together, I have found this approach to be the most solid and consistent.
if [ -d src/rviz ]; then
pushd src/rviz/ogre_media/models
curl https://raw.githubusercontent.com/ros-visualization/rviz/hydro-devel/ogre_media/models/rviz_cone.mesh > rviz_cone.mesh
curl https://raw.githubusercontent.com/ros-visualization/rviz/hydro-devel/ogre_media/models/rviz_cube.mesh > rviz_cube.mesh
curl https://raw.githubusercontent.com/ros-visualization/rviz/hydro-devel/ogre_media/models/rviz_cylinder.mesh > rviz_cylinder.mesh
curl https://raw.githubusercontent.com/ros-visualization/rviz/hydro-devel/ogre_media/models/rviz_sphere.mesh > rviz_sphere.mesh
popd
fi

Build in parallel with catkin ~40 min on my computer
sudo mkdir -p /opt/ros/jade
sudo chown $USER /opt/ros/jade

If sip and/or pyqt is not found by Python during execution of the later instructions, try:
brew uninstall sip
brew install sip
brew uninstall pyqt
brew install pyqt
and restart
catkin config --install --install-space /opt/ros/jade

The next command was given as:
catkin build
-DCMAKE_BUILD_TYPE=Release
-DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7

Some error may advise to run instead:
./src/catkin/bin/catkin_make_isolated --install
--install-space /opt/ros/jade
-DCMAKE_BUILD_TYPE=Release
-DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7

Possibly some variables need to be adapted
-DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7

to work around the dyld issue mikepurvis/ros-install-osx#12 (comment)
well this patch doesnt work yet but you get the idea
sed not working on MAC like given below added 'export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/ros/jade/lib' to '/opt/ros/jade/bin/rosrun' manually
(sed -i -e 's/#!/usr/bin/env bash/export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/ros/jade/lib/g' /opt/ros/jade/bin/rosrun)

Source the build ROS, prepare the workspace and from then on only source this one
source /opt/ros/jade/setup.bash
cd ~/ros_catkin_ws
mv src src_isolated
mv devel devel_isolated
mv build build_isolated
mkdir src

change and source .profile: 'source ~/ros_catkin_ws/devel_isolated/setup.bash' first

catkin_make
echo 'source ~/ros_catkin_ws/devel_isolated/setup.bash' >> ~/.profile
"

@acornellier
Copy link

Would anybody here happen to know how to install ros-jade-ros-tutorials on El Capitan as well?

@ramamoorthyluxman
Copy link

Hi. I am stuck with this. Somebody help me please ?

rosdep install --from-paths src --ignore-src --rosdistro jade -y
executing command [brew install homebrew/science/pcl --HEAD]
==> Installing pcl from homebrew/science
==> Installing dependencies for homebrew/science/pcl: cminpack, qhull, libusb, glew, vtk
==> Installing homebrew/science/pcl dependency: cminpack
==> Downloading http://devernay.free.fr/hacks/cminpack/cminpack-1.3.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/cminpack-1.3.4.tar.gz
Error: SHA256 mismatch
Expected: 3b517bf7dca68cc9a882883db96dac0a0d37d72aba6dfb0c9c7e78e67af503ca
Actual: 640ad842776ed2d80b08887f8400e6ac35e09456b2175fc7fd6fecbddde6319f
Archive: /Library/Caches/Homebrew/cminpack-1.3.4.tar.gz
To retry an incomplete download, remove the file above.
ERROR: the following rosdeps failed to install
homebrew: command [brew install homebrew/science/pcl --HEAD] failed

@ramamoorthyluxman
Copy link

Homebrew installation of PCL libraries (homebrew/science/pcl, Line# 65) isn't working currently due to upstream problem. If you get the above error as I did, I have a solution. Download PCL 1.8 master from GitHub (https://github.com/PointCloudLibrary/pcl). Edit the " /opt/ros/jade/share/pcl_conversions/cmake/pcl_msgsConfig.cmake" using nano or VI editor. Just find the text "pcl-1.6" in the file and replace them with "pcl-1.8". And then follow the remaining steps.

@RPEK001
Copy link

RPEK001 commented Mar 2, 2016

Starting ==> rospack

[rospack] ==> '/Users/RoyPekJunJie/ros_catkin_ws/build/rospack/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j' in '/Users/RoyPekJunJie/ros_catkin_ws/build/rospack'
Scanning dependencies of target rospack
[ 11%] Building CXX object CMakeFiles/rospack.dir/src/rospack.cpp.o
[ 22%] Building CXX object CMakeFiles/rospack.dir/src/rospack_backcompat.cpp.o
make[2]: *** No rule to make target /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib', needed by/Users/RoyPekJunJie/ros_catkin_ws/devel/lib/librospack.dylib'. Stop.
make[2]: *** Waiting for unfinished jobs....
[ 33%] Building CXX object CMakeFiles/rospack.dir/src/rospack_cmdline.cpp.o
[ 44%] Building CXX object CMakeFiles/rospack.dir/src/utils.cpp.o
/Users/RoyPekJunJie/ros_catkin_ws/src/rospack/src/rospack.cpp:78:9: warning: 'PyUnicode_FromString' macro redefined [-Wmacro-redefined]

define PyUnicode_FromString PyString_FromString

    ^

/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:194:10: note: previous definition is here
define PyUnicode_FromString PyUnicodeUCS2_FromString
^
1 warning generated.
make[1]: *** [CMakeFiles/rospack.dir/all] Error 2
make: *** [all] Error 2
[rospack] <== '/Users/RoyPekJunJie/ros_catkin_ws/build/rospack/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j' failed with return code '2'

Failed <== rospack [ 6.9 seconds ]
Finished <== ros_comm [ 2 minutes and 55.6 seconds ]
[build] There were '1' errors:

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

Command to reproduce:
cd /Users/RoyPekJunJie/ros_catkin_ws/build/rospack && /Users/RoyPekJunJie/ros_catkin_ws/build/rospack/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j; cd -

Path to log:
cat /Users/RoyPekJunJie/ros_catkin_ws/build/build_logs/rospack.log

Exited with return code: 2

[build] Runtime: 5 minutes and 27.2 seconds

@jacksonkr - facing the same issue as you I think... Have you gotten a solution?

@jaeyoung-han
Copy link

@RPEK001, @jacksonkr

I had the same issue -- "Python.h" file not found, and I solved.

The reason is that the version of python described in line 106 and 107 of the above code is different from your actual version.
Check the version of your python. Your python version may be 2.7.11.

python --version

Makefiles are already created with invalid version number, you should reset and restart build with your python version number.

(I deleted ros_catkin_ws directory and restarted from line 73.)

In case of python 2.7.11, use below.

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

@sorjef
Copy link

sorjef commented Mar 10, 2016

A small note to the previous comment:
You may just delete ros_catkin_ws/build directory and start catkin build right away.

So the commands to fix this issue will be:

rm -rf build

and

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

@jmtatsch
Copy link
Author

Just built again from source again, pretty much works as expected :)

@asvetly
Copy link

asvetly commented Mar 21, 2016

Hello there! I have some issue with -ltbb. Can someone help with this?

Starting ==> polled_camera                                                                                                                                                                                  
Finished <== polled_camera                    [ 11.1 seconds ]                                                                                                                                              
Starting ==> compressed_depth_image_transport                                                                                                                                                               

[compressed_depth_image_transport] ==> '/Users/Alexander/ros_catkin_ws/build/compressed_depth_image_transport/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j' in '/Users/Alexander/ros_catkin_ws/build/compressed_depth_image_transport'
Scanning dependencies of target compressed_depth_image_transport_gencfg
[ 16%] Generating dynamic reconfigure files from cfg/CompressedDepthPublisher.cfg: /Users/Alexander/ros_catkin_ws/devel/include/compressed_depth_image_transport/CompressedDepthPublisherConfig.h /Users/Alexander/ros_catkin_ws/devel/lib/python2.7/site-packages/compressed_depth_image_transport/cfg/CompressedDepthPublisherConfig.py
Generating reconfiguration files for CompressedDepthPublisher in compressed_depth_image_transport
Wrote header file in /Users/Alexander/ros_catkin_ws/devel/include/compressed_depth_image_transport/CompressedDepthPublisherConfig.h
[ 16%] Built target compressed_depth_image_transport_gencfg
Scanning dependencies of target compressed_depth_image_transport
[ 33%] Building CXX object CMakeFiles/compressed_depth_image_transport.dir/src/compressed_depth_publisher.cpp.o
[ 50%] Building CXX object CMakeFiles/compressed_depth_image_transport.dir/src/compressed_depth_subscriber.cpp.o
[ 66%] Building CXX object CMakeFiles/compressed_depth_image_transport.dir/src/codec.cpp.o
[ 83%] Building CXX object CMakeFiles/compressed_depth_image_transport.dir/src/manifest.cpp.o
/Users/Alexander/ros_catkin_ws/src/image_transport_plugins/compressed_depth_image_transport/src/codec.cpp:333:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
[100%] Linking CXX shared library /Users/Alexander/ros_catkin_ws/devel/lib/libcompressed_depth_image_transport.dylib
ld: library not found for -ltbb
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/Alexander/ros_catkin_ws/devel/lib/libcompressed_depth_image_transport.dylib] Error 1
make[1]: *** [CMakeFiles/compressed_depth_image_transport.dir/all] Error 2
make: *** [all] Error 2
[compressed_depth_image_transport] <== '/Users/Alexander/ros_catkin_ws/build/compressed_depth_image_transport/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j' failed with return code '2'

Failed   <== compressed_depth_image_transport [ 11.7 seconds ]                                                                                                                                              
Finished <== pluginlib_tutorials              [ 3 minutes and 26.2 seconds ]                                                                                                                                
[build] There were '1' errors:                                                                                                                                                                              

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

# Command to reproduce:
cd /Users/Alexander/ros_catkin_ws/build/compressed_depth_image_transport && /Users/Alexander/ros_catkin_ws/build/compressed_depth_image_transport/build_env.sh /usr/bin/make --jobserver-fds=3,4 -j; cd -

# Path to log:
cat /Users/Alexander/ros_catkin_ws/build/build_logs/compressed_depth_image_transport.log

Exited with return code: 2 

[build] Runtime: 29 minutes and 13.7 seconds 

@Forest-Dewberry
Copy link

When I run the line:
brew install boost --with-python --c++11

I get this:
==> Downloading https://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2
==> Downloading from http://netcologne.dl.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2

################################################################## 100.0%

==> Patching
patching file boost/graph/adjacency_matrix.hpp
==> ./bootstrap.sh --prefix=/usr/local/Cellar/boost/1.60.0_1 --libdir=/usr/local/Cellar/boost/1.60.0_1/lib --witho
==> ./b2 headers
==> ./b2 --prefix=/usr/local/Cellar/boost/1.60.0_1 --libdir=/usr/local/Cellar/boost/1.60.0_1/lib -d2 -j4 --layout=

Then it just stops. My terminal stops doing anything. I have to ctrl-C out of it. What's going on? How do I fix this?

@jemdiggity
Copy link

@Forest-Dewberry I had the same issue. It built fine if drop the --c++11 flag, ie brew install boost

@jemdiggity
Copy link

after running catkin_make, I get a error about not finding nosetests:
CMake Warning at /opt/ros/jade/share/catkin/cmake/test/nosetests.cmake:98 (message): nosetests not found, Python tests can not be run (try installing package 'python-nose') Call Stack (most recent call first): /opt/ros/jade/share/catkin/cmake/all.cmake:147 (include) /opt/ros/jade/share/catkin/cmake/catkinConfig.cmake:20 (include) CMakeLists.txt:52 (find_package)

I found that nosetests is in /usr/local/Cellar/numpy/1.11.0/libexec/nose/bin/. Should it be linked somewhere else?

@weimzh
Copy link

weimzh commented Aug 27, 2016

@fangbq if you are from China you need a VPN as some download sources are GFW'ed.

@Needrom
Copy link

Needrom commented Sep 7, 2016

I failed to install some of the pack in it .I could not use it completely.so I want to uninstall it .but how to uninstall fully

@taozhi8833998
Copy link

taozhi8833998 commented Oct 25, 2016

@ramamoorthyluxman an easy to fix the sha256 not match error, you should not download the cminpack-1.3.4.tar.gz through browser, you chould get it by thunder or download it from here and change the file name to cminpack-1.3.4.tar.gz. the SHA256 matched, take a look at this page.
And then follow the remaining steps, it worked for me.

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