hpsresearchgroup / scarab

Joint HPS and ETH Repository to work towards open sourcing Scarab and Ramulator
MIT License
65 stars 36 forks source link

[BUG] Multiple compilation errors #152

Open useredsa opened 6 months ago

useredsa commented 6 months ago

Describe the bug

The project does not compile due to multiple errors.

  1. File src/ramulator/StatType.h is missing #include <stdint.h> or at least #include <cstdint> to use the types uint3264_t et al. (The difference between both headers is that the last one, per the standard, includes the names under the namespace std::, which is not used in the codebase for these names.)
  2. The project compiles with -Werror, specified in src/CmakeLists.txt and taken as a flag from the PIN3.5 dependency and in newer versions of GCC the project has some warnings, like the following.
    ../pin_lib/decoder.cc: In function ‘void pin_decoder_print_unknown_opcodes()’:
    ../pin_lib/decoder.cc:140:18: error: loop variable ‘opcode’ creates a copy from type ‘const std::basic_string<char, std::char_traits<char>, std::allocator<char> >’ [-Werror=range-loop-construct]
    140 |   for(const auto opcode : unknown_opcodes) {
      |                  ^~~~~~
    ../pin_lib/decoder.cc:140:18: note: use reference type to prevent copying
    140 |   for(const auto opcode : unknown_opcodes) {
      |                  ^~~~~~
      |                  &
    cc1plus: all warnings being treated as errors
  3. There are shared global variable names that are not declared static nor extern, leading to link errors. For example, variable proc_infos is declared in multiple files. It is not clear whether these variables should point to the same memory (and be change to extern) or not (static).
    src $ grep -R -E '\bProc_Info\*\s*proc_infos'
    dvfs/dvfs.c:static Proc_Info* proc_infos;
    dvfs/perf_pred.c:Proc_Info* proc_infos;
    memory/cache_part.c:Proc_Info* proc_infos;
    debug/memview.c:Proc_Info*    proc_infos;

To Reproduce

I'm compiling with the following software:

chestercai1995 commented 6 months ago

This is an issue with our PR at the moment, but the fix is pushed in a separate branch if you need it.