ros / geometry

Packages for common geometric calculations including the ROS transform library, "tf". Also includes ROS bindings for "bullet" physics engine and "kdl" kinematics/dynamics package.
173 stars 274 forks source link

tf: `transform_listener.cpp` includes boost/ublas, which fails with Boost 1.64 #146

Closed bulwahn closed 7 years ago

bulwahn commented 7 years ago

When updating to the current Boost version 1.64, compiling tf fails in transform_listener.cpp with:

| [ 39%] Building CXX object CMakeFiles/tf.dir/src/transform_listener.cpp.o
| /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot-native/usr/bin/i586-oe-linux/i586-oe-linux-g++   -DROSCONSOLE_BACKEND_LOG4CXX -DROS_PACKAGE_NAME=\"tf\" -Dtf_EXPORTS -I/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/build/devel/include -I/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot/usr/include -I/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot/opt/ros/indigo/include -I/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/geometry-1.11.8/tf/include  -m32 -march=i586  --sysroot=/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0=/usr/src/debug/tf/1.11.8-r0 -fdebug-prefix-map=/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot-native= -fdebug-prefix-map=/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot=  -fvisibility-inlines-hidden  -m32 -march=i586  --sysroot=/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot -fPIC   -o CMakeFiles/tf.dir/src/transform_listener.cpp.o -c /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/geometry-1.11.8/tf/src/transform_listener.cpp
| In file included from /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot/usr/include/boost/numeric/ublas/vector.hpp:21:0,
|                  from /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot/usr/include/boost/numeric/ublas/matrix.hpp:18,
|                  from /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/geometry-1.11.8/tf/src/transform_listener.cpp:34:
| /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot/usr/include/boost/numeric/ublas/storage.hpp: In member function 'void boost::numeric::ublas::unbounded_array<T, ALLOC>::serialize(Archive&, unsigned int)':
| /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot/usr/include/boost/numeric/ublas/storage.hpp:299:18: error: 'make_array' is not a member of 'boost::serialization'
|              ar & serialization::make_array(data_, s);
|                   ^~~~~~~~~~~~~
| /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot/usr/include/boost/numeric/ublas/storage.hpp: In member function 'void boost::numeric::ublas::bounded_array<T, N, ALLOC>::serialize(Archive&, unsigned int)':
| /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot/usr/include/boost/numeric/ublas/storage.hpp:494:18: error: 'make_array' is not a member of 'boost::serialization'
|              ar & serialization::make_array(data_, s);
|                   ^~~~~~~~~~~~~
| In file included from /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/geometry-1.11.8/tf/src/transform_listener.cpp:34:0:
| /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot/usr/include/boost/numeric/ublas/matrix.hpp: In member function 'void boost::numeric::ublas::c_matrix<T, M, N>::serialize(Archive&, unsigned int)':
| /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/recipe-sysroot/usr/include/boost/numeric/ublas/matrix.hpp:5977:18: error: 'make_array' is not a member of 'boost::serialization'
|              ar & serialization::make_array(data_, N);
|                   ^~~~~~~~~~~~~
| make[2]: *** [CMakeFiles/tf.dir/src/transform_listener.cpp.o] Error 1
| make[2]: Leaving directory `/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/build'
| make[1]: *** [CMakeFiles/tf.dir/all] Error 2
| make[1]: Leaving directory `/home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/build'
| make: *** [all] Error 2
| ERROR: Function failed: do_compile (log file is located at /home/lukas/work/repositories/openembedded.org/openembedded-core/build/tmp-glibc/work/i586-oe-linux/tf/1.11.8-r0/temp/log.do_compile.27917)

It does not directly fail in transform_listener.cpp, but transform_listener.cpp includes <boost/numeric/ublas/matrix.hpp> in line 34 [1], which then causes the failure. There was a related discussion on the boost mailing list [2, 3], which encountered the problem during development. In my understanding, it seems that the authors considered the issue fixed with some patches they refer in their discussion. Furthermore, they seem to assume that boost users would not import ublas, but only Boost.Geometry.

I have not looked into the issue further than that: possibly one could patch ublas in Boost 1.64, or one could change tf to not use ublas, but to use another equivalent in boost.

The issue was identified in the OpenEmbedded ROS layer, meta-ros, as the OpenEmbedded-Core layer updated from boost 1.63 to boost 1.64 [4]. The OpenEmbedded-Core layer sometimes moves faster to updated versions than the Debian/Ubuntu distribution, hence the issue is identified in meta-ros earlier, but it probably will also appear in a Debian/Ubuntu system. I hope there is a easy way to re-produce this issue in a local development setup with Boost 1.64; otherwise, I can run and test suggested changes in the meta-ros setup.

[1] https://github.com/ros/geometry/blob/4421e22243a38ba6a130494698b33117d2995a18/tf/src/transform_listener.cpp#L34 [2] https://lists.boost.org/Archives/boost/2016/11/index.php (search for: failures in serialization causing regressions) [3] https://lists.boost.org/Archives/boost/2016/12/231863.php [4] http://cgit.openembedded.org/openembedded-core/commit/?id=9ba71dc40dd782d192504b0827ca91f0fe180abe