Ask Your Question
5

Should catkin_make work for package targets?

asked 2013-02-04 04:02:36 -0500

dornhege gravatar image

Should it be possible to do catkin_make PACKAGE like rosmake PACKAGE? If yes, given this simple setup from the tutorials, am I doing something wrong or should I file a bug?

tree src/
src/
├── beginner_tutorials
│   ├── CMakeLists.txt
│   ├── include
│   ├── msg
│   │   └── Num.msg
│   ├── package.xml
│   ├── scripts
│   │   └── talker.py
│   ├── src
│   │   ├── listener.cpp
│   │   └── talker.cpp
│   └── srv
│       └── AddTwoInts.srv
└── CMakeLists.txt -> /opt/ros/groovy/share/catkin/cmake/toplevel.cmake
catkin_make clean
Base path: /home/dornhege/rosws_groovy/testing
Source space: /home/dornhege/rosws_groovy/testing/src
Build space: /home/dornhege/rosws_groovy/testing/build
Devel space: /home/dornhege/rosws_groovy/testing/devel
Install space: /home/dornhege/rosws_groovy/testing/install
####
#### Running command: "make cmake_check_build_system" in "/home/dornhege/rosws_groovy/testing/build"
####
####
#### Running command: "make -j12 -l12 clean" in "/home/dornhege/rosws_groovy/testing/build"
####
catkin_make beginner_tutorials
Base path: /home/dornhege/rosws_groovy/testing
Source space: /home/dornhege/rosws_groovy/testing/src
Build space: /home/dornhege/rosws_groovy/testing/build
Devel space: /home/dornhege/rosws_groovy/testing/devel
Install space: /home/dornhege/rosws_groovy/testing/install
####
#### Running command: "make cmake_check_build_system" in "/home/dornhege/rosws_groovy/testing/build"
####
####
#### Running command: "make -j12 -l12 beginner_tutorials" in "/home/dornhege/rosws_groovy/testing/build"
####

There is a target beginner_tutorials, otherwise there would be an error, but nothing is built.

Calling the actual target within the package works:

catkin_make talker
Base path: /home/dornhege/rosws_groovy/testing
Source space: /home/dornhege/rosws_groovy/testing/src
Build space: /home/dornhege/rosws_groovy/testing/build
Devel space: /home/dornhege/rosws_groovy/testing/devel
Install space: /home/dornhege/rosws_groovy/testing/install
####
#### Running command: "make cmake_check_build_system" in "/home/dornhege/rosws_groovy/testing/build"
####
####
#### Running command: "make -j12 -l12 talker" in "/home/dornhege/rosws_groovy/testing/build"
####
[100%] Building CXX object beginner_tutorials/CMakeFiles/talker.dir/src/talker.cpp.o
Linking CXX executable /home/dornhege/rosws_groovy/testing/devel/lib/beginner_tutorials/talker
[100%] Built target talker

Calling catkin_make shows that there are still things that were not built:

catkin_make
Base path: /home/dornhege/rosws_groovy/testing
Source space: /home/dornhege/rosws_groovy/testing/src
Build space: /home/dornhege/rosws_groovy/testing/build
Devel space: /home/dornhege/rosws_groovy/testing/devel
Install space: /home/dornhege/rosws_groovy/testing/install
####
#### Running command: "make cmake_check_build_system" in "/home/dornhege/rosws_groovy/testing/build"
####
####
#### Running command: "make -j12 -l12" in "/home/dornhege/rosws_groovy/testing/build"
####
[  0%] [  0%] [  0%] [  0%] [  0%] [  0%] Generating Lisp code from beginner_tutorials/Num.msg
Generating Python code from SRV beginner_tutorials/AddTwoInts
[ 10%] Generating Lisp code from beginner_tutorials/AddTwoInts.srv
Generating C++ code from beginner_tutorials/Num.msg
Generating Python from MSG beginner_tutorials/Num
Generating C++ code from beginner_tutorials/AddTwoInts.srv
[ 20%] Built target talker
Building CXX object beginner_tutorials/CMakeFiles/listener.dir/src/listener.cpp.o
[ 30%] [ 30%] [ 40%] Built target beginner_tutorials_genlisp
Generating Python msg __init__.py for beginner_tutorials
Generating Python srv __init__.py for beginner_tutorials
[ 80%] Built target beginner_tutorials_genpy
[100%] Built target beginner_tutorials_gencpp
Linking CXX executable /home/dornhege/rosws_groovy/testing/devel/lib/beginner_tutorials/listener
[100%] Built target listener
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
3

answered 2013-02-04 04:29:27 -0500

KruseT gravatar image

This is not intended by catkin.

It can sometimes work, but it may sometimes not work. "catkin_make xyz" means making the cmake target xyz. I believe cmake adds a target for each subfolder by default, thogh not sure what goes into that target. Also that target may be overriden e.g. by add_executable(xyz ...).

If you want a target like that, you might ask for it on github.

edit flag offensive delete link more

Comments

1

I see where this comes from. OK, so with the common node_name = package_name, this would only built the node itself, but not the rest of the package.

dornhege gravatar imagedornhege ( 2013-02-04 04:40:49 -0500 )edit
1

What if catkin defined targets like "_xyz_pkg_" and then catkin_make had a subcommand like "pkg" that would pass through to make the appropriate target so you could call catkin_make pkg xyz to build the entire package named "xyz"?

jbohren gravatar imagejbohren ( 2013-02-04 05:23:22 -0500 )edit

That would be a nice solution. I put up a request at: https://github.com/ros/catkin/issues/346

dornhege gravatar imagedornhege ( 2013-02-04 06:01:13 -0500 )edit
1

+1 to @jbohren since there's no +1 on github

130s gravatar image130s ( 2013-02-04 09:51:12 -0500 )edit
3

As of: https://github.com/ros/catkin/issues/348catkin_make will now have a --pkg argument to build a specific package in a workspace.

jbohren gravatar imagejbohren ( 2013-02-05 13:52:35 -0500 )edit
5

answered 2013-09-03 23:33:46 -0500

fivef gravatar image

To make jbohren's answer clear for everyone:

catkin_make --pkg <my_package_name>

Example:

catkin_make --pkg turtlebot

Multiple Packages:

catkin_make --pkg <package A> <package B>
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-02-04 04:02:36 -0500

Seen: 1,559 times

Last updated: Sep 03 '13