0
$\begingroup$

Rosanswers logo

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

Originally posted by dornhege on ROS Answers with karma: 31395 on 2013-02-04

Post score: 5

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by KruseT with karma: 7848 on 2013-02-04

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by dornhege on 2013-02-04:
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.

Comment by jbohren on 2013-02-04:
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"?

Comment by dornhege on 2013-02-04:
That would be a nice solution. I put up a request at: https://github.com/ros/catkin/issues/346

Comment by 130s on 2013-02-04:
+1 to @jbohren since there's no +1 on github

Comment by jbohren on 2013-02-05:
As of: https://github.com/ros/catkin/issues/348 catkin_make will now have a --pkg argument to build a specific package in a workspace.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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>

Originally posted by fivef with karma: 2756 on 2013-09-03

This answer was NOT ACCEPTED on the original site

Post score: 5

$\endgroup$

Your Answer

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