0
$\begingroup$

Rosanswers logo

I've created 2 catkin workspaces, then I decided to rm -rf one of them. It seems like there should be a better way to remove it because some environment variables are lingering around with that path, namely $CMAKE_PREFIX_PATH.

  1. Where does ROS set $CMAKE_PREFIX_PATH so I can remove any references to it now that I've deleted it?

  2. Is there a proper way to delete a catkin workspace so that all environmental variables are cleaned up?

Answer: I 'sourced' both my devel workspace 'setup.bash' and the groovy installation 'setup.bash', when I removed that line from my .bashrc (as the commenter said) CMAKE_PREFIX_PATH was no longer set.

Deleting build and develop and simply calling catkin_make again, then sourcing my workspace only in .bashrc fixed it.

Thank you! :D


Originally posted by plunder on ROS Answers with karma: 43 on 2013-06-26

Post score: 4


Original comments

Comment by lindzey on 2013-06-26:
If the problem persists after a reboot, the problem is probably in your ~/.bashrc. Can you post the contents of that file?

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

This stuff can get very confusing and cause serious errors.

The general recommendation when switching workspaces is always to open a new shell, and source the relevant setup.bash. For catkin, that is normally in devel/ subdirectory.

UPDATE: If you are sourcing the correct setup.bash in your ~/.bashrc and creating a new shell (or rebooting) does not work, there must have been something wrong when you originally created your workspace. The usual error is having forgetten to source the appropriate lower-level setup.bash before running catkin_make.

That is an easy mistake to make. When I find myself in that situation, I do one of these recovery procedures:

  • Create a new workspace, more carefully this time.
  • Delete everything but the src/ subdirectory, source the correct dependency, then re-run catkin_make or catkin_init_workspace.

There may be other solutions, but I find that hacking around in the various generated files just creates frustration and wastes time.


Originally posted by joq with karma: 25443 on 2013-06-26

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by plunder on 2013-06-26:
Well, I've already done that but when I reboot the the CMAKE_PREFIX_PATH persists, I'd really like to clean that up, do you know how?

Comment by William on 2013-06-26:
I you have a CMAKE_PREFIX_PATH after reboot then you are setting it in your ~/.bashrc most likely. Look in that file to see if you are source'ing any setup.bash files. If you are, delete or comment that line out and open a new terminal. Rebooting is not necessary, just open a new terminal.

Comment by plunder on 2013-06-26:
I am sourcing 2 files in my .bashrc, 1 is /opt/ros/groovy/setup.bash the other is my current catkin_workspace ~/ros_ws/devel/setup.bash.. I'll try removing these when I get home and see if this solves my issue

Comment by joq on 2013-06-26:
If things were set up correctly, the workspace should source /opt/ros/groovy/setup.sh for you.

$\endgroup$
0
$\begingroup$

Rosanswers logo

For those using catkin tools, an easy solution is: catkin clean --deinit at the directory of your workspace.


Originally posted by hayaalsh with karma: 11 on 2018-11-01

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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