strands-project / mongodb_store

MongoDB tools for storing and analysing runs of ROS systems.
BSD 3-Clause "New" or "Revised" License
49 stars 72 forks source link

catkin_make fails on Fedora 23 with ROS Indigo #171

Closed karpase closed 8 years ago

karpase commented 8 years ago

Hi, I tried to build from source on a Fedora 23 machine with ROS Indigo, and got a compilation error. The first error is:

[ 83%] Building CXX object mongodb_store/mongodb_store/CMakeFiles/message_store.dir/src/message_store.cpp.o In file included from /usr/include/c++/5.3.1/atomic:38:0, from /usr/include/mongo/platform/atomic_word_cxx11.h:29, from /usr/include/mongo/platform/atomic_word.h:21, from /usr/include/mongo/base/status.h:23, from /usr/include/mongo/util/assert_util.h:23, from /usr/include/mongo/bson/bsontypes.h:20, from /usr/include/mongo/bson/bsonelement.h:25, from /usr/include/mongo/bson/bsonobj.h:27, from /usr/include/mongo/client/bulk_operation_builder.h:20, from /usr/include/mongo/client/dbclientinterface.h:29, from /usr/include/mongo/client/dbclient_rs.h:23, from /usr/include/mongo/client/dbclient.h:59, from /home/robosim/catkin_ws/src/mongodb_store/mongodb_store/include/mongodb_store/message_store.h:14, from /home/robosim/catkin_ws/src/mongodb_store/mongodb_store/src/message_store.cpp:1: /usr/include/c++/5.3.1/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

The full log is attached.

karpase commented 8 years ago

ros_mongodb_build.txt full log is attached here :-(

Thanks, Erez Karpas

timn commented 8 years ago

I guess that the issue is that F23 uses the mongo-cxx-client library. This is compiled with the "-std=c++11" flag by default. It is necessary that code using this library is built with the same flag for compatibility...

marc-hanheide commented 8 years ago

Can you elaborate what you think would have to be changed? Would we have to build mongodb_store with -std=c++11 as well? I recall this having some issues with ROS and - more definitely - PCL (at least in Ubuntu). Maybe, @karpase can try and just add the flag in your catkin_make call? I think we ought to not add this flag in general, but what does @hawesie think?

karpase commented 8 years ago

Hi All, Adding set(CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}")

to the top-level CMakeLists.txt helped, and everything now compiles just fine.

You might consider enabling c++11 only when it is supported - see here.

Thanks, Erez.

marc-hanheide commented 8 years ago

Great, @timn, thanks for the hint.

hawesie commented 8 years ago

Thanks folks. @karpase if you've added that linked fix, please could you open a PR?

karpase commented 8 years ago

@hawesie I didn't actually add the linked fix, since I'm not quite sure it's the best idea. Specifically, one of the comments on that page says: the catkin CMake style guide forbids altering CMAKE_CXX_FLAGS, cf.