ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A
Ask Your Question

subprocess.CalledProcessError while installing on OSX

asked 2011-12-31 00:12:07 -0500

130s gravatar image

updated 2012-02-20 11:31:12 -0500

Kevin gravatar image

I'm getting this error while installing electric on Mac OSX 10.7 Lion. Any help would be appreciated. Thanks.

  mkdir -p bin
  cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
  [rosbuild] Building package rosconsole
  [rosbuild] Including /Users/rosPudding/ros/ros_comm/clients/roslisp/cmake/roslisp.cmake
  [rosbuild] Including /Users/rosPudding/ros/ros_comm/clients/rospy/cmake/rospy.cmake
  [rosbuild] Including /Users/rosPudding/ros/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake
  -- Configuring done
  -- Generating done
  CMake Warning:
    Manually-specified variables were not used by the project:


  -- Build files have been written to: /Users/rosPudding/ros/ros_comm/tools/rosconsole/build
  cd build && make -l2
  [  0%] Built target rospack_genmsg_libexe
  [  0%] Built target rosbuild_precompile
  [ 50%] Building CXX object CMakeFiles/rosconsole.dir/src/rosconsole/rosconsole.o
  make[3]: /usr/bin/g++-4.2: No such file or directory
  make[3]: *** [CMakeFiles/rosconsole.dir/src/rosconsole/rosconsole.o] Error 1
  make[2]: *** [CMakeFiles/rosconsole.dir/all] Error 2
  make[1]: *** [all] Error 2
[ rosmake ] Output from build of package rosconsole written to:
[ rosmake ]    /Users/rosPudding/.ros/rosmake/rosmake_output-20111231-224403/rosconsole/build_output.log            
[rosmake-1] Finished <<< rosconsole [FAIL] [ 3.06 seconds ]
[ rosmake ] Halting due to failure in package rosconsole. 
[ rosmake ] Waiting for other threads to complete.
[rosmake-0] Finished <<< rospy [PASS] [ 1.15 seconds ] 
[ rosmake ] Results:
[ rosmake ] Built 18 packages with 1 failures. 
[ rosmake ] Summary output to directory
[ rosmake ] /Users/rosPudding/.ros/rosmake/rosmake_output-20111231-224403
Traceback (most recent call last):
  File "/usr/local/bin/rosinstall", line 5, in <module>
    pkg_resources.run_script('rosinstall==0.5.22', 'rosinstall')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/", line 489, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/", line 1214, in run_script
    exec script_code in namespace, namespace
  File "/Library/Python/2.7/site-packages/rosinstall-0.5.22-py2.7.egg/EGG-INFO/scripts/rosinstall", line 679, in <module>        
  File "/Library/Python/2.7/site-packages/rosinstall-0.5.22-py2.7.egg/EGG-INFO/scripts/rosinstall", line 670, in rosinstall_main        
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 504, in check_call
    raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command 'source /Users/rosPudding/ros/ && rosmake ros ros_comm --rosdep-install' returned non-zero exit status 1

I think I've tried this patch but no good. CMakeLists.txt I used is here. However, I concern what wjwwood says in this page (copied below). This sounds like the patch can solve the issue but it doesn't work for me:

The latest patch, ros_comm-1.6.5-rosconsole_g++-4.2.patch, has not been released. With completely up-to-date Xcode installs this will cause a failure when compiling rosconsole as g++-4.2 no longer exists.

I have tested the new patch, I think it needs to be applied so it can be in the next release.
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-12-31 05:56:07 -0500

William gravatar image

This happens due to the fact that Xcode-4.2 does not come with g++-4.2.

The patch you linked does fix this issue, but I don't know why it doesn't work for you.

Does /usr/bin/g++-4.2 exist on your computer?

Are you sure that you are building and patching the same ROS source install? I often have multiple and some times when I do rosmake I am unintentionally building one and editing another.

This is the output of svn diff on my install of ROS:

Index: CMakeLists.txt
--- CMakeLists.txt  (revision 15449)
+++ CMakeLists.txt  (working copy)
@@ -11,8 +11,15 @@


+# See ticket:
+# On mac use g++-4.2
 IF(${CMAKE_SYSTEM} MATCHES "Darwin-11.*")
-  set(CMAKE_CXX_COMPILER /usr/bin/g++-4.2)
+  IF(EXISTS "/usr/bin/g++-4.2")
+    set(CMAKE_CXX_COMPILER /usr/bin/g++-4.2)
+  ELSE(EXISTS "/usr/bin/g++-4.2")
+    # If there is no g++-4.2 use clang++
+    set(CMAKE_CXX_COMPILER /usr/bin/clang++)
+  ENDIF(EXISTS "/usr/bin/g++-4.2")


Other than that I don't know why that patch wouldn't work. Let use know here if it continues to be a problem.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

The deadline to submit a proposal to present at ROSCon 2017 is June 25, 2017. Submit yours now!

Question Tools


Asked: 2011-12-31 00:12:07 -0500

Seen: 400 times

Last updated: Dec 31 '11