Search code examples
linuxarchitecturearmsimulationgem5

gem5 build fails with "error: 'printPFflags' was not declared in this scope"


So I've been trying to learn simulation through gem5. I've just started and upon following the documentation I'm encountering an error in building gem5. I have installed all the dependencies required, and then tried to build the gem5 from the following command -

scons build/ARM/gem5.opt -j2

I also tried updating all the dependencies, but I don't know where I'm wrong. I have read a lot of gem5 docs but I couldn't figure it out. I haven't seen anyone encounter this error. I built the system once a week ago, and at that time I didn't encounter any errors and able to run a full system simulation. Please help me figure this out.

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.
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) no
Checking for C library tcmalloc_minimal... (cached) no
You can get a 12% performance improvement by installing tcmalloc (libgoogle-perftools-dev package on Ubuntu or RedHat).
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 <png.h> 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
 Checking whether __i386__ is declared... (cached) no
 Checking whether __x86_64__ is declared... (cached) yes
 Building in /home/vansh2795/gem5/build/ARM
 Using saved variables file /home/vansh2795/gem5/build/variables/ARM
 scons: done reading SConscript files.
 scons: Building targets ...
 [VER TAGS]  -> ARM/sim/tags.cc
 [     CXX] ARM/arch/arm/insts/mem64.cc -> .o
 [     CXX] ARM/arch/arm/insts/pseudo.cc -> .o
 build/ARM/arch/arm/insts/mem64.cc: In member function 'void 
 ArmISA::Memory64::startDisassembly(std::ostream&) const':
 build/ARM/arch/arm/insts/mem64.cc:68:9: error: 'printPFflags' was not 
 declared in this scope
     printPFflags(os, dest);
     ^~~~~~~~~~~~
build/ARM/arch/arm/insts/mem64.cc:68:9: note: suggested alternative: 
'printFlags'
     printPFflags(os, dest);
     ^~~~~~~~~~~~
     printFlags
scons: *** [build/ARM/arch/arm/insts/mem64.o] Error 1
scons: building terminated because of errors.

Solution

  • The fix was committed soon afterwards at e70a2a53ebac09ba5aacf706066589510c624c13

    I had reported this at: https://www.mail-archive.com/gem5-dev@gem5.org/msg27897.html

    The offending commit is 59e3585a84ef172eba57c9936680c0248f9a97db and the fix is likely to just add the missing function declaration to the header.

    Always check the dev mailing list for build failures, and give more relevant details about your system when doing so: gem5 git SHA, your OS version, compiler version.