Catkin: Building install space from prebuilt devel space
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?
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. Thecmake ..; make; sudo make install
pattern does not apply here, you have to either do install or devel.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.
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.
I have also not tested if unit tests can be run from an install space. I should test that.
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.