Catkin: Building install space from prebuilt devel space

asked 2017-03-13 14:25:09 -0500

diamondman gravatar image

Hello,

I have a catkin/ros project with full install rules, and I use 'catkin build' to build the project. I am trying to make it so I can build the project in a normal devel/build space, and then generate an installer from those results, but I am having issues understanding how catkin wants me to do this.

Building with an install space enabled produces a correct installer. Unfortunately, enabling the install space requires rebuilding everything.

catkin clean  #Start Fresh
catkin build #Build devel space
catkin config --install #Enable install space
catkin build #Fails saying it is necessary to clean first
catkin clean
catkin config --install #Already set above, just making it clear this is set.
catkin build #Correctly builds install space! But cleaning and rebuilding (with different compiler flags is not acceptable).

My current solution is

catkin clean #Start Fresh
catkin build #Build devel space
catkin build -j1 --make-args install #Necessary to make catkin/cmake not randomly crash

The j1 is there because without it, catkin has threading issues and fails randomly (likely because I am triggering the install rules without catkin knowing so it does not create the install locks). I am trying to figure out the RIGHT way to make an install from an already build project, but the documentation has not mentioned it, or is referring to very old versions of catkin that are no longer applicable.

Are there any documents or commands/arguments I should look into?

edit retag flag offensive close merge delete

Comments

3

Why not just catkin clean; catkin config --install; catkin build? You don't need the devel space, it's just slightly faster to build because it doesn't do the install step for each package. The cmake ..; make; sudo make install pattern does not apply here, you have to either do install or devel.

William gravatar image William  ( 2017-03-13 19:56:12 -0500 )edit

There is a lot of python development that is done, and development spaces are much more convenient for this work. I tried clean building an install space when making a package, but they use different compiler flags. The project has safety concerns, different flags for install are a liability.

diamondman gravatar image diamondman  ( 2017-03-14 14:25:18 -0500 )edit

BTW, the main difference in the flags are the include paths. Install spaces don't pass in the normal include paths that are used in develop, and instead include from the global install space's include directory.

diamondman gravatar image diamondman  ( 2017-03-14 15:38:44 -0500 )edit

I have also not tested if unit tests can be run from an install space. I should test that.

diamondman gravatar image diamondman  ( 2017-03-14 16:15:32 -0500 )edit

It just feels so wrong to be working on code in a dev space and decide to build a package which requires you to throw away all the binaries you have built, and rebuild the same files in an install space. Then if you want to go back to developing, you have to throw those files away again and rebuild.

diamondman gravatar image diamondman  ( 2017-03-14 18:04:33 -0500 )edit