Ask Your Question
1

I copied a workspace and now catkin_make doesn't work

asked 2017-11-19 15:35:34 -0500

alexe gravatar image

I created a workspace catkin_ws_01 and created some packages inside it.

Then I duplicated that same workspace folder to create catkin_ws_02 and made some changes to the packages inside. Then I deleted the original workspace folder catkin_ws_01.

Now when I try to run catkin_make from inside catkin_ws_02, it gives me the following error message:

CMake Error: The source directory "/home/blabla/catkin_ws_01/src" does not exist.

This means that catkin_make still refers to catkin_ws_01 even though I am executing the command from within catkin_ws_02.

What is going on and how can I fix this?

edit retag flag offensive close merge delete

Comments

Have you copied the compiled folders (build and devel)? I would remove these folders and try to compile again

I don't think the compilation problem is related to that, but it's also important to check your .bashrc file and remove any sourcing command of your old catkin_ws_01 workspace.

marcoarruda gravatar image marcoarruda  ( 2017-11-19 15:48:08 -0500 )edit

@alexe please don't delete questions after they've been answered.

ahendrix gravatar image ahendrix  ( 2017-11-19 16:09:18 -0500 )edit

@ahendrix I'm sorry, when I deleted the question I didn't even realize that there had already been an answer.

alexe gravatar image alexe  ( 2017-11-19 16:39:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2017-11-19 15:55:14 -0500

updated 2017-11-19 20:28:55 -0500

I'm using ROS Indigo distribution, I have tried to do the same in my computer and I got the following error:

CMake Error: The current CMakeCache.txt directory /home/marcoarruda/catkin_02/build/CMakeCache.txt is different than the directory /home/marcoarruda/catkin_01/build where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt

Then, I have removed the folders build and devel from catkin_02 and tried to compile again. It worked!

I don't think the compilation problem is related to that, but it's also important to remove any source catkin_01/devel/setup.bash instruction (maybe you have added to your .bashrc file)

I've created a video showing the steps to reproduce and solve it (https://youtu.be/Lg_oM4vFIEs).

edit flag offensive delete link more

Comments

Thanks, the build and devel folders were exactly the issue! After deleting them, building worked as expected :)

alexe gravatar image alexe  ( 2017-11-19 16:40:59 -0500 )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

2 followers

Stats

Asked: 2017-11-19 15:35:34 -0500

Seen: 2,327 times

Last updated: Nov 19 '17