GobySoft / dccl

Dynamic Compact Control Language
Other
17 stars 13 forks source link

link statically to protobuf when building static libs #17

Closed nknotts closed 7 years ago

nknotts commented 7 years ago

I copied and pasted this from https://github.com/Kitware/CMake/blob/v3.9.0-rc5/Modules/FindProtobuf.cmake#L281

I was wondering if there was a reason why you are including FindProtobuf.cmake instead of using the one that is built-in to CMake?

tsaubergine commented 7 years ago

The version that was in CMake when I wrote this was very limited (you couldn't add additional -I directories to protoc, for example, no support for --plugin). I haven't looked at the latest shipped version, but I also want DCCL to compile with older CMake (2.8+) that ship with the old FindProtobuf.cmake.

nknotts commented 7 years ago

Understood

tsaubergine commented 7 years ago

I haven't compiled a DCCL as a static archive for a long time, and it seems like this no longer works (on a deeper level than compilation).

I pushed another commit to your branch as https://github.com/GobySoft/dccl/tree/link-protobuf-statically

The CCL and Arithmetic plugin libraries need to be shared to load them at run time. So when compiling statically I disabled compilation of those libraries.

Even so, I get a segfault on four of my unit tests, which I don't currently have time to track down (since I don't need static compilation of DCCL):

g++

g++ (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904

backtrace

==21551== Memcheck, a memory error detector
==21551== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==21551== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==21551== Command: ./dccl_test_all_fields
==21551== 
==21551== Invalid read of size 8
==21551==    at 0x530283A: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.23)
==21551==    by 0x62BA4C: std::_Rb_tree_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >::operator--() (stl_tree.h:220)
==21551==    by 0x62B98A: std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_M_get_insert_unique_pos(google::protobuf::FieldDescriptor::Type const&) (stl_tree.h:1848)
==21551==    by 0x629835: std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, google::protobuf::FieldDescriptor::Type const&) (stl_tree.h:1945)
==21551==    by 0x627A9D: std::_Rb_tree_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_M_insert_unique_<std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_Alloc_node>(std::_Rb_tree_const_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > const&, std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_Alloc_node&) (stl_tree.h:2002)
==21551==    by 0x624ECD: std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > const&) (stl_tree.h:985)
==21551==    by 0x62215E: std::map<google::protobuf::FieldDescriptor::Type, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::insert(std::_Rb_tree_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > const&) (stl_map.h:666)
==21551==    by 0x61A01C: std::map<google::protobuf::FieldDescriptor::Type, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::operator[](google::protobuf::FieldDescriptor::Type const&) (stl_map.h:487)
==21551==    by 0x617B87: void dccl::FieldCodecManager::add_single_type<dccl::v2::DefaultNumericFieldCodec<double, double> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::FieldDescriptor::Type, google::protobuf::FieldDescriptor::CppType) (field_codec_manager.h:287)
==21551==    by 0x612AFB: void dccl::FieldCodecManager::add_all_types<double, double, dccl::v2::DefaultNumericFieldCodec<double, double> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (field_codec_manager.h:276)
==21551==    by 0x60DBA9: boost::disable_if<boost::mpl::and_<boost::is_base_of<google::protobuf::Message, dccl::v2::DefaultNumericFieldCodec<double, double>::wire_type>, boost::mpl::not_<boost::is_same<google::protobuf::Message, dccl::v2::DefaultNumericFieldCodec<double, double>::wire_type> >, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >, void>::type dccl::FieldCodecManager::add<dccl::v2::DefaultNumericFieldCodec<double, double> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, dccl::compiler::dummy_fcm<1>) (field_codec_manager.h:254)
==21551==    by 0x6005BC: dccl::Codec::set_default_codecs() (codec.cpp:99)
==21551==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
==21551== 
==21551== 
==21551== Process terminating with default action of signal 11 (SIGSEGV)
==21551==  Access not within mapped region at address 0x8
==21551==    at 0x530283A: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.23)
==21551==    by 0x62BA4C: std::_Rb_tree_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >::operator--() (stl_tree.h:220)
==21551==    by 0x62B98A: std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_M_get_insert_unique_pos(google::protobuf::FieldDescriptor::Type const&) (stl_tree.h:1848)
==21551==    by 0x629835: std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, google::protobuf::FieldDescriptor::Type const&) (stl_tree.h:1945)
==21551==    by 0x627A9D: std::_Rb_tree_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_M_insert_unique_<std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_Alloc_node>(std::_Rb_tree_const_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > const&, std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_Alloc_node&) (stl_tree.h:2002)
==21551==    by 0x624ECD: std::_Rb_tree<google::protobuf::FieldDescriptor::Type, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > >, std::_Select1st<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > const&) (stl_tree.h:985)
==21551==    by 0x62215E: std::map<google::protobuf::FieldDescriptor::Type, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::insert(std::_Rb_tree_iterator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > >, std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > const&) (stl_map.h:666)
==21551==    by 0x61A01C: std::map<google::protobuf::FieldDescriptor::Type, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > >, std::less<google::protobuf::FieldDescriptor::Type>, std::allocator<std::pair<google::protobuf::FieldDescriptor::Type const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::shared_ptr<dccl::FieldCodecBase>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<dccl::FieldCodecBase> > > > > > >::operator[](google::protobuf::FieldDescriptor::Type const&) (stl_map.h:487)
==21551==    by 0x617B87: void dccl::FieldCodecManager::add_single_type<dccl::v2::DefaultNumericFieldCodec<double, double> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::FieldDescriptor::Type, google::protobuf::FieldDescriptor::CppType) (field_codec_manager.h:287)
==21551==    by 0x612AFB: void dccl::FieldCodecManager::add_all_types<double, double, dccl::v2::DefaultNumericFieldCodec<double, double> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (field_codec_manager.h:276)
==21551==    by 0x60DBA9: boost::disable_if<boost::mpl::and_<boost::is_base_of<google::protobuf::Message, dccl::v2::DefaultNumericFieldCodec<double, double>::wire_type>, boost::mpl::not_<boost::is_same<google::protobuf::Message, dccl::v2::DefaultNumericFieldCodec<double, double>::wire_type> >, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >, void>::type dccl::FieldCodecManager::add<dccl::v2::DefaultNumericFieldCodec<double, double> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, dccl::compiler::dummy_fcm<1>) (field_codec_manager.h:254)
==21551==    by 0x6005BC: dccl::Codec::set_default_codecs() (codec.cpp:99)
==21551==  If you believe this happened as a result of a stack
==21551==  overflow in your program's main thread (unlikely but
==21551==  possible), you can try to increase the size of the
==21551==  main thread stack using the --main-stacksize= flag.
==21551==  The main thread stack size used in this run was 8388608.
==21551== 
==21551== HEAP SUMMARY:
==21551==     in use at exit: 169,338 bytes in 1,639 blocks
==21551==   total heap usage: 3,251 allocs, 1,612 frees, 256,954 bytes allocated
==21551== 
==21551== LEAK SUMMARY:
==21551==    definitely lost: 0 bytes in 0 blocks
==21551==    indirectly lost: 0 bytes in 0 blocks
==21551==      possibly lost: 0 bytes in 0 blocks
==21551==    still reachable: 169,338 bytes in 1,639 blocks
==21551==         suppressed: 0 bytes in 0 blocks
==21551== Rerun with --leak-check=full to see details of leaked memory
==21551== 
==21551== For counts of detected and suppressed errors, rerun with: -v
==21551== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
nknotts commented 7 years ago

I've been using static linking successfully for my uses.

tsaubergine commented 7 years ago

OK, well then that's fine with me. This may be compiler specific, as regards to the initialization of static objects.

tsaubergine commented 7 years ago

Are you happy with this now? Should I merge it?

nknotts commented 7 years ago

:thumbsup: