我正在尝试在gem5中运行CPU2006,因此我下载了gem5并执行以下操作: 1:安装所需的依赖项:
>>sudo apt install build-essential git m4 scons zlib1g zlib1g-dev libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev python-dev python
2:下载gem5来源:
>>git clone https://gem5.googlesource.com/public/gem5
3:构建X86系统:
>>scons build/X86/gem5.opt
运行第三步期间,刚发生错误。
[ TRACING] -> X86/debug/KvmRun.hh
[ CXX] X86/cpu/kvm/base.cc -> .o
[ CXX] X86/cpu/kvm/device.cc -> .o
[ CXX] X86/cpu/kvm/vm.cc -> .o
[ CXX] X86/cpu/kvm/perfevent.cc -> .o
[ TRACING] -> X86/debug/KvmTimer.hh
[ CXX] X86/cpu/kvm/timer.cc -> .o
[ TRACING] -> X86/debug/KvmContext.hh
[ TRACING] -> X86/debug/KvmInt.hh
[ CXX] X86/cpu/kvm/x86_cpu.cc -> .o
[ LINK] -> X86/cpu/kvm/lib.o.partial
[ TRACING] -> X86/debug/MemTest.hh
[ CXX] X86/cpu/testers/memtest/memtest.cc -> .o
[ LINK] -> X86/cpu/testers/memtest/lib.o.partial
[ CXX] X86/base/date.cc -> .o
[ LINK] -> X86/gem5.opt
build/X86/base/lib.o.partial: In function `Stats::Hdf5::begin()':
/home/kolin/gem5/build/X86/base/stats/hdf5.cc:81: undefined reference to `H5::H5File::H5File(std::string const&, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)'
build/X86/base/lib.o.partial: In function `Stats::Hdf5::appendStat(Stats::Info const&, int, unsigned long long*, double const*)':
/home/kolin/gem5/build/X86/base/stats/hdf5.cc:230: undefined reference to `H5::CommonFG::openDataSet(std::string const&) const'
/home/kolin/gem5/build/X86/base/stats/hdf5.cc:253: undefined reference to `H5::CommonFG::createDataSet(std::string const&, H5::DataType const&, H5::DataSpace const&, H5::DSetCreatPropList const&) const'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::InstDepRecordHeader::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const':
/home/kolin/gem5/build/X86/proto/inst_dep_record.pb.cc:346: undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `google::protobuf::internal::WireFormatLite::WriteStringToArray(int, std::string const&, unsigned char*)':
/usr/include/google/protobuf/wire_format_lite_inl.h:749: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::InstDepRecordHeader::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)':
/home/kolin/gem5/build/X86/proto/inst_dep_record.pb.cc:256: undefined reference to `google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::string*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::protobuf_AddDesc_inst_5fdep_5frecord_2eproto()':
/home/kolin/gem5/build/X86/proto/inst_dep_record.pb.cc:132: undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::protobuf_AssignDesc_inst_5fdep_5frecord_2eproto()':
/home/kolin/gem5/build/X86/proto/inst_dep_record.pb.cc:38: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::string const&) const'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial:/usr/include/google/protobuf/generated_message_util.h:80: more undefined references to `google::protobuf::internal::empty_string_' follow
build/X86/unittest/lib.o.partial: In function `ProtoMessage::PacketHeader_IdStringEntry::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const':
/home/kolin/gem5/build/X86/proto/packet.pb.cc:317: undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `google::protobuf::internal::WireFormatLite::WriteStringToArray(int, std::string const&, unsigned char*)':
/usr/include/google/protobuf/wire_format_lite_inl.h:749: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::PacketHeader::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const':
/home/kolin/gem5/build/X86/proto/packet.pb.cc:630: undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::PacketHeader_IdStringEntry::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)':
/home/kolin/gem5/build/X86/proto/packet.pb.cc:267: undefined reference to `google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::string*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `google::protobuf::internal::WireFormatLite::WriteStringToArray(int, std::string const&, unsigned char*)':
/usr/include/google/protobuf/wire_format_lite_inl.h:749: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
/usr/include/google/protobuf/wire_format_lite_inl.h:749: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::PacketHeader::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)':
/home/kolin/gem5/build/X86/proto/packet.pb.cc:541: undefined reference to `google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::string*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial:/usr/include/google/protobuf/generated_message_util.h:80: more undefined references to `google::protobuf::internal::empty_string_' follow
build/X86/unittest/lib.o.partial: In function `ProtoMessage::protobuf_AddDesc_packet_2eproto()':
/home/kolin/gem5/build/X86/proto/packet.pb.cc:144: undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::protobuf_AssignDesc_packet_2eproto()':
/home/kolin/gem5/build/X86/proto/packet.pb.cc:40: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::string const&) const'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::InstHeader::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const':
/home/kolin/gem5/build/X86/proto/inst.pb.cc:381: undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `google::protobuf::internal::WireFormatLite::WriteStringToArray(int, std::string const&, unsigned char*)':
/usr/include/google/protobuf/wire_format_lite_inl.h:749: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::InstHeader::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)':
/home/kolin/gem5/build/X86/proto/inst.pb.cc:291: undefined reference to `google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::string*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::Inst::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const':
/home/kolin/gem5/build/X86/proto/inst.pb.cc:1277: undefined reference to `google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::Inst::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)':
/home/kolin/gem5/build/X86/proto/inst.pb.cc:1198: undefined reference to `google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::string*)'
build/X86/unittest/lib.o.partial: In function `google::protobuf::internal::WireFormatLite::WriteBytesToArray(int, std::string const&, unsigned char*)':
/usr/include/google/protobuf/wire_format_lite_inl.h:755: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial:/usr/include/google/protobuf/generated_message_util.h:80: more undefined references to `google::protobuf::internal::empty_string_' follow
build/X86/unittest/lib.o.partial: In function `ProtoMessage::protobuf_AddDesc_inst_2eproto()':
/home/kolin/gem5/build/X86/proto/inst.pb.cc:165: undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
build/X86/unittest/lib.o.partial: In function `ProtoMessage::protobuf_AssignDesc_inst_2eproto()':
/home/kolin/gem5/build/X86/proto/inst.pb.cc:41: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::string const&) const'
build/X86/unittest/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage19InstDepRecordHeaderE[_ZTVN12ProtoMessage19InstDepRecordHeaderE]+0x20): undefined reference to `google::protobuf::Message::GetTypeName() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage19InstDepRecordHeaderE[_ZTVN12ProtoMessage19InstDepRecordHeaderE]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage13InstDepRecordE[_ZTVN12ProtoMessage13InstDepRecordE]+0x20): undefined reference to `google::protobuf::Message::GetTypeName() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage13InstDepRecordE[_ZTVN12ProtoMessage13InstDepRecordE]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage26PacketHeader_IdStringEntryE[_ZTVN12ProtoMessage26PacketHeader_IdStringEntryE]+0x20): undefined reference to `google::protobuf::Message::GetTypeName() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage26PacketHeader_IdStringEntryE[_ZTVN12ProtoMessage26PacketHeader_IdStringEntryE]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage12PacketHeaderE[_ZTVN12ProtoMessage12PacketHeaderE]+0x20): undefined reference to `google::protobuf::Message::GetTypeName() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage12PacketHeaderE[_ZTVN12ProtoMessage12PacketHeaderE]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage6PacketE[_ZTVN12ProtoMessage6PacketE]+0x20): undefined reference to `google::protobuf::Message::GetTypeName() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage6PacketE[_ZTVN12ProtoMessage6PacketE]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage10InstHeaderE[_ZTVN12ProtoMessage10InstHeaderE]+0x20): undefined reference to `google::protobuf::Message::GetTypeName() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage10InstHeaderE[_ZTVN12ProtoMessage10InstHeaderE]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage14Inst_MemAccessE[_ZTVN12ProtoMessage14Inst_MemAccessE]+0x20): undefined reference to `google::protobuf::Message::GetTypeName() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage14Inst_MemAccessE[_ZTVN12ProtoMessage14Inst_MemAccessE]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage4InstE[_ZTVN12ProtoMessage4InstE]+0x20): undefined reference to `google::protobuf::Message::GetTypeName() const'
build/X86/unittest/lib.o.partial:(.rodata._ZTVN12ProtoMessage4InstE[_ZTVN12ProtoMessage4InstE]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const'
build/X86/cpu/o3/probe/lib.o.partial: In function `InstDepRecord_RecordType_Name':
/home/kolin/gem5/build/X86/proto/inst_dep_record.pb.h:54: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
/home/kolin/gem5/build/X86/proto/inst_dep_record.pb.h:54: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
build/X86/cpu/o3/probe/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
build/X86/cpu/trace/lib.o.partial: In function `InstDepRecord_RecordType_Name':
/home/kolin/gem5/build/X86/proto/inst_dep_record.pb.h:54: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
/home/kolin/gem5/build/X86/proto/inst_dep_record.pb.h:54: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
build/X86/mem/probes/lib.o.partial: In function `GetEmptyStringAlreadyInited':
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
/usr/include/google/protobuf/generated_message_util.h:80: undefined reference to `google::protobuf::internal::empty_string_'
collect2: error: ld returned 1 exit status
scons: *** [build/X86/gem5.opt] Error 1
scons: building terminated because of errors.
我的操作系统是Ubuntu 16.04.1。 我不知道发生了什么事,如果有人能帮助我,我将不胜感激。
答案 0 :(得分:0)
我通过将操作系统从Ubuntu 16.04更新到19.04来解决此问题。一切正常。