ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

building roscpp

asked 2017-06-15 15:28:15 -0500

SRD gravatar image

All I need is roscpp libs for Android. I'm hoping there's a way I can build just these by themselves. So without knowing much about cmake, I did ...

$ git clone
$ cd ros_comm/ros_comm
$ mkdir build && cd build
$ cmake ..

And ended up with the following ...

$ cmake ..  
-- The C compiler identification is GNU 5.4.0  
-- The CXX compiler identification is GNU 5.4.0  
-- Check for working C compiler: /usr/bin/cc  
-- Check for working C compiler: /usr/bin/cc -- works  
-- Detecting C compiler ABI info  
-- Detecting C compiler ABI info - done  
-- Detecting C compile features  
-- Detecting C compile features - done  
-- Check for working CXX compiler: /usr/bin/c++  
-- Check for working CXX compiler: /usr/bin/c++ -- works  
-- Detecting CXX compiler ABI info  
-- Detecting CXX compiler ABI info - done   
-- Detecting CXX compile features  
-- Detecting CXX compile features - done  
CMake Error at CMakeLists.txt:3 (find_package):  
  By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has  
  asked CMake to find a package configuration file provided by "catkin", but  
  CMake did not find one.  

  Could not find a package configuration file provided by "catkin" with any
  of the following names:


  Add the installation prefix of "catkin" to CMAKE_PREFIX_PATH or set
  "catkin_DIR" to a directory containing one of the above files.  If "catkin"
  provides a separate development package or SDK, be sure it has been

-- Configuring incomplete, errors occurred!

Is there a way to build just roscpp? The reason I'm doing this is that I'd eventually like to get to a point where I can modify things to start cross compiling using aarch64 tools, even if that means I have to do the port to an arm-v8a arch. The docker image for Android doesn't support the toolchains I need.

edit retag flag offensive close merge delete



Maybe have a look at instead?

ahendrix gravatar image ahendrix  ( 2017-06-15 22:32:35 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2017-06-15 17:58:36 -0500

Geoff gravatar image

updated 2017-06-16 00:27:19 -0500

roscpp has a lot of necessary dependencies so I don't think you would be able to build "just" roscpp.

Per Dirk's comment below, you can build by just running CMake, but you need to have your environment set up correctly. You do not need a workspace, but you do need to have ROS activated in your shell (e.g. source /opt/ros/kinetic/setup.bash). You also need to have all the necessary dependencies available. For roscpp, that means that you will need everything listed in the package.xml file. To be honest, I think the easiest way to make them available would be to just install ROS. (You wouldn't need the full ROS desktop option; the minimal install is probably enough).

If you want to cross-compile, you should start by looking here:

You should be able to compile roscpp and its dependencies using Catkin and the cross-compilation facilities. You would then find the libraries you want in the build directory of your workspace, or under the directory in which you ran CMake.

edit flag offensive delete link more


You can build every ROS package which uses catkin with a plain invocation of cmake without a problem. You need to have the right enironment though as well as all dependencies.

Dirk Thomas gravatar image Dirk Thomas  ( 2017-06-15 22:45:16 -0500 )edit

I did not know that. Just goes to show, helping others is a great way to learn! I'll update my answer.

Geoff gravatar image Geoff  ( 2017-06-16 00:22:35 -0500 )edit

answered 2017-10-10 14:00:46 -0500

jubeira gravatar image

@SRD as @ahendrix points out in the comments, try starting here: .

Some packages have already been cross compiled for Android use, perhaps you will find what you need there. Or if you don't, you can try to add the package you want to the list.

edit flag offensive delete link more

Question Tools



Asked: 2017-06-15 15:28:15 -0500

Seen: 1,829 times

Last updated: Oct 10 '17