Hi Adel, I suspect this is a result of different C++ ABIs used for protobuf and gem5, for example protobuf compiled with gcc 4.x and gem5 compiled with gcc 5.x or later. The easiest way around this is to ensure gem5 is using the same compiler as what was used for protobuf. Alternatively you can force gcc to use the old gcc 4.x ABI by setting D_GLIBCXX_USE_CXX11_ABI=0.
Andreas From: gem5-users <[email protected]<mailto:[email protected]>> on behalf of "Ejjeh, Adel" <[email protected]<mailto:[email protected]>> Reply-To: gem5 users mailing list <[email protected]<mailto:[email protected]>> Date: Sunday, 2 October 2016 at 18:52 To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: [gem5-users] Error while building gem5 Hi everyone I am trying to build the ARM version of gem5 on a CentOS 6 machine and I am getting the following error: scons CPU_MODELS="AtomicSimpleCPU,MinorCPU,O3CPU,TimingSimpleCPU" build/ARM/gem5.opt -j9 scons: Reading SConscript files ... Checking for leading underscore in global variables...(cached) no Checking for C header file Python.h... (cached) yes Checking for C library pthread... (cached) yes Checking for C library dl... (cached) yes Checking for C library util... (cached) yes Checking for C library m... (cached) yes Checking for C library python2.6... (cached) yes Checking for accept(0,0,0) in C++ library None... (cached) yes Checking for zlibVersion() in C++ library z... (cached) yes Checking for GOOGLE_PROTOBUF_VERIFY_VERSION in C++ library protobuf... (cached) yes Checking for clock_nanosleep(0,0,NULL,NULL) in C library None... (cached) no Checking for clock_nanosleep(0,0,NULL,NULL) in C library rt... (cached) yes Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library None... (cached) yes Checking for C library tcmalloc... (cached) yes Checking for C header file fenv.h... (cached) yes Checking for C header file linux/kvm.h... (cached) yes Checking size of struct kvm_xsave ... (cached) yes Checking for member exclude_host in struct perf_event_attr...(cached) yes Building in /home/aejjeh/gem5-stable/build/ARM Using saved variables file /home/aejjeh/gem5-stable/build/variables/ARM scons: done reading SConscript files. scons: Building targets ... [NEW DEPS] ARM/arch/arm/generated/inc.d -> arm-deps [ENVIRONS] arm-deps -> arm-environs [ LINK] -> ARM/gem5.opt build/ARM/proto/packet.pb.o: In function `ProtoMessage::PacketHeader::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const': /home/aejjeh/gem5-stable/build/ARM/proto/packet.pb.cc:281<http://packet.pb.cc:281>: undefined reference to `google::protobuf::internal::WireFormatLite::WriteString(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::io::CodedOutputStream*)' build/ARM/proto/packet.pb.o: In function `ProtoMessage::PacketHeader::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /home/aejjeh/gem5-stable/build/ARM/proto/packet.pb.cc:213<http://packet.pb.cc:213>: undefined reference to `google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' build/ARM/proto/packet.pb.o: In function `ProtoMessage::protobuf_AddDesc_packet_2eproto()': /home/aejjeh/gem5-stable/build/ARM/proto/packet.pb.cc:110<http://packet.pb.cc:110>: undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))' build/ARM/proto/packet.pb.o: In function `ProtoMessage::protobuf_AssignDesc_packet_2eproto()': /home/aejjeh/gem5-stable/build/ARM/proto/packet.pb.cc:31<http://packet.pb.cc:31>: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' build/ARM/proto/packet.pb.o:(.rodata._ZTVN12ProtoMessage12PacketHeaderE[_ZTVN12ProtoMessage12PacketHeaderE]+0x20): undefined reference to `_ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev' build/ARM/proto/packet.pb.o:(.rodata._ZTVN12ProtoMessage12PacketHeaderE[_ZTVN12ProtoMessage12PacketHeaderE]+0x40): undefined reference to `_ZNK6google8protobuf7Message25InitializationErrorStringB5cxx11Ev' build/ARM/proto/packet.pb.o:(.rodata._ZTVN12ProtoMessage6PacketE[_ZTVN12ProtoMessage6PacketE]+0x20): undefined reference to `_ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev' build/ARM/proto/packet.pb.o:(.rodata._ZTVN12ProtoMessage6PacketE[_ZTVN12ProtoMessage6PacketE]+0x40): undefined reference to `_ZNK6google8protobuf7Message25InitializationErrorStringB5cxx11Ev' build/ARM/proto/inst.pb.o: In function `ProtoMessage::InstHeader::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const': /home/aejjeh/gem5-stable/build/ARM/proto/inst.pb.cc:350<http://inst.pb.cc:350>: undefined reference to `google::protobuf::internal::WireFormatLite::WriteString(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::io::CodedOutputStream*)' build/ARM/proto/inst.pb.o: In function `ProtoMessage::InstHeader::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /home/aejjeh/gem5-stable/build/ARM/proto/inst.pb.cc:266<http://inst.pb.cc:266>: undefined reference to `google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' build/ARM/proto/inst.pb.o: In function `ProtoMessage::protobuf_AddDesc_inst_2eproto()': /home/aejjeh/gem5-stable/build/ARM/proto/inst.pb.cc:158<http://inst.pb.cc:158>: undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))' build/ARM/proto/inst.pb.o: In function `ProtoMessage::protobuf_AssignDesc_inst_2eproto()': /home/aejjeh/gem5-stable/build/ARM/proto/inst.pb.cc:35<http://inst.pb.cc:35>: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' build/ARM/proto/inst.pb.o:(.rodata._ZTVN12ProtoMessage10InstHeaderE[_ZTVN12ProtoMessage10InstHeaderE]+0x20): undefined reference to `_ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev' build/ARM/proto/inst.pb.o:(.rodata._ZTVN12ProtoMessage10InstHeaderE[_ZTVN12ProtoMessage10InstHeaderE]+0x40): undefined reference to `_ZNK6google8protobuf7Message25InitializationErrorStringB5cxx11Ev' build/ARM/proto/inst.pb.o:(.rodata._ZTVN12ProtoMessage14Inst_MemAccessE[_ZTVN12ProtoMessage14Inst_MemAccessE]+0x20): undefined reference to `_ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev' build/ARM/proto/inst.pb.o:(.rodata._ZTVN12ProtoMessage14Inst_MemAccessE[_ZTVN12ProtoMessage14Inst_MemAccessE]+0x40): undefined reference to `_ZNK6google8protobuf7Message25InitializationErrorStringB5cxx11Ev' build/ARM/proto/inst.pb.o:(.rodata._ZTVN12ProtoMessage4InstE[_ZTVN12ProtoMessage4InstE]+0x20): undefined reference to `_ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev' build/ARM/proto/inst.pb.o:(.rodata._ZTVN12ProtoMessage4InstE[_ZTVN12ProtoMessage4InstE]+0x40): undefined reference to `_ZNK6google8protobuf7Message25InitializationErrorStringB5cxx11Ev' collect2: error: ld returned 1 exit status scons: *** [build/ARM/gem5.opt] Error 1 scons: building terminated because of errors. As you can see towards the end of the output it is complaining about undefined references which seem to be related to protobuf. I have installed protobuf both using “yum” and from source. Any ideas? Regards Adel Ejjeh IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
_______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
