Ask Your Question

catkin_make error in hydro

asked 2014-06-10 01:49:00 -0600

rufus gravatar image

updated 2014-06-10 05:44:47 -0600

I'm following the building packages tutorial, but getting stuck at catkin_make on a brand new catkin workspace.

$ cd ~/catkin_ws $ catkin_make gives:

-- Using CATKIN_DEVEL_PREFIX: /home/rufus/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/hydro
-- This workspace overlays: /opt/ros/hydro
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Python version: 2.7
-- Using Debian Python package layout
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/rufus/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- catkin 0.5.86
/home/rufus/catkin_ws/devel/ 1: /opt/ros/hydro/etc/catkin/profile.d/05.catkin_make.bash: Syntax error: "(" unexpected
Traceback (most recent call last):
  File "/home/rufus/catkin_ws/build/catkin_generated/", line 21, in <module>
    code = generate_environment_script('/home/rufus/catkin_ws/devel/')
  File "/opt/ros/hydro/lib/python2.7/dist-packages/catkin/", line 61, in generate_environment_script
    output = subprocess.check_output([env_script, sys.executable, '-c', python_code])
  File "/usr/lib/python2.7/", line 544, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/home/rufus/catkin_ws/devel/', '/usr/bin/python', '-c', 'import os; print(dict(os.environ))']' returned non-zero exit status 2
CMake Error at /opt/ros/hydro/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/hydro/share/catkin/cmake/all.cmake:178 (safe_execute_process)
  /opt/ros/hydro/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:52 (find_package)

-- Configuring incomplete, errors occurred!
Invoking "cmake" failed

Apparently something goes wrong in generating the environment. Same problem happens when using the zshell instead of bash.

I'm using: ROS Hydro in an ubuntu virtual machine GNU bash, version 4.2.25(1)-release (i686-pc-linux-gnu) catkin 0.5.86 cat /proc/version: Linux version 3.2.0-60-generic-pae (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #91-Ubuntu SMP Wed Feb 19 04:14:56 UTC 2014

Any suggestions?

Further information, in reaction to comment 1:

I work with a clean workspace, no packages. ROS Hydro was already installed in my virtual machine. After "sudo rosdep init" and "rosdep update", that seem to work properly, I generate my catkin workspace:

mkdir -p catkin_ws/src
cd ~/catkin_ws/src
source /opt/ros/hydro/setup.bash
cd ~/catkin_ws
catkin_make                       # do make on just clean catkin workspace

This gives the error as given above. Also after starting roscore the catkin_make gives the same error. The package catkin can be found:

$ rospack find catkin               # gives:

However, the packages catkin_pkg or catkin-pkg cannot be found.

edit retag flag offensive close merge delete


Can you provide some more information on how you created the workspace? Any packages present in the workspace? The error seems to indicate a syntax error in a ROS distributed file, but the error could be caused by some other error earlier on.

gvdhoorn gravatar image gvdhoorn  ( 2014-06-10 04:39:20 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-06-10 09:00:22 -0600

rufus gravatar image

updated 2014-06-12 01:20:01 -0600

Problem solved!
My standard shell was zsh, I prefer this one over bash, and since it is supported in ros I decided to stick to zsh. With the problem with catkin_make I decided to switch to bash, because that might be better supported. However, I kept my standard shell to zsh.
Changing the shell with chsh -s /bin/bash (logging out and in again) and following the steps in the tutorial, did the job. So I can go on with ROS. Thanks for your help! Conclusion: I don't recommend zsh for ROS... (issue has been fixed, see below comment)

edit flag offensive delete link more


If you mind about zsh being supported you might want to reconsider your decision. Trying to reproduce the problem you have and filling an issue will very likely get the problem fixed if there is one.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-06-10 11:50:23 -0600 )edit

I agree, thanks for encouraging to get things right with zsh. I filed an issue (#652) on

rufus gravatar image rufus  ( 2014-06-10 16:47:35 -0600 )edit

issue with zsh is solved in the catkin reset_shell at by; so now I'm using zsh again.

rufus gravatar image rufus  ( 2014-06-12 01:17:13 -0600 )edit

answered 2014-06-10 07:05:04 -0600

gvdhoorn gravatar image

updated 2014-06-10 07:06:25 -0600

mkdir -p catkin_ws/src
cd ~/catkin_ws/src
source /opt/ros/hydro/setup.bash

If this is a copy/paste (rather than a 'this is almost what I did, from memory'), shouldn't it really be:

mkdir -p catkin_ws/src
cd ~/catkin_ws/src
source /opt/ros/hydro/setup.bash

(note: first source, then invoke catkin_init_workspace)

At least, the Creating a workspace for catkin tutorial seems to suggest that (first commandline under Prerequisites).

edit flag offensive delete link more


thank you for your suggestions! I've tried to do it in this order, again from scratch, but without result. Found somewhere the suggestion to add /usr to the CMAKE_PREFIX_PATH, but that doesn't help.

rufus gravatar image rufus  ( 2014-06-10 08:04:20 -0600 )edit

Strange. Performing the steps you described in a new terminal, new workspace results in an empty workspace that I can build using catkin_make. No errors, no warnings. Perhaps something in your environment that is messing things up. You don't have any 'source /opt/ros/..' lines in your .bashrc?

gvdhoorn gravatar image gvdhoorn  ( 2014-06-10 08:17:55 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2014-06-10 01:49:00 -0600

Seen: 1,583 times

Last updated: Jun 12 '14