Rosanswers logo

I created rosbuild workspace (mywork) and a package (test) within it.

I was trying to build the package using cmake command

[rosbuild] Building package test
[rosbuild] Error from directory check: /opt/ros/groovy/share/ros/core/rosbuild/bin/check_same_directories.py  /home/admin-pc/mywork/test
Traceback (most recent call last):
  File "/opt/ros/groovy/share/ros/core/rosbuild/bin/check_same_directories.py", line 46, in <module>
    raise Exception
CMake Error at /opt/ros/groovy/share/ros/core/rosbuild/private.cmake:102 (message):
  [rosbuild] rospack found package "test" at "", but the current directory is
  "/home/admin-pc/mywork/test".  You should double-check your
  ROS_PACKAGE_PATH to ensure that packages are found in the correct
  precedence order.
Call Stack (most recent call first):
  /opt/ros/groovy/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location)
  CMakeLists.txt:12 (rosbuild_init)

-- Configuring incomplete, errors occurred!

Originally posted by lifelonglearner on ROS Answers with karma: 205 on 2013-08-14

Post score: 0

Original comments

Comment by lifelonglearner on 2013-08-14:
With multiple hit and trial I found the solution that is to use command
source ~/mywork/setup.bash
but I need to use this in every new terminal. Please tell the solution.


2 Answers 2


Rosanswers logo

I think the only solution is to either add that line ("source ~/mywork/setup.bash") in your ~/.bashrc file, so that it gets executed for each new shell, or to manually source it in all terminals where you want to use your workspace.

Originally posted by The Martin with karma: 52 on 2013-08-14

This answer was ACCEPTED on the original site

Post score: 1


Rosanswers logo

The solution depends on how you generated your rosbuild workspace. This page contains all the info you need. But I'll summarise below.

If you created your rosbuild workspace with rosws then add to your ~/.bashrc the following line:

source $HOME/mywork/setup.bash

When going down this route make sure you called rosws after having sourced the setup.bash from your catkin devel directory (assuming you're mixing catkin and rosbuild). See the link above for more information.

Alternatively, if you want to set your workspace the "traditional" (pre-groovy) way, then append the following to ~/.bashrc:


This simply adds your rosbuild workspace to ROS's package path (which incidentally is what the error above was trying to tell you to do :P ).

Originally posted by Miguel S. with karma: 1114 on 2013-08-14

This answer was NOT ACCEPTED on the original site

Post score: 5


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.