[ros-users] catkin_make convenience improvements

Dirk Thomas dthomas at willowgarage.com
Wed Jan 30 20:47:41 UTC 2013


One thing to keep in mind is an important design goal of catkin (which is actually the global goal for all future developments):
New tools should be based as much as possible on external libraries and tools. Namely: do not reinvent the wheel.

For catkin that means it is based on CMake because that is one of the most used tools for building C++.
And therefore catkin aims to keep the standard CMake workflow working - so the user can build stuff just as he does with vanilla CMake.
catkin_make provide some "sugar" on top of that to make the workflow easier, but it should not try blindly to resemble whatever was there in rosmake.

One example would be why catkin_make does not have an argument like "--debug" to build in debug mode.
It might look like a convenient option for users but we want to keep these tools slim and not bloat them with rebuilding already existing functionality.
Rather than implementing "--debug" and telling the user to use that we teach the users to use the standard CMake argument "-DCMAKE_BUILD_TYPE=Debug" directly.

I.e. using a tool like "catkin loadws" to source the environment is exactly what we want to avoid.
Why wrapping something like this behind yet another tool? People have no chance to understand what is actually going on behind the scene.
Teach them why they need an environment and that the setup.sh is providing that when sourcing it.
Moving the build/devel/install folder in some hidden is imho another example of what you should actually not do (even if you can with the current catkin by passing in custom folder for 
build/devel/install).

Anyway we are looking for ways to make catkin_make have a bit more sugar to make that tool easier and more convenient to use.

- Dirk


On 30.01.2013 12:18, Jonathan Bohren wrote:
> On Wed, Jan 30, 2013 at 11:59 AM, Thibault Kruse <kruset at in.tum.de <mailto:kruset at in.tum.de>> wrote:
>
>     I raised some concerns over catkin_make convenience in a meeting, here are the results of the brainstorming. catkin_make is mostly a convenience wrapper to cmake/make, for usage with the catkin
>     build system starting with ROS Groovy.
>
>     The current catkin_make design was guided by the desire to have a consistent and self-explaining workspace layout for tutorials and novice users, a quick way to create workspaces, and a wrapper
>     around cmake to reduce cumbersome typing of common -D options.
>
>     In it's current state, catkin_make may not as convenient as it could be. Current quirks are:
>     - the workspace/src folder in itself is not popular with everybody
>     - it is inconvenient to have to cd into the workspace folder to invoke catkin_make
>
> +1
>
>     - it is inconvenient that wstool commands work in the src folder and below only, currently, meaning another "cd" step
>
> +1
>
>     - invoking catkin_make once with custom options (for build/src locations), and then again without options does not remember the last options, and retyping the options is also cumbersome.
>     - cleaning up builds (make clean, make distclean) does not work too well and is cumbersome, more support would be nice
>
>     Since REP128 (http://ros.org/reps/rep-0128.__html <http://ros.org/reps/rep-0128.html>) does not make a strong effort to justify the design it defines, we have to also look at some use cases and
>     find justifications.
>
>     - We can consider 3 types of user groups who may want to use catkin_make
>     -- total noobs: Those need one source space, one build configuration and that's it
>
> +100
>
>     -- advanced programmers: Those may typically have 2 build configurations, one with debug settings, one with performance optimized settings
>     -- power users: Those may have a large number of build configurations for the same workspace, for cross compilation experiments and such
>     I assume the toplevel "src" folder allows to have some cleanliness in particular for power users, having multiple build, devel and install spaces at the workspace root level, and packages one
>     level below. On the other hand, I assume it would be similarly clean if all build, devel and install spaces were stored away in workspace/builds, and packages else reside in the workspace root.
>
>     - catkin workspaces are used by several people using symbolic linking (for convenience, and maybe due to known limitations of catkin overlaying)
>
>     - catkin also does env_caching, which needs to be taken into account for sequences of buildspace creation actions
>
>     - there is also catkin_make_isolated, which currently creates a different folder layouts, maybe some consolidation could happen there as well
>
>
>
>     So some design strategies that we came up with regarding more flexibility of invoking catkin_make and setting up workspace layouts according to personal preferences.
>
>
>     Alternative "Marker-file":
>     This idea involves placing a marker file at the workspace root, which can be used by catkin_make as point of reference when invoked in a subfolder (and maybe also by roscd without arguments). To
>     support invoking catkin_make without arguments with custom paths, the marker file could have content that defines build configurations, e.g. the last one that was specified. For users that
>     typically have multiple build configurations, this could be extended to have differently named configurations. Probably cmake already caches options for us, so really what could be stored in the
>     marker file would be the path to a build space. However build-spaces get nuked regularly  (since we have no great "clean" target), so duplication of information might still make sense in the
>     marker file (unless we find a nice "clean" command).
>     Such a markerfile might also be made compliant with wstool, one way or the other. The disadvantage here is that some additional infrastructure is require, to be maintained.
>
>     Alternative "Build Env Switching":
>     This idea involves switching build configurations (rather than workspaces), meaning every build folder gets it's own file to source, like "setup.sh", though a different name might be better. Such
>     a file would declare an env variable pointing to the build folder, and invoking catkin_make from anywhere would invoke cmake/Make in the folder of the env var (if set). Disadvantages are that this
>     is less transparent to the user, requires the user to know about this setup file as well, and encourages the bad habit of reusing the same shell for different build environments.
>
>     So this is just brainstorming, and anyone who feels passionately enough about catkin_make is welcome to contribute ideas, opinions, (informal) votes. The next steps could be to write prototypes
>     and a REP. Once we start doing that, we'll probably take the discussion to the ROS Buildsystem SIG, but I'd be happy to get some feedback by mere catkin users.
>
>
> Thibault,
>
> Thanks for bringing up this design discussion! I'd also like to see the catkin workflow made simpler and more intuitive for those not familiar with FHS and the nitty-gritty of CMake. I have a bunch of
> thoughts / opinions / feedback from using rosbuild and catkin, as well as explaining catkin to my colleagues who are used to rosbuild.
>
> Whenever I'm using catkin, I feel like it's been designed primarily for the people who want to release and/or install code, and focuses on solving those problems more than it does make
> it convenient for the student or researcher who only ever builds his or her code from source.
>
> What if, given a workspace, we could just have a bunch of source packages and then we could put all of the "build", "devel", and "install" directories under a hidden directory called ".catkin".  Then,
> inside of the ".catkin" directory we could have a config.yaml file. This combination of ".catkin/config.yaml" will act as the marker file, and keep the workspace focused on the source code instead of
> the buildsystem.
>
> Then a workspace approaches the simplicity of a rosbuild workspace managed with rosws.
>
>   - my_project_workspace/
>     - .catkin/
>       - build
>       - devel
>       - install
>     - my_package_a...
>     - my_package_b...
>     - some_repo_x
>       - some_package_c
>       - some_package_d
>
> Then have commands like "catkin loadws" to source .catkin/devel/setup.sh (this also becomes more cross-platform than manually sourcing one of the several shell scripts in your "devel" directory. I
> feel like if users are going to be required to maintain this structure in their workspaces, then it should be done with tooling like the philosophy behind rosws/wstool.
>
> The main effect of this is that it brings the focus back onto the source code, as opposed to the whole catkin infrastructure. I definitely appreciate the huge amount of work that has gone into catkin,
> but I don't want to have to be messing around with these additional layers of directories. I want to be focusing on robotics code, and I just want whatever build system I'm using to stay in the
> shadows and do its thing.
>
> Rosbuild excels in this regard: as long as packages are under the $ROS_PACKAGE_PATH, you can call "rosmake some_package" from anywhere, and it just builds the code, and then to launch something you
> use rosrun or roslaunch, and you don't care about the location of the built targets. I feel like ROS already has an abstraction layer in place that catkin could be dropped into so that by I???turtle,
> you can just call "rosmake" to invoke catkin from an arbitrary place like directory, and you wouldn't even know it's using catkin.
>
> I understand that there are a ton of more advanced things that we'd like to do (and new patterns that catkin enables) but I think it would be unfortunate it we lost the ease-of-use of rosbuild.
>
> What do others think?
>
> -j
>
> --
> Jonathan Bohren
> PhD Student
> Dynamical Systems and Control Laboratory
> Laboratory for Computational Sensing and Robotics
> The Johns Hopkins University
>
> (707) 520-4736 <tel:%28707%29%20520-4736>
> jbo at jhu.edu <mailto:jbo at jhu.edu>
>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>




More information about the ros-users mailing list