It looks like unordered_map or unordered_set is not behaving correctly (e.g.
not finding matching keys when they are present) but I can't really tell
just from that output.
On Mon, Jul 20, 2009 at 11:53 AM, vikram <patilvik...@gmail.com> wrote:

>
> In previous attempt small test worked but was not able to work with
> protocol buffer source code.
> I tried one more thing as
> #if deinfed (MISSING_HASH_MAP) && defined (__xlC__)
> #define hash_map std::tr1::unordered_map
>
> google/protobuf/unittest.proto:85:37: Expected ";".
> google/protobuf/unittest.proto:117:37: Expected ";".
> google/protobuf/unittest.proto:133:55: Expected identifier.
> google/protobuf/unittest.proto:134:55: Expected identifier.
> google/protobuf/unittest.proto:135:55: Expected identifier.
> google/protobuf/unittest.proto:136:55: Expected identifier.
> google/protobuf/unittest.proto:137:54: Expected identifier.
> google/protobuf/unittest.proto:138:55: Expected identifier.
> google/protobuf/unittest.proto:139:55: Expected identifier.
> google/protobuf/unittest.proto:140:55: Expected identifier.
> google/protobuf/unittest.proto:141:55: Expected identifier.
> google/protobuf/unittest.proto:142:54: Expected identifier.
> google/protobuf/unittest.proto:143:55: Expected identifier.
> google/protobuf/unittest.proto:144:55: Expected identifier.
> google/protobuf/unittest.proto:146:54: Expected identifier.
> google/protobuf/unittest.proto:147:54: Expected identifier.
> google/protobuf/unittest.proto:154:73: Expected identifier.
> google/protobuf/unittest.proto:155:57: Expected identifier.
> google/protobuf/unittest.proto:192:47: Expected ";".
> google/protobuf/unittest.proto:226:47: Expected ";".
> google/protobuf/unittest.proto:244:65: Expected identifier.
> google/protobuf/unittest.proto:245:65: Expected identifier.
> google/protobuf/unittest.proto:246:65: Expected identifier.
> google/protobuf/unittest.proto:247:65: Expected identifier.
> google/protobuf/unittest.proto:248:64: Expected identifier.
> google/protobuf/unittest.proto:249:65: Expected identifier.
> google/protobuf/unittest.proto:250:65: Expected identifier.
> google/protobuf/unittest.proto:251:65: Expected identifier.
> google/protobuf/unittest.proto:252:65: Expected identifier.
> google/protobuf/unittest.proto:253:64: Expected identifier.
> google/protobuf/unittest.proto:254:65: Expected identifier.
> google/protobuf/unittest.proto:255:65: Expected identifier.
> google/protobuf/unittest.proto:257:64: Expected identifier.
> google/protobuf/unittest.proto:258:64: Expected identifier.
> google/protobuf/unittest.proto:268:64: Expected identifier.
> google/protobuf/unittest.proto:269:68: Expected identifier.
> google/protobuf/unittest.proto:276:42: Expected identifier.
> google/protobuf/unittest.proto:379:26: Expected ";".
> google/protobuf/unittest.proto:380:26: Expected ";".
> google/protobuf/unittest.proto:451:47: Expected identifier.
> google/protobuf/unittest.proto:452:47: Expected identifier.
> google/protobuf/unittest.proto:453:47: Expected identifier.
> google/protobuf/unittest.proto:454:47: Expected identifier.
> google/protobuf/unittest.proto:455:47: Expected identifier.
> google/protobuf/unittest.proto:460:46: Expected identifier.
> gmake: *** [unittest_proto_middleman] Error 1
>
> So I guess it wont even compile with unordered_map provided on Linux .
> Please provide some inputs on this one.
>
> Thanks & Regards,
> Vikram
>
> On Jul 14, 6:35 pm, Kenton Varda <ken...@google.com> wrote:
> > It looks like your implementation of hash_map is not working correctly --
> > all lookups are failing.  You might try writing a little test for
> hash_map
> > itself that would be easier to debug.
> >
> > On Tue, Jul 14, 2009 at 6:27 PM, vikram <patilvik...@gmail.com> wrote:
> >
> > > Kenton & Monty,
> >
> > >        I added hack as followes in the hash.h
> >
> > > // File changed .....
> >
> > > #if defined(HAVE_HASH_MAP) && defined(HAVE_HASH_SET)
> > > #include HASH_MAP_H
> > > #include HASH_SET_H
> > > #elif  defined (__xlC__)
> > > #define MISSING_HASH
> > > #include <unordered_map>
> > > #include <unordered_set>
> > > #else
> > > #define MISSING_HASH
> > > #include <map>
> > > #include <set>
> > > #endif
> >
> > > namespace google {
> > > namespace protobuf {
> > > #if defined(MISSING_HASH) && defined(__xlC__)
> >
> > > //@TODO
> > > //Inherit hash_map from unordered_map
> > > template <typename Key>
> > > struct hash : public std::tr1::hash<Key> {
> > > };
> >
> > > template <typename Key>
> > > struct hash<const Key*> {
> > >  inline size_t operator()(const Key* key) const {
> > >    return reinterpret_cast<size_t>(key);
> > >  }
> > > };
> >
> > > template <typename Key, typename Data,
> > >          typename HashFcn = hash<Key>,
> > >          typename EqualKey = std::equal_to<Key> >
> > > class hash_map : public std::tr1::unordered_map<Key, Data, HashFcn ,
> > > EqualKey> {
> >
> > > };
> >
> > > template <typename Key,
> > >          typename HashFcn = hash<Key>,
> > >          typename EqualKey = std::equal_to<Key> >
> > > class hash_set : public std::tr1::unordered_set<
> > >    Key, HashFcn, EqualKey> {
> > > };
> > > #elif defined(MISSING_HASH)
> >
> > > File continues as it is
> >
> > > Stack trace
> >
> > > pthread_kill(??, ??) at 0xd01246b4
> > > _p_raise(??) at 0xd0124124
> > > raise.raise(??) at 0xd0375b28
> > > abort() at 0xd03d3e78
> > > google::protobuf::internal::LogMessage::Finish()(this = 0x2ff21e40),
> > > line 171 in "common.cc"
> > > google::protobuf::internal::LogFinisher::operator=
> > > (google::protobuf::internal::LogMessage&)(this = 0x2ff21e38, other = &
> > > (...)), line 176 in "common.cc"
> > > protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto()(), line
> > > 82 in "descriptor.pb.cc"
> > > pthread_once(??, ??) at 0xd0115e78
> > > common.GoogleOnceInit(pthread_once_t*,void(*)())(0xf04a9d00,
> > > 0xf04b15a0), line 114 in "once.h"
> > > protobuf_AssignDescriptorsOnce()(), line 408 in "descriptor.pb.cc"
> > > google::protobuf::FileOptions::descriptor()(), line 3862 in
> > > "descriptor.pb.cc"
> > > google::protobuf::FileOptions::GetDescriptor() const(this =
> > > 0x2000e248), line 4190 in "descriptor.pb.cc"
> > > google::protobuf::compiler::Parser::ParseOptionAssignment
> > > (google::protobuf::Message*)(this = 0x2ff223b8, options = 0x2000e248),
> > > line 659 in "parser.cc"
> > > google::protobuf::compiler::Parser::ParseOption
> > > (google::protobuf::Message*)(this = 0x2ff223b8, options = 0x2000e248),
> > > line 1081 in "parser.cc"
> > > google::protobuf::compiler::Parser::ParseTopLevelStatement
> > > (google::protobuf::FileDescriptorProto*)(this = 0x2ff223b8, file =
> > > 0x2ff22460), line 375 in "parser.cc"
> > > google::protobuf::compiler::Parser::Parse
> > >
> (google::protobuf::io::Tokenizer*,google::protobuf::FileDescriptorProto*)
> > > (this = 0x2ff223b8, input = 0x2ff22368, file = 0x2ff22460), line 321
> > > in "parser.cc"
> > >
> google::protobuf::compiler::SourceTreeDescriptorDatabase::FindFileByName
> > > (const
> > > std::basic_string<char,std::char_traits<char>,std::allocator<char>
> > > >&,google::protobuf::FileDescriptorProto*)(this = 0x2ff22688, filename
> > > = &(...), output = 0x2ff22460), line 145 in "importer.cc"
> > > TryFindFileInFallbackDatabase(const
> > > std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)
> > > const(0x2ff226ac, 0x2000b9d8), line 1230 in "descriptor.cc"
> > > NFS write error on host esfs3-lnx.actuate.com: 28.
> > > File: userid=1104, groupid=1000
> > > FindFileByName(const
> > > std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)
> > > const(0x2ff226ac, 0x2000b9d8), line 875 in "descriptor.cc"
> > > google::protobuf::compiler::Importer::Import(const
> > > std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)
> > > (this = 0x2ff22688, filename = &(...)), line 194 in "importer.cc"
> >
> > > Protoc compiler aborted
> >
> > > ./protoc google/protobuf/unittest.proto google/protobuf/
> > > unittest_empty.proto google/protobuf/unittest_import.proto google/
> > > protobuf/unittest_mset.proto google/protobuf/
> > > unittest_optimize_for.proto google/protobuf/
> > > unittest_embed_optimize_for.proto google/protobuf/
> > > unittest_custom_options.proto google/protobuf/compiler/cpp/
> > > cpp_test_bad_identifiers.proto -I. --cpp_out=.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2215] Invalid proto
> > > descriptor for file "google/protobuf/descriptor.proto":
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FileDescriptorSet.file:
> > > ".google.protobuf.FileDescriptorProto" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FileDescriptorProto.message_type:
> > > ".google.protobuf.DescriptorProto" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FileDescriptorProto.extension:
> > > ".google.protobuf.FieldDescriptorProto" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FileDescriptorProto.options:
> > > ".google.protobuf.FileOptions" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.DescriptorProto.field:
> > > ".google.protobuf.FieldDescriptorProto" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.DescriptorProto.extension:
> > > ".google.protobuf.FieldDescriptorProto" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.DescriptorProto.nested_type:
> > > ".google.protobuf.DescriptorProto" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.DescriptorProto.enum_type:
> > > ".google.protobuf.EnumDescriptorProto" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.DescriptorProto.extension_range:
> > > ".google.protobuf.DescriptorProto.ExtensionRange" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.DescriptorProto.options:
> > > ".google.protobuf.MessageOptions" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FieldDescriptorProto.label:
> > > ".google.protobuf.FieldDescriptorProto.Label" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FieldDescriptorProto.type:
> > > ".google.protobuf.FieldDescriptorProto.Type" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FieldDescriptorProto.options:
> > > ".google.protobuf.FieldOptions" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.EnumDescriptorProto.value:
> > > ".google.protobuf.EnumValueDescriptorProto" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.EnumDescriptorProto.options:
> > > ".google.protobuf.EnumOptions" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.EnumValueDescriptorProto.options:
> > > ".google.protobuf.EnumValueOptions" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.ServiceDescriptorProto.method:
> > > ".google.protobuf.MethodDescriptorProto" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.ServiceDescriptorProto.options:
> > > ".google.protobuf.ServiceOptions" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.MethodDescriptorProto.options:
> > > ".google.protobuf.MethodOptions" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FileOptions.optimize_for:
> > > ".google.protobuf.FileOptions.OptimizeMode" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FileOptions.uninterpreted_option:
> > > ".google.protobuf.UninterpretedOption" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.MessageOptions.uninterpreted_option:
> > > ".google.protobuf.UninterpretedOption" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FieldOptions.ctype:
> > > ".google.protobuf.FieldOptions.CType" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.FieldOptions.uninterpreted_option:
> > > ".google.protobuf.UninterpretedOption" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.EnumOptions.uninterpreted_option:
> > > ".google.protobuf.UninterpretedOption" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.EnumValueOptions.uninterpreted_option:
> > > ".google.protobuf.UninterpretedOption" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.ServiceOptions.uninterpreted_option:
> > > ".google.protobuf.UninterpretedOption" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.MethodOptions.uninterpreted_option:
> > > ".google.protobuf.UninterpretedOption" is not defined.
> > > libprotobuf ERROR google/protobuf/descriptor.cc:2218]
> > > google.protobuf.UninterpretedOption.name:
> > > ".google.protobuf.UninterpretedOption.NamePart" is not defined.
> > > libprotobuf FATAL google/protobuf/descriptor.pb.cc:82] CHECK failed:
> > > file != NULL:
> > > gmake[2]: *** [unittest_proto_middleman] IOT/Abort trap (core dumped)
> >
> > > Any suggestions?
> >
> > > Thanks & Regards,
> > > Vikram
> >
> > > On Jul 13, 5:23 pm, Kenton Varda <ken...@google.com> wrote:
> > > > And yes, I'd love a patch.  :)
> >
> > > > On Mon, Jul 13, 2009 at 5:22 PM, Kenton Varda <ken...@google.com>
> wrote:
> > > > > google/protobuf/stubs/hash.h already contains some hacks for
> hash_map.
> > >  To
> > > > > support unordered_map, all we'd have to do is add another hack
> there
> > > which
> > > > > defines
> >
> > ...
> >
> > read more ยป
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to