Murali
Murali

Reputation: 21

Building GEM5 on Ubuntu 19.10

Tried GEM5 Simulator installation as per instructions provided in http://learning.gem5.org/book/part1/building.html and by doing the following:

  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. git clone https://gem5.googlesource.com/public/gem5

  3. sudo apt-get install python-six

  4. sudo scons build/X86/gem5.opt -j2

Went through all available documentation for the build errors ... Not very experienced on C++

The output after the above command is as follows:

scons: Reading SConscript files ... Warning: Your compiler doesn't support incremental linking and lto at the same time, so lto is being disabled. To force lto on anyway, use the --force-lto option. That will disable partial linking. Info: Using Python config: /usr/bin/python2.7-config Checking for C header file Python.h... (cached) yes Checking for C library python2.7... (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 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 C header file valgrind/valgrind.h... (cached) no Checking for clock_nanosleep(0,0,NULL,NULL) in C library None... (cached) yes Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library None... (cached) no Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library rt... (cached) yes Checking for C library tcmalloc... (cached) yes Checking for char temp; backtrace_symbols_fd((void*)&temp, 0, 0) in C library None... (cached) yes Checking for C header file fenv.h... (cached) yes Checking for C header file png.h... (cached) no Warning: Header file not found. This host has no libpng library. Disabling support for PNG framebuffers. Checking for C header file linux/kvm.h... (cached) yes Checking for C header file linux/if_tun.h... (cached) yes Checking size of struct kvm_xsave ... (cached) yes Checking for member exclude_host in struct perf_event_attr...(cached) yes Package hdf5-serial was not found in the pkg-config search path. Perhaps you should add the directory containing hdf5-serial.pc' to the PKG_CONFIG_PATH environment variable No package 'hdf5-serial' found Checking for hdf5-serial using pkg-config... no Package hdf5 was not found in the pkg-config search path. Perhaps you should add the directory containinghdf5.pc' to the PKG_CONFIG_PATH environment variable No package 'hdf5' found Checking for hdf5 using pkg-config... no Checking for H5Fcreate("", 0, 0, 0) in C library hdf5... (cached) no Warning: Couldn't find any HDF5 C++ libraries. Disabling HDF5 support. Checking whether i386 is declared... (cached) no Checking whether x86_64 is declared... (cached) yes Building in /home/murali/GEM5/gem5/build/X86 Using saved variables file /home/murali/GEM5/gem5/build/variables/X86 scons: done reading SConscript files. scons: Building targets ... [ CXX] X86/dev/x86/pc.cc -> .o [ TRACING] -> X86/debug/I8254.hh [ CXX] X86/dev/x86/i8254.cc -> .o In file included from build/X86/dev/x86/pc.cc:41: build/X86/arch/x86/intmessage.hh: In function 'Packet* X86ISA::buildIntTriggerPacket(int, X86ISA::TriggerIntMessage)': build/X86/arch/x86/intmessage.hh:84:44: error: implicitly-declared 'constexpr BitfieldBackend::BitUnionOperators::BitUnionOperators(const BitfieldBackend::BitUnionOperators&)' is deprecated [-Werror=deprecated-copy] 84 | return buildIntPacket(addr, message); | ^ In file included from build/X86/sim/serialize.hh:62, from build/X86/sim/eventq.hh:53, from build/X86/sim/sim_object.hh:58, from build/X86/dev/platform.hh:44, from build/X86/dev/x86/pc.hh:40, from build/X86/dev/x86/pc.cc:35: build/X86/base/bitunion.hh:262:9: note: because 'BitfieldBackend::BitUnionOperators' has user-provided 'typename Base::__StorageType BitfieldBackend::BitUnionOperators::operator=(const BitfieldBackend::BitUnionOperators&) [with Base = X86ISA::BitfieldUnderlyingClassesTriggerIntMessage; typename Base::__StorageType = unsigned int]' 262 | operator=(BitUnionOperators const &other) | ^~~~~~~~ In file included from build/X86/arch/x86/intmessage.hh:37, from build/X86/dev/x86/pc.cc:41: build/X86/dev/x86/intdev.hh:87:29: note: initializing argument 2 of 'Packet* X86ISA::buildIntPacket(Addr, T) [with T = BitfieldBackend::BitUnionOperators; PacketPtr = Packet*; Addr = long unsigned int]' 87 | buildIntPacket(Addr addr, T payload) | ~~^~~~~~~ build/X86/dev/x86/intdev.hh: In instantiation of 'Packet* X86ISA::buildIntPacket(Addr, T) [with T = BitfieldBackend::BitUnionOperators; PacketPtr = Packet*; Addr = long unsigned int]': build/X86/arch/x86/intmessage.hh:84:44: required from here build/X86/dev/x86/intdev.hh:93:5: error: implicitly-declared 'constexpr BitfieldBackend::BitUnionOperators::BitUnionOperators(const BitfieldBackend::BitUnionOperators&)' is deprecated [-Werror=deprecated-copy] 93 | pkt->setRaw(payload); | ^~~ In file included from build/X86/sim/serialize.hh:62, from build/X86/sim/eventq.hh:53, from build/X86/sim/sim_object.hh:58, from build/X86/dev/platform.hh:44, from build/X86/dev/x86/pc.hh:40, from build/X86/dev/x86/pc.cc:35: build/X86/base/bitunion.hh:262:9: note: because 'BitfieldBackend::BitUnionOperators' has user-provided 'typename Base::__StorageType BitfieldBackend::BitUnionOperators::operator=(const BitfieldBackend::BitUnionOperators&) [with Base = X86ISA::BitfieldUnderlyingClassesTriggerIntMessage; typename Base::__StorageType = unsigned int]' 262 | operator=(BitUnionOperators const &other) | ^~~~~~~~ In file included from build/X86/arch/x86/intmessage.hh:39, from build/X86/dev/x86/pc.cc:41: build/X86/mem/packet_access.hh:62:18: note: initializing argument 1 of 'void Packet::setRaw(T) [with T = BitfieldBackend::BitUnionOperators]' 62 | Packet::setRaw(T v) | ~~^ [ CXX] X86/dev/x86/i8237.cc -> .o cc1plus: all warnings being treated as errors scons: *** [build/X86/dev/x86/pc.o] Error 1 scons: building terminated because of errors.

Can anyone help me in removing the above errors and in a successful build of the GEM5 simulator build. Thanks in advance

Upvotes: 2

Views: 1460

Answers (1)

LordHoratio
LordHoratio

Reputation: 31

Looks like this problem is caused by treating various compiler warnings as errors, when in reality you can ignore them. Go into SConstruct and comment out this function:

main.Append(CCFLAGS=['-Werror',
                     '-Wno-error=deprecated-declarations',
                     '-Wno-error=deprecated',
                      ])

Alternatively, you can keep adding all the errors you come across to the -Wno-error list, but that would be a bit more tedious.

Upvotes: 1

Related Questions