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

Catkin rosconsole cross-compilation make error

asked 2013-07-30 04:38:13 -0500

lboltzmann gravatar image

updated 2014-01-28 17:17:28 -0500

ngrennan gravatar image

Hi all,

I'm still working towards a cross-compilation of the packages in ros-comm for a Zynq ARM target running Angstrom Linux. I have now run into an issue during the catkin build process with rosconsole.

I'm getting an error while compiling rosconsole.cpp

./src/rosconsole/include/ros/console.h:55 fatal error: log4cxx/logger.h: No such file or directory error

I've set the path to the log4cxx include files directly in my rostoolchain file in the CMAKE_INCLUDE_PATH variable. I've also tried setting LOG4CXX_INCLUDE_DIRS. When set in the LOG4CXX_INCLUDE_DIRS variable the directory appears in the flags.make as a -I flag in the CXX_FLAGS.

Any thoughts on what I need to set to fix this?

Thanks,

Marcus

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-07-30 05:19:18 -0500

lboltzmann gravatar image

updated 2013-07-30 05:43:51 -0500

I was able to get this to work by editing the CMakeLists.txt file and setting the LOG4CXX_INCLUDE_DIRS variable directly. I then verified the same thing works in my rostoolchain file. It was a case of the path being .../include instead of the .../include/log4cxx I had been using.

Now I'm seeing the same error during the build of roscpp. The CMakeLists.txt for roscpp doesn't appear to reference the log4cxx directories or libraries, but I still see the same console.h error referring to logger.h.

Is there a better place to set the include dependency? And if roscpp has a dependency on log4cxx why doesn't it reference the LOG4CXX variables?

Regards.

edit flag offensive delete link more
1

answered 2013-07-30 07:19:57 -0500

joq gravatar image

updated 2013-08-02 06:31:43 -0500

The CMakeLists.txt uses pkg-config to find LOG4CXX. Could it be that liblog4cxx.pc is missing from your $PKG_CONFIG_PATH?

See: https://github.com/strawlab/ros_comm/blob/master/tools/rosconsole/CMakeLists.txt#L38

UPDATE: oops! I had failed to notice that the link above is to the wrong repository.

The correct groovy_devel version is here: https://github.com/ros/ros_comm/blob/groovy-devel/tools/rosconsole/CMakeLists.txt#L6

That file uses CMAKE find_package() instead of pkg-config to locate log4cxx.

Unfortunately, I don't know where that CMake module is supposed to be defined. The Debian liblog4cxx10-dev package seems to provide the pkg-config file, but no CMake module.

This may be a bug that only crops up when cross-compiling. I just don't know.

edit flag offensive delete link more

Comments

I'll look into this. I'm just learning about CMake so I'm not sure of the best way to interact with it. Thanks for your suggestion.

lboltzmann gravatar image lboltzmann  ( 2013-07-31 04:09:23 -0500 )edit

It's not a CMake thing. What does `echo $PKG_CONFIG_PATH` print? Is there a `liblog4cxx.pc` file in any of those directories?

joq gravatar image joq  ( 2013-07-31 07:37:22 -0500 )edit

echo returns a blank. My CMakeLists.txt file for rosconsole is quite a bit different then that version (Groovy catkin source version). There isn't a find_package(PkgConfig). It uses find_package(Log4cxx QUIET) and if it does find the library it looks in the system path only using find_library(LOG4CXX_LIBRARIES log4cxx).

lboltzmann gravatar image lboltzmann  ( 2013-08-01 03:48:28 -0500 )edit

What version are you trying to cross-compile? Please be very careful to use the correct sources for the ROS distro you are running.

joq gravatar image joq  ( 2013-08-01 14:08:08 -0500 )edit

I'm cross-compiling groovy source. I followed the source installation instructions for ROS-comm on the wiki. I can build fine if I don't cross as it looks in my system path for the lib and the x86 versions are there. Thanks.

lboltzmann gravatar image lboltzmann  ( 2013-08-02 05:55:59 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-07-30 04:38:13 -0500

Seen: 1,296 times

Last updated: Aug 02 '13