How to stop making python targets?
I am developing a ROS module in C++ and following the tutorials, had roscreate-pkg
create CMakeLists.txt
The build process is extremely slow though, even though the code is not at all big. I noticed that it takes quite some time to build python scripts for the message and service files (which don't interest me). Including rospy.cmake
also takes some time. Overall it takes ~15 seconds before it actually starts compiling.
My question is, how can I modify CMakeLists.txt so that it would not build the python targets and focus only on C++?
This is the initial output of make
:
[rosbuild] Building package <omitted>
-- Using CATKIN_DEVEL_PREFIX: /home/<omitted>/build/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/groovy
-- This workspace overlays: /opt/ros/groovy
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- catkin 0.5.63
[rosbuild] Including /opt/ros/groovy/share/roscpp/rosbuild/roscpp.cmake
[rosbuild] Including /opt/ros/groovy/share/rospy/rosbuild/rospy.cmake
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_TOOLCHAIN_FILE
-- Build files have been written to: /home/<omitted>/build
In this output, after the first line (Building package), it takes ~6 seconds to write the next lines (Using ...) up to the line with "catkin ...". After that, it takes ~4 seconds to write "Including ... roscpp.cmake". It stops for ~9 seconds on that and then goes on to "Including ... rospy.cmake" which takes another ~4 seconds.
It is only then, that it starts actually compiling. This doesn't even include message and service file generations which each take just about ~2-3 seconds for each message and service.
What build system are you using? What do you consider "not at all big"? For the simple beginner_tutorials setup a complete compile on my machine takes about 1s. If the message generation takes 15s something is very wrong.
@dornhege, I added more info.
Seems wrong to me and shouldn't take that long. You are doing that on a "normal" PC, right? The only guess I have at this point is that maybe you have large directory structures in your workspace.
@dornhege, an Ubuntu patched with RTAI (so, real-time), even though no real-time application is running. What I'm working on is a fresh groovy install with a simple project.
Nevertheless, the question is whether I can turn of "python" code generation and compilation off!
I don't have an answer for that, but fixing the reason why it is so slow in general might be worth more in the long run. I'm sure that would also improve python message generation.
Can you update your question with the result of
rospack depends1 your_package_name_here
?I'm also wondering the same question. I have a ROS package with many ROS messages (51) and I only want to generate the proper c++ header files, skipping the generation of the python ones. My package doesn't depends in rospy, but the cmake building process still generating the python files after printing this line: "Scanning dependencies of target ROSBUILD_genmsg_py". Does anyone know if there is any option in rosbuild_genmsg(), rosbuild_init() or in any other place for skipping the generation of python files?