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

mongoclient dependency must not be passed on to dependent packages #100

Closed marc-hanheide closed 9 years ago

marc-hanheide commented 9 years ago

as discussed in https://gitter.im/strands-project/archives/2014/10/17

IMO, ${MONGOCLIENT_LIB} needs to be removed from

catkin_package(
 INCLUDE_DIRS include
 LIBRARIES message_store ${MONGOCLIENT_LIB} ${SSL_LIB} ${CRYPTO_LIB} ${Boost_LIBRARIES}
 CATKIN_DEPENDS mongodb_store_msgs
)

as this is not resolved into a Debian dependency as it is turns out libmongoclient.a is a static lib.

marc-hanheide commented 9 years ago

(if I should stop assigning you these things, shout out or reassign them, I just don't have proper connection to fix things myself at the moment)

hawesie commented 9 years ago

Is this breaking things, or is it just a preference?

hawesie commented 9 years ago

Ah, sorry, checking the chat logs now. Will fix.

cdondrup commented 9 years ago

In addition to the calibrate chest, it also broke the docking package.

hawesie commented 9 years ago

Please could someone do some testing for me? You need to use mongodb_store from here: https://github.com/hawesie/mongodb_store Build that, then try to compile the following package: https://github.com/hawesie/test_store

For me it only works with the MONGOCLIENT_LIB dependency.

hawesie commented 9 years ago

This was on Indigo.

marc-hanheide commented 9 years ago

I'll dig into it tomorrow. On 19 Oct 2014 22:40, "Nick Hawes" notifications@github.com wrote:

This was on Indigo.

— Reply to this email directly or view it on GitHub https://github.com/strands-project/mongodb_store/issues/100#issuecomment-59664338 .

cdondrup commented 9 years ago

Just tried it. Had to rename the build target in test_store to test_mongodb_store_cpp_client because example_mongodb_store_cpp_client already existed in mongodb_store but afterwards it did build without problems.

I removed the mongoclient from the dependencies because it was still in there in your fork @hawesie:

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES message_store ${SSL_LIB} ${CRYPTO_LIB} ${Boost_LIBRARIES}
  CATKIN_DEPENDS mongodb_store_msgs
)

And this is the result

Base path: /home/cdondrup/ros-ws/tmp
Source space: /home/cdondrup/ros-ws/tmp/src
Build space: /home/cdondrup/ros-ws/tmp/build
Devel space: /home/cdondrup/ros-ws/tmp/devel
Install space: /home/cdondrup/ros-ws/tmp/install
####
#### Running command: "cmake /home/cdondrup/ros-ws/tmp/src -DCATKIN_DEVEL_PREFIX=/home/cdondrup/ros-ws/tmp/devel -DCMAKE_INSTALL_PREFIX=/home/cdondrup/ros-ws/tmp/install" in "/home/cdondrup/ros-ws/tmp/build"
####
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- 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
-- 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
-- Using CATKIN_DEVEL_PREFIX: /home/cdondrup/ros-ws/tmp/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/hydro
-- This workspace overlays: /opt/ros/hydro
-- Found PythonInterp: /usr/bin/python (found version "2.7.3") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Python version: 2.7
-- Using Debian Python package layout
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/cdondrup/ros-ws/tmp/build/test_results
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- catkin 0.5.89
-- BUILD_SHARED_LIBS is on
WARNING: Package "libg2o" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 4 packages in topological order:
-- ~~  - mongodb_store_msgs
-- ~~  - mongodb_store
-- ~~  - test_store
-- ~~  - mongodb_log
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'mongodb_store_msgs'
-- ==> add_subdirectory(mongodb_store/mongodb_store_msgs)
-- Using these message generators: gencpp;genlisp;genpy
-- Generating .msg files for action mongodb_store_msgs/MoveEntries /home/cdondrup/ros-ws/tmp/src/mongodb_store/mongodb_store_msgs/action/MoveEntries.action
Generating for action MoveEntries
-- mongodb_store_msgs: 11 messages, 4 services
-- +++ processing catkin package: 'mongodb_store'
-- ==> add_subdirectory(mongodb_store/mongodb_store)
-- Using these message generators: gencpp;genlisp;genpy
-- Boost version: 1.46.1
-- Found the following Boost libraries:
--   system
--   thread
--   program_options
--   filesystem
-- mongodb_store: 0 messages, 5 services
-- +++ processing catkin package: 'test_store'
-- ==> add_subdirectory(test_store)
-- Using these message generators: gencpp;genlisp;genpy
message_store/usr/lib/libmongoclient.a/usr/lib/x86_64-linux-gnu/libssl.so/usr/lib/x86_64-linux-gnu/libcrypto.so/usr/lib/libboost_program_options-mt.so/opt/ros/hydro/lib/libroscpp.so/usr/lib/libboost_signals-mt.so/usr/lib/libboost_filesystem-mt.so/opt/ros/hydro/lib/librosconsole.so/opt/ros/hydro/lib/librosconsole_log4cxx.so/opt/ros/hydro/lib/librosconsole_backend_interface.so/usr/lib/liblog4cxx.so/usr/lib/libboost_regex-mt.so/opt/ros/hydro/lib/libxmlrpcpp.so/opt/ros/hydro/lib/libroscpp_serialization.so/opt/ros/hydro/lib/librostime.so/usr/lib/libboost_date_time-mt.so/usr/lib/libboost_system-mt.so/usr/lib/libboost_thread-mt.so/usr/lib/x86_64-linux-gnu/libpthread.so/opt/ros/hydro/lib/libcpp_common.so/opt/ros/hydro/lib/libconsole_bridge.so
-- +++ processing catkin package: 'mongodb_log'
-- ==> add_subdirectory(mongodb_store/mongodb_log)
-- Using these message generators: gencpp;genlisp;genpy
-- Boost version: 1.46.1
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cdondrup/ros-ws/tmp/build
####
#### Running command: "make -j8 -l8" in "/home/cdondrup/ros-ws/tmp/build"
####
Scanning dependencies of target actionlib_msgs_generate_messages_cpp
Scanning dependencies of target actionlib_msgs_generate_messages_lisp
Scanning dependencies of target gtest
Scanning dependencies of target std_msgs_generate_messages_py
Scanning dependencies of target actionlib_msgs_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_cpp
[  0%] [  0%] Built target actionlib_msgs_generate_messages_lisp
[  0%] Built target actionlib_msgs_generate_messages_cpp
Built target std_msgs_generate_messages_py
[  0%] [  0%] Built target actionlib_msgs_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_lisp
Built target std_msgs_generate_messages_cpp
Scanning dependencies of target mongodb_store_generate_messages_py
Scanning dependencies of target mongodb_store_msgs_generate_messages_cpp
Scanning dependencies of target mongodb_store_msgs_generate_messages_lisp
Scanning dependencies of target mongodb_store_msgs_generate_messages_py
Scanning dependencies of target mongodb_store_generate_messages_cpp
[  0%] [  1%] Built target std_msgs_generate_messages_lisp
[  2%] [  4%] [  5%] [  6%] Building CXX object gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
Generating Lisp code from mongodb_store_msgs/MoveEntriesActionFeedback.msg
Generating C++ code from mongodb_store_msgs/MoveEntriesActionFeedback.msg
[  8%] Generating Python code from SRV mongodb_store/GetParam
Generating C++ code from mongodb_store_msgs/StringPair.msg
[  9%] [ 11%] Generating C++ code from mongodb_store_msgs/MoveEntriesResult.msg
Generating Python from MSG mongodb_store_msgs/MoveEntriesActionFeedback
Generating C++ code from mongodb_store/GetParam.srv
[ 12%] [ 13%] Generating Python code from SRV mongodb_store/MongoInsert
Generating Lisp code from mongodb_store_msgs/StringPair.msg
[ 15%] Generating Python from MSG mongodb_store_msgs/StringPair
[ 16%] Generating Lisp code from mongodb_store_msgs/MoveEntriesResult.msg
[ 19%] [ 19%] Generating Python code from SRV mongodb_store/MongoUpdate
[ 20%] Generating Python from MSG mongodb_store_msgs/MoveEntriesResult
[ 22%] Generating Lisp code from mongodb_store_msgs/MoveEntriesGoal.msg
Generating Lisp code from mongodb_store_msgs/MoveEntriesFeedback.msg
[ 23%] [ 25%] Generating Python code from SRV mongodb_store/SetParam
Generating C++ code from mongodb_store_msgs/MoveEntriesGoal.msg
[ 26%] Generating C++ code from mongodb_store_msgs/MoveEntriesFeedback.msg
[ 27%] Generating Python code from SRV mongodb_store/MongoFind
[ 29%] [ 30%] Generating Python from MSG mongodb_store_msgs/MoveEntriesGoal
[ 31%] Generating Lisp code from mongodb_store_msgs/MoveEntriesActionResult.msg
Generating C++ code from mongodb_store_msgs/MoveEntriesActionResult.msg
[ 33%] Generating Python srv __init__.py for mongodb_store
[ 34%] Generating C++ code from mongodb_store/MongoInsert.srv
[ 36%] Generating Python from MSG mongodb_store_msgs/MoveEntriesFeedback
[ 37%] Generating Lisp code from mongodb_store_msgs/StringList.msg
[ 38%] [ 38%] Built target mongodb_store_generate_messages_py
Scanning dependencies of target mongodb_store_generate_messages_lisp
Generating Lisp code from mongodb_store_msgs/MoveEntriesActionGoal.msg
[ 40%] [ 41%] Generating Lisp code from mongodb_store/GetParam.srv
Generating C++ code from mongodb_store_msgs/StringList.msg
[ 43%] Generating Python from MSG mongodb_store_msgs/MoveEntriesActionResult
[ 44%] Generating Lisp code from mongodb_store_msgs/SerialisedMessage.msg
[ 45%] Generating C++ code from mongodb_store_msgs/MoveEntriesActionGoal.msg
[ 47%] Generating Lisp code from mongodb_store_msgs/StringPairList.msg
[ 48%] Generating Lisp code from mongodb_store/MongoInsert.srv
[ 50%] Generating Python from MSG mongodb_store_msgs/StringList
[ 51%] [ 52%] Generating Lisp code from mongodb_store_msgs/MongoQueryMsg.srv
Generating Lisp code from mongodb_store_msgs/MoveEntriesAction.msg
[ 54%] [ 55%] Generating Lisp code from mongodb_store/MongoUpdate.srv
Generating C++ code from mongodb_store/MongoUpdate.srv
[ 56%] [ 58%] Generating Lisp code from mongodb_store_msgs/MongoDeleteMsg.srv
[ 59%] Generating Python from MSG mongodb_store_msgs/MoveEntriesActionGoal
[ 61%] Generating Lisp code from mongodb_store/SetParam.srv
Generating C++ code from mongodb_store_msgs/SerialisedMessage.msg
[ 62%] Generating Lisp code from mongodb_store_msgs/MongoUpdateMsg.srv
[ 63%] [ 65%] Generating Python from MSG mongodb_store_msgs/SerialisedMessage
Generating Lisp code from mongodb_store_msgs/MongoInsertMsg.srv
[ 66%] Generating Python from MSG mongodb_store_msgs/StringPairList
[ 68%] [ 69%] Generating Lisp code from mongodb_store/MongoFind.srv
Generating C++ code from mongodb_store_msgs/StringPairList.msg
[ 70%] [ 70%] Built target mongodb_store_msgs_generate_messages_lisp
Generating C++ code from mongodb_store_msgs/MoveEntriesAction.msg
[ 72%] [ 73%] Generating Python from MSG mongodb_store_msgs/MoveEntriesAction
Generating C++ code from mongodb_store_msgs/MongoQueryMsg.srv
[ 75%] [ 75%] Built target mongodb_store_generate_messages_lisp
Generating C++ code from mongodb_store/SetParam.srv
[ 76%] Generating Python code from SRV mongodb_store_msgs/MongoQueryMsg
[ 77%] Generating Python code from SRV mongodb_store_msgs/MongoDeleteMsg
[ 79%] Generating Python code from SRV mongodb_store_msgs/MongoUpdateMsg
[ 80%] [ 81%] Generating C++ code from mongodb_store/MongoFind.srv
Generating Python code from SRV mongodb_store_msgs/MongoInsertMsg
[ 83%] Generating C++ code from mongodb_store_msgs/MongoDeleteMsg.srv
[ 84%] [ 86%] [ 87%] Generating C++ code from mongodb_store_msgs/MongoUpdateMsg.srv
Generating Python msg __init__.py for mongodb_store_msgs
Generating C++ code from mongodb_store_msgs/MongoInsertMsg.srv
[ 88%] Generating Python srv __init__.py for mongodb_store_msgs
[ 88%] Built target mongodb_store_msgs_generate_messages_py
[ 88%] Built target mongodb_store_generate_messages_cpp
Scanning dependencies of target mongodb_store_generate_messages
[ 88%] Built target mongodb_store_generate_messages
[ 88%] Built target mongodb_store_msgs_generate_messages_cpp
Scanning dependencies of target mongodb_store_msgs_generate_messages
Scanning dependencies of target message_store
[ 88%] Built target mongodb_store_msgs_generate_messages
[ 90%] Building CXX object mongodb_store/mongodb_store/CMakeFiles/message_store.dir/src/message_store.cpp.o
Linking CXX shared library libgtest.so
[ 90%] Built target gtest
Linking CXX shared library /home/cdondrup/ros-ws/tmp/devel/lib/libmessage_store.so
[ 90%] Built target message_store
Scanning dependencies of target example_mongodb_store_cpp_client
Scanning dependencies of target mongodb_log_pcl
Scanning dependencies of target test_mongodb_store_cpp_client
Scanning dependencies of target message_store_cpp_test
Scanning dependencies of target example_multi_event_log
Scanning dependencies of target mongodb_log_cimg
Scanning dependencies of target mongodb_log_tf
[ 91%] Building CXX object mongodb_store/mongodb_log/CMakeFiles/mongodb_log_pcl.dir/src/mongodb_log_pcl.cpp.o
[ 93%] Building CXX object mongodb_store/mongodb_store/CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o
[ 94%] Building CXX object mongodb_store/mongodb_log/CMakeFiles/mongodb_log_tf.dir/src/mongodb_log_tf.cpp.o
[ 95%] [ 97%] Building CXX object mongodb_store/mongodb_log/CMakeFiles/mongodb_log_cimg.dir/src/mongodb_log_cimg.cpp.o
Building CXX object mongodb_store/mongodb_store/CMakeFiles/message_store_cpp_test.dir/tests/message_store_cpp_test.cpp.o
[ 98%] Building CXX object mongodb_store/mongodb_store/CMakeFiles/example_multi_event_log.dir/src/example_multi_event_log.cpp.o
[100%] Building CXX object test_store/CMakeFiles/test_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o
Linking CXX executable /home/cdondrup/ros-ws/tmp/devel/lib/mongodb_log/mongodb_log_pcl
Linking CXX executable /home/cdondrup/ros-ws/tmp/devel/lib/mongodb_log/mongodb_log_tf
Linking CXX executable /home/cdondrup/ros-ws/tmp/devel/lib/mongodb_store/example_mongodb_store_cpp_client
Linking CXX executable /home/cdondrup/ros-ws/tmp/devel/lib/mongodb_log/mongodb_log_cimg
[100%] Built target example_mongodb_store_cpp_client
[100%] Built target mongodb_log_cimg
[100%] Built target mongodb_log_tf
Linking CXX executable /home/cdondrup/ros-ws/tmp/devel/lib/mongodb_store/example_multi_event_log
[100%] Built target mongodb_log_pcl
Linking CXX executable /home/cdondrup/ros-ws/tmp/devel/lib/test_store/test_mongodb_store_cpp_client
Linking CXX executable /home/cdondrup/ros-ws/tmp/devel/lib/mongodb_store/message_store_cpp_test
[100%] Built target example_multi_event_log
[100%] Built target test_mongodb_store_cpp_client
[100%] Built target message_store_cpp_test

I also made sure that I removed the debian packages of mongodb_store and mongodb_store_msgs that I had installed previously before building this.

hawesie commented 9 years ago

@cdondrup sorry, I wasn't clear enough on this. Please can you create second workspace for the test_store package? This will mimic the install setup more closely, i.e. mongodb_store is built and some other package needs it for compilation.

cdondrup commented 9 years ago

ok, will try.

cdondrup commented 9 years ago

Ok, with the intended set-up it doesn't work for me either:

Base path: /home/cdondrup/ros-ws/tmp2
Source space: /home/cdondrup/ros-ws/tmp2/src
Build space: /home/cdondrup/ros-ws/tmp2/build
Devel space: /home/cdondrup/ros-ws/tmp2/devel
Install space: /home/cdondrup/ros-ws/tmp2/install
####
#### Running command: "cmake /home/cdondrup/ros-ws/tmp2/src -DCATKIN_DEVEL_PREFIX=/home/cdondrup/ros-ws/tmp2/devel -DCMAKE_INSTALL_PREFIX=/home/cdondrup/ros-ws/tmp2/install" in "/home/cdondrup/ros-ws/tmp2/build"
####
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- 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
-- 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
-- Using CATKIN_DEVEL_PREFIX: /home/cdondrup/ros-ws/tmp2/devel
-- Using CMAKE_PREFIX_PATH: /home/cdondrup/ros-ws/tmp/devel;/opt/ros/hydro
-- This workspace overlays: /home/cdondrup/ros-ws/tmp/devel;/opt/ros/hydro
-- Found PythonInterp: /usr/bin/python (found version "2.7.3") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Python version: 2.7
-- Using Debian Python package layout
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/cdondrup/ros-ws/tmp2/build/test_results
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- catkin 0.5.89
-- BUILD_SHARED_LIBS is on
WARNING: Package "libg2o" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - test_store
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'test_store'
-- ==> add_subdirectory(test_store)
-- Using these message generators: gencpp;genlisp;genpy
/home/cdondrup/ros-ws/tmp/devel/lib/libmessage_store.so/usr/lib/x86_64-linux-gnu/libssl.so/usr/lib/x86_64-linux-gnu/libcrypto.so/usr/lib/libboost_program_options-mt.so/opt/ros/hydro/lib/libroscpp.so/usr/lib/libboost_signals-mt.so/usr/lib/libboost_filesystem-mt.so/opt/ros/hydro/lib/librosconsole.so/opt/ros/hydro/lib/librosconsole_log4cxx.so/opt/ros/hydro/lib/librosconsole_backend_interface.so/usr/lib/liblog4cxx.so/usr/lib/libboost_regex-mt.so/opt/ros/hydro/lib/libxmlrpcpp.so/opt/ros/hydro/lib/libroscpp_serialization.so/opt/ros/hydro/lib/librostime.so/usr/lib/libboost_date_time-mt.so/usr/lib/libboost_system-mt.so/usr/lib/libboost_thread-mt.so/usr/lib/x86_64-linux-gnu/libpthread.so/opt/ros/hydro/lib/libcpp_common.so/opt/ros/hydro/lib/libconsole_bridge.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cdondrup/ros-ws/tmp2/build
####
#### Running command: "make -j8 -l8" in "/home/cdondrup/ros-ws/tmp2/build"
####
Scanning dependencies of target example_mongodb_store_cpp_client
[100%] Building CXX object test_store/CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o
Linking CXX executable /home/cdondrup/ros-ws/tmp2/devel/lib/test_store/example_mongodb_store_cpp_client
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::StringBuilder::appendDoubleNice(double)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo13StringBuilder16appendDoubleNiceEd[mongo::StringBuilder::appendDoubleNice(double)]+0x6f): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::OID::OID(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo3OIDC2ERKSs[_ZN5mongo3OIDC5ERKSs]+0x33): undefined reference to `mongo::OID::init(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::msgasserted(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo11msgassertedEiSs[mongo::msgasserted(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)]+0x27): undefined reference to `mongo::msgasserted(int, char const*)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONElement::binData(int&) const':
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo11BSONElement7binDataERi[mongo::BSONElement::binData(int&) const]+0x3a): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONElement::binDataType() const':
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo11BSONElement11binDataTypeEv[mongo::BSONElement::binDataType() const]+0x36): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONElement::regex() const':
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo11BSONElement5regexEv[mongo::BSONElement::regex() const]+0x36): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONElement::BSONElement(char const*, int)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo11BSONElementC2EPKci[_ZN5mongo11BSONElementC5EPKci]+0x9c): undefined reference to `mongo::msgasserted(int, char const*)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONObjBuilder::append(mongo::BSONElement const&)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo14BSONObjBuilder6appendERKNS_11BSONElementE[mongo::BSONObjBuilder::append(mongo::BSONElement const&)]+0x38): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONObjBuilder::obj()':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo14BSONObjBuilder3objEv[mongo::BSONObjBuilder::obj()]+0x33): undefined reference to `mongo::msgasserted(int, char const*)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONObjIterator::next(bool)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo15BSONObjIterator4nextEb[mongo::BSONObjIterator::next(bool)]+0x3f): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONObjIterator::next()':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo15BSONObjIterator4nextEv[mongo::BSONObjIterator::next()]+0x3a): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONElement::embeddedObject() const':
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo11BSONElement14embeddedObjectEv[mongo::BSONElement::embeddedObject() const]+0x34): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONElement::codeWScopeObject() const':
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo11BSONElement16codeWScopeObjectEv[mongo::BSONElement::codeWScopeObject() const]+0x3a): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONObj::toString(mongo::StringBuilder&, bool, bool) const':
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo7BSONObj8toStringERNS_13StringBuilderEbb[mongo::BSONObj::toString(mongo::StringBuilder&, bool, bool) const]+0xda): undefined reference to `mongo::msgasserted(int, char const*)'
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo7BSONObj8toStringERNS_13StringBuilderEbb[mongo::BSONObj::toString(mongo::StringBuilder&, bool, bool) const]+0x13d): undefined reference to `mongo::msgasserted(int, char const*)'
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo7BSONObj8toStringERNS_13StringBuilderEbb[mongo::BSONObj::toString(mongo::StringBuilder&, bool, bool) const]+0x168): undefined reference to `mongo::msgasserted(int, char const*)'
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo7BSONObj8toStringERNS_13StringBuilderEbb[mongo::BSONObj::toString(mongo::StringBuilder&, bool, bool) const]+0x1ce): undefined reference to `mongo::msgasserted(int, char const*)'
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo7BSONObj8toStringERNS_13StringBuilderEbb[mongo::BSONObj::toString(mongo::StringBuilder&, bool, bool) const]+0x22a): undefined reference to `mongo::msgasserted(int, char const*)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o:example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo11BSONElement8validateEv[mongo::BSONElement::validate() const]+0x1a6): more undefined references to `mongo::msgasserted(int, char const*)' follow
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONElement::size(int) const':
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo11BSONElement4sizeEi[mongo::BSONElement::size(int) const]+0x28a): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo11BSONElement4sizeEi[mongo::BSONElement::size(int) const]+0x331): undefined reference to `mongo::msgasserted(int, char const*)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::BSONElement::size() const':
example_mongodb_store_cpp_client.cpp:(.text._ZNK5mongo11BSONElement4sizeEv[mongo::BSONElement::size() const]+0x19f): undefined reference to `mongo::msgasserted(int, char const*)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::_BufBuilder<mongo::TrivialAllocator>::_BufBuilder(int)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo11_BufBuilderINS_16TrivialAllocatorEEC2Ei[_ZN5mongo11_BufBuilderINS_16TrivialAllocatorEEC5Ei]+0x5d): undefined reference to `mongo::msgasserted(int, char const*)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::StringBuilder& mongo::StringBuilder::SBNUM<int>(int, int, char const*)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo13StringBuilder5SBNUMIiEERS0_T_iPKc[mongo::StringBuilder& mongo::StringBuilder::SBNUM<int>(int, int, char const*)]+0x6c): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::StringBuilder& mongo::StringBuilder::SBNUM<unsigned int>(unsigned int, int, char const*)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo13StringBuilder5SBNUMIjEERS0_T_iPKc[mongo::StringBuilder& mongo::StringBuilder::SBNUM<unsigned int>(unsigned int, int, char const*)]+0x6c): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::StringBuilder& mongo::StringBuilder::SBNUM<long long>(long long, int, char const*)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo13StringBuilder5SBNUMIxEERS0_T_iPKc[mongo::StringBuilder& mongo::StringBuilder::SBNUM<long long>(long long, int, char const*)]+0x6e): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::StringBuilder& mongo::StringBuilder::SBNUM<unsigned long long>(unsigned long long, int, char const*)':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo13StringBuilder5SBNUMIyEERS0_T_iPKc[mongo::StringBuilder& mongo::StringBuilder::SBNUM<unsigned long long>(unsigned long long, int, char const*)]+0x6e): undefined reference to `mongo::asserted(char const*, char const*, unsigned int)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `mongo::_BufBuilder<mongo::TrivialAllocator>::grow_reallocate()':
example_mongodb_store_cpp_client.cpp:(.text._ZN5mongo11_BufBuilderINS_16TrivialAllocatorEE15grow_reallocateEv[mongo::_BufBuilder<mongo::TrivialAllocator>::grow_reallocate()]+0x54): undefined reference to `mongo::msgasserted(int, char const*)'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> > mongodb_store::MessageStoreProxy::insert<geometry_msgs::Pose_<std::allocator<void> > >(geometry_msgs::Pose_<std::allocator<void> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::BSONObj const&)':
example_mongodb_store_cpp_client.cpp:(.text._ZN13mongodb_store17MessageStoreProxy6insertIN13geometry_msgs5Pose_ISaIvEEEEESsRKT_RKSsSA_RKN5mongo7BSONObjE[std::basic_string<char, std::char_traits<char>, std::allocator<char> > mongodb_store::MessageStoreProxy::insert<geometry_msgs::Pose_<std::allocator<void> > >(geometry_msgs::Pose_<std::allocator<void> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::BSONObj const&)]+0xaa): undefined reference to `mongo::BSONObj::jsonString(mongo::JsonStringFormat, int) const'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `bool mongodb_store::MessageStoreProxy::update<geometry_msgs::Pose_<std::allocator<void> > >(geometry_msgs::Pose_<std::allocator<void> > const&, mongo::BSONObj const&, mongo::BSONObj const&, mongo::BSONObj const&, bool)':
example_mongodb_store_cpp_client.cpp:(.text._ZN13mongodb_store17MessageStoreProxy6updateIN13geometry_msgs5Pose_ISaIvEEEEEbRKT_RKN5mongo7BSONObjESC_SC_b[bool mongodb_store::MessageStoreProxy::update<geometry_msgs::Pose_<std::allocator<void> > >(geometry_msgs::Pose_<std::allocator<void> > const&, mongo::BSONObj const&, mongo::BSONObj const&, mongo::BSONObj const&, bool)]+0xbd): undefined reference to `mongo::BSONObj::jsonString(mongo::JsonStringFormat, int) const'
example_mongodb_store_cpp_client.cpp:(.text._ZN13mongodb_store17MessageStoreProxy6updateIN13geometry_msgs5Pose_ISaIvEEEEEbRKT_RKN5mongo7BSONObjESC_SC_b[bool mongodb_store::MessageStoreProxy::update<geometry_msgs::Pose_<std::allocator<void> > >(geometry_msgs::Pose_<std::allocator<void> > const&, mongo::BSONObj const&, mongo::BSONObj const&, mongo::BSONObj const&, bool)]+0x140): undefined reference to `mongo::BSONObj::jsonString(mongo::JsonStringFormat, int) const'
example_mongodb_store_cpp_client.cpp:(.text._ZN13mongodb_store17MessageStoreProxy6updateIN13geometry_msgs5Pose_ISaIvEEEEEbRKT_RKN5mongo7BSONObjESC_SC_b[bool mongodb_store::MessageStoreProxy::update<geometry_msgs::Pose_<std::allocator<void> > >(geometry_msgs::Pose_<std::allocator<void> > const&, mongo::BSONObj const&, mongo::BSONObj const&, mongo::BSONObj const&, bool)]+0x1d7): undefined reference to `mongo::BSONObj::jsonString(mongo::JsonStringFormat, int) const'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `bool mongodb_store::MessageStoreProxy::query<geometry_msgs::Pose_<std::allocator<void> > >(std::vector<std::pair<boost::shared_ptr<geometry_msgs::Pose_<std::allocator<void> > >, mongo::BSONObj>, std::allocator<std::pair<boost::shared_ptr<geometry_msgs::Pose_<std::allocator<void> > >, mongo::BSONObj> > >&, mongo::BSONObj const&, mongo::BSONObj const&, bool, bool)':
example_mongodb_store_cpp_client.cpp:(.text._ZN13mongodb_store17MessageStoreProxy5queryIN13geometry_msgs5Pose_ISaIvEEEEEbRSt6vectorISt4pairIN5boost10shared_ptrIT_EEN5mongo7BSONObjEESaISE_EERKSD_SJ_bb[bool mongodb_store::MessageStoreProxy::query<geometry_msgs::Pose_<std::allocator<void> > >(std::vector<std::pair<boost::shared_ptr<geometry_msgs::Pose_<std::allocator<void> > >, mongo::BSONObj>, std::allocator<std::pair<boost::shared_ptr<geometry_msgs::Pose_<std::allocator<void> > >, mongo::BSONObj> > >&, mongo::BSONObj const&, mongo::BSONObj const&, bool, bool)]+0xf1): undefined reference to `mongo::BSONObj::jsonString(mongo::JsonStringFormat, int) const'
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o:example_mongodb_store_cpp_client.cpp:(.text._ZN13mongodb_store17MessageStoreProxy5queryIN13geometry_msgs5Pose_ISaIvEEEEEbRSt6vectorISt4pairIN5boost10shared_ptrIT_EEN5mongo7BSONObjEESaISE_EERKSD_SJ_bb[bool mongodb_store::MessageStoreProxy::query<geometry_msgs::Pose_<std::allocator<void> > >(std::vector<std::pair<boost::shared_ptr<geometry_msgs::Pose_<std::allocator<void> > >, mongo::BSONObj>, std::allocator<std::pair<boost::shared_ptr<geometry_msgs::Pose_<std::allocator<void> > >, mongo::BSONObj> > >&, mongo::BSONObj const&, mongo::BSONObj const&, bool, bool)]+0x174): more undefined references to `mongo::BSONObj::jsonString(mongo::JsonStringFormat, int) const' follow
CMakeFiles/example_mongodb_store_cpp_client.dir/src/example_mongodb_store_cpp_client.cpp.o: In function `bool mongodb_store::MessageStoreProxy::query<geometry_msgs::Pose_<std::allocator<void> > >(std::vector<std::pair<boost::shared_ptr<geometry_msgs::Pose_<std::allocator<void> > >, mongo::BSONObj>, std::allocator<std::pair<boost::shared_ptr<geometry_msgs::Pose_<std::allocator<void> > >, mongo::BSONObj> > >&, mongo::BSONObj const&, mongo::BSONObj const&, bool, bool)':
example_mongodb_store_cpp_client.cpp:(.text._ZN13mongodb_store17MessageStoreProxy5queryIN13geometry_msgs5Pose_ISaIvEEEEEbRSt6vectorISt4pairIN5boost10shared_ptrIT_EEN5mongo7BSONObjEESaISE_EERKSD_SJ_bb[bool mongodb_store::MessageStoreProxy::query<geometry_msgs::Pose_<std::allocator<void> > >(std::vector<std::pair<boost::shared_ptr<geometry_msgs::Pose_<std::allocator<void> > >, mongo::BSONObj>, std::allocator<std::pair<boost::shared_ptr<geometry_msgs::Pose_<std::allocator<void> > >, mongo::BSONObj> > >&, mongo::BSONObj const&, mongo::BSONObj const&, bool, bool)]+0x3fc): undefined reference to `mongo::fromjson(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: ld returned 1 exit status
make[2]: *** [/home/cdondrup/ros-ws/tmp2/devel/lib/test_store/example_mongodb_store_cpp_client] Error 1
make[1]: *** [test_store/CMakeFiles/example_mongodb_store_cpp_client.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

If I include the mongoclient in the dependencies again, it builds.

hawesie commented 9 years ago

If I include the mongoclient in the dependencies again, it builds.

Ok, then at least our systems are behaving in the same way! @marc-hanheide so, what's your verdict? It looks like for the installed system we need the link. Or will things be different again when installed as a binary?

marc-hanheide commented 9 years ago

Hmm, I just tested this and it seems to work fine. What I did:

  1. apt-get purge for all ros-hydro-mongo-* packages
  2. create catkin workspace A, checked out https://github.com/hawesie/mongodb_store.git, built it, (in a second attempt also installed it)
  3. create catkin workspace B, checked out https://github.com/hawesie/test_store.git, sourced the setup.bash of workspace A, built it, and tried to run it. All fine.

Did you change anything in your packages?

marc-hanheide commented 9 years ago

OK, found that the current version had the ${MONGOCLIENT_LIB} in its catkin exports... removed it and now it fails as expected

ToMadoRe commented 9 years ago

Does this correspond to the same issue?

make[2]: *** No rule to make target `/usr/lib/libmongoclient.a', needed by `/home/thomas/Projects/strands_catkin_ws/devel/lib/singleview_object_recognizer/recognition_service'.  Stop.
make[2]: *** Waiting for unfinished jobs....
In file included from /home/thomas/Projects/strands_catkin_ws/src/strands_tabletop_perception/singleview_object_recognizer/src/CheckObjectPresence.cpp:8:0:
/opt/ros/indigo/include/mongodb_store/message_store.h:14:35: fatal error: mongo/client/dbclient.h: No such file or directory
 #include "mongo/client/dbclient.h"
compilation terminated.
marc-hanheide commented 9 years ago

So, we should take https://github.com/ros-planning/warehouse_ros/blob/master/CMakeLists.txt as the correct way of doing this. The problem is that the static library is not correctly exported into the the Debian package.

But my original solution of just dropping it is not the correct one either. So, I think the above package should serve us as a good example that we should adopt (in particular the find_package(MongoDB)).

Let's see if this works (I cannot do this right now any more), as a work around, people should manually sudo apt-get install mongodb-dev

I originally planned to ask this on answers.ros.org but then found this solution which hopefully works.

In case we still need to ask, here's my draft I planned to post:

We have released the mongodb_store package (http://wiki.ros.org/mongodb_store/) which creates a shared library (message_store, relevant CMakeLists.txt) that depends on the mongoclient library. On Ubuntu precise mongoclient is a static library (libmongoclient.a). Therefore (if I understand it correctly), our package names this library in catkin_package(LIBRARIES mongoclient) to make sure that dependent packages also link against this static library. This generally works fine, but when we automatically build Ubuntu package for our package, the binary package does not depend on mongodb-dev (presumably because ${shlibs:Depends} in the Debian control file doesn't see the static library.

This causes any packages that depend on the mongodb_store package to fail compiling if the package mongodb-dev is not installed manually. Simply running apt-get install mongodb_store will not install, so any rosdep-based automatic installation fails.

So, my question, how to we correctly pass on the build dependency against a system static library (here /usr/lib/libmongoclient.a) so that that bloom will create the correct Debian dependencies.

hawesie commented 9 years ago

I used the above approach in b3e5cbbe1e41d4089c1d3f637925a05ced69cd3a so please could you update from my fork and try again?

hawesie commented 9 years ago

@cdondrup @marc-hanheide does this work for you now? There's something a bit odd with my VM install which is messing with this I think.

marc-hanheide commented 9 years ago

didn't have a chance to test yet... But you did almost exactly what I tried (and then struggled with c11 settings and ran out of battery), so it looks like heading the right way.

I shall try...

marc-hanheide commented 9 years ago

It didn't work for me straight away...

I had to change

set(MONGO_EXPORT)

to

set(MONGO_EXPORT MongoDB)                                                                                                                            

So no this is always exported. I didn't quite get the magic of this code tkaen from warehouse_ros:

if("${MongoDB_LIBRARIES}" MATCHES "\\.so$")
  set(MONGO_EXPORT MongoDB)
endif()

Seems the only declare depends if this libmongoclient is a shared (as it is on Ubuntu post-raring, I understand). Reading through https://github.com/ros-planning/warehouse_ros/issues/6 it seems the had similar problem like us. But in our case I believe strongly that we have to export it all the time an that the above if statement can be removed. I have tested this with the install targets as well and opened the PR with the mini change I made: https://github.com/hawesie/mongodb_store/pull/1

I'm still puzzled if and how this will result in the correct Debian dependencies. That requires testing (by releasing it).

marc-hanheide commented 9 years ago

If the above still doesn't create the Debian deps needed I'll specify them explicitly in the bloom hydro release track for the package and that will definitely solve it for good.

marc-hanheide commented 9 years ago

The last release seems to be working...

hawesie commented 9 years ago

This seems to be missing the ssl linking to me. I took it out based on the warehouse approach, but I get errors.

marc-hanheide commented 9 years ago

strange... I tested this both on my desktop and on jenkins... also, all subsequent builds (docking etc.) now finally work. What exactly fails for you?

marc-hanheide commented 9 years ago

based on all my successful tests I opened https://github.com/ros/rosdistro/pull/6029 if you think there still is a problem I delete it.

hawesie commented 9 years ago

If it works for you lets ignore me. I think there's something odd with my vm. =

marc-hanheide commented 9 years ago

closing for now