Repository: riscv-software-src/riscv-perf-model (language: cpp)

Issue:
Build problems
Hi, I am starting on Olympia and having some problems with respect the build of various components which I already solved.

The last thing that I am doing is trying to generate a trace via Dromajo with drystone benchmark. But it seems that it needs a backward version of gcc/glibc.

Do you have a version which for the moment I can build Dromajo?

Thanks!



Discussion / hints:
Hi Isaac, the Condor folks have a port of Dromajo that you might try: https://github.com/riscv-software-src/riscv-perf-model/issues/169#issuecomment-2103275637.  I've been meaning to update Olympia to point to this fork for some time, but haven't had an opportunity to do so (want to test it, etc).

Curious, what build issues did you incur while getting Olympia up? 
```bash
[  0%] Built target stf_git_version
[ 10%] Built target mavis
[ 16%] Built target mss
[ 18%] Building CXX object core/CMakeFiles/core.dir/FusionDecode.cpp.o
[ 20%] Building CXX object core/CMakeFiles/core.dir/Core.cpp.o
[ 22%] Building CXX object core/CMakeFiles/core.dir/SimpleBranchPred.cpp.o
[ 23%] Building CXX object core/CMakeFiles/core.dir/Fetch.cpp.o
[ 25%] Building CXX object core/CMakeFiles/core.dir/Decode.cpp.o
[ 27%] Building CXX object core/CMakeFiles/core.dir/VectorUopGenerator.cpp.o
[ 28%] Building CXX object core/CMakeFiles/core.dir/Rename.cpp.o
[ 30%] Building CXX object core/CMakeFiles/core.dir/Dispatch.cpp.o
[ 32%] Building CXX object core/CMakeFiles/core.dir/Dispatcher.cpp.o
[ 35%] Building CXX object core/CMakeFiles/core.dir/DCache.cpp.o
[ 35%] Building CXX object core/CMakeFiles/core.dir/Execute.cpp.o
[ 37%] Building CXX object core/CMakeFiles/core.dir/ExecutePipe.cpp.o
[ 38%] Building CXX object core/CMakeFiles/core.dir/Inst.cpp.o
[ 40%] Building CXX object core/CMakeFiles/core.dir/InstArchInfo.cpp.o
[ 44%] Building CXX object core/CMakeFiles/core.dir/LSU.cpp.o
[ 44%] Building CXX object core/CMakeFiles/core.dir/InstGenerator.cpp.o
[ 45%] Building CXX object core/CMakeFiles/core.dir/InstGroup.cpp.o
[ 47%] Building CXX object core/CMakeFiles/core.dir/IssueQueue.cpp.o
[ 50%] Building CXX object core/CMakeFiles/core.dir/Preloader.cpp.o
[ 52%] Building CXX object core/CMakeFiles/core.dir/MMU.cpp.o
[ 54%] Building CXX object core/CMakeFiles/core.dir/ROB.cpp.o
[ 54%] Building CXX object core/CMakeFiles/core.dir/CPU.cpp.o
[ 55%] Building CXX object core/CMakeFiles/core.dir/MavisUnit.cpp.o
[ 59%] Building CXX object core/CMakeFiles/core.dir/CPUTopology.cpp.o
[ 59%] Building CXX object core/CMakeFiles/core.dir/CPUFactory.cpp.o
[ 61%] Building CXX object stf_lib/lib/CMakeFiles/stf.dir/stf_protocol_types.cpp.o
In file included from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_ifstream.hpp:14,
                 from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_factory.hpp:11,
                 from /home/cc/riscv-perf-model/stf_lib/lib/stf_protocol_types.cpp:1:
/home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp: In instantiation of 'void stf::defaultProtocolFieldFormatter(std::ostream&, const char*, const Value&) [with Value = stf::SerializableVector<unsigned char, short unsigned int>; std::ostream = std::basic_ostream<char>]':
/home/cc/riscv-perf-model/stf_lib/stf-inc/protocols/tilelink.hpp:27:13:   required from here
/home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp:261:32: error: no matching function for call to 'stf::format_utils::formatHex(std::ostream&, const stf::SerializableVector<unsigned char, short unsigned int>&)'
  261 |         format_utils::formatHex(os, data);
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp:14,
                 from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_ifstream.hpp:14,
                 from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_factory.hpp:11,
                 from /home/cc/riscv-perf-model/stf_lib/lib/stf_protocol_types.cpp:1:
/home/cc/riscv-perf-model/stf_lib/stf-inc/format_utils.hpp:232:13: note: candidate: 'template<class OStream, class T> static std::enable_if_t<is_integral_v<T> > stf::format_utils::formatHex(OStream&&, T, int, char)'
  232 |             formatHex(OStream&& os, const T val, const int width = numHexDigits<T>(), const char pad_char = '0') {
      |             ^~~~~~~~~
/home/cc/riscv-perf-model/stf_lib/stf-inc/format_utils.hpp:232:13: note:   template argument deduction/substitution failed:
In file included from /home/cc/miniconda3/envs/riscv_perf_model/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/move.h:57,
                 from /home/cc/miniconda3/envs/riscv_perf_model/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_pair.h:59,
                 from /home/cc/miniconda3/envs/riscv_perf_model/x86_64-conda-linux-gnu/include/c++/10.4.0/utility:70,
                 from /home/cc/miniconda3/envs/riscv_perf_model/x86_64-conda-linux-gnu/include/c++/10.4.0/array:38,
                 from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_factory.hpp:4,
                 from /home/cc/riscv-perf-model/stf_lib/lib/stf_protocol_types.cpp:1:
/home/cc/miniconda3/envs/riscv_perf_model/x86_64-conda-linux-gnu/include/c++/10.4.0/type_traits: In substitution of 'template<bool _Cond, class _Tp> using enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/home/cc/riscv-perf-model/stf_lib/stf-inc/format_utils.hpp:232:13:   required by substitution of 'template<class OStream, class T> static std::enable_if_t<is_integral_v<T> > stf::format_utils::formatHex(OStream&&, T, int, char) [with OStream = std::basic_ostream<char>&; T = stf::SerializableVector<unsigned char, short unsigned int>]'
/home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp:261:32:   required from 'void stf::defaultProtocolFieldFormatter(std::ostream&, const char*, const Value&) [with Value = stf::SerializableVector<unsigned char, short unsigned int>; std::ostream = std::basic_ostream<char>]'
/home/cc/riscv-perf-model/stf_lib/stf-inc/protocols/tilelink.hpp:27:13:   required from here
/home/cc/miniconda3/envs/riscv_perf_model/x86_64-conda-linux-gnu/include/c++/10.4.0/type_traits:2554:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
 2554 |     using enable_if_t = typename enable_if<_Cond, _Tp>::type;
      |           ^~~~~~~~~~~
In file included from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp:14,
                 from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_ifstream.hpp:14,
                 from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_factory.hpp:11,
                 from /home/cc/riscv-perf-model/stf_lib/lib/stf_protocol_types.cpp:1:
/home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp: In instantiation of 'void stf::defaultProtocolFieldFormatter(std::ostream&, const char*, const Value&) [with Value = stf::SerializableVector<unsigned char, short unsigned int>; std::ostream = std::basic_ostream<char>]':
/home/cc/riscv-perf-model/stf_lib/stf-inc/protocols/tilelink.hpp:27:13:   required from here
/home/cc/riscv-perf-model/stf_lib/stf-inc/format_utils.hpp:261:32: note: candidate: 'template<class OStream> static void stf::format_utils::formatHex(OStream&&, uint8_t, int, char)'
  261 |             static inline void formatHex(OStream&& os,
      |                                ^~~~~~~~~
/home/cc/riscv-perf-model/stf_lib/stf-inc/format_utils.hpp:261:32: note:   template argument deduction/substitution failed:
In file included from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_ifstream.hpp:14,
                 from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_factory.hpp:11,
                 from /home/cc/riscv-perf-model/stf_lib/lib/stf_protocol_types.cpp:1:
/home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp:261:32: note:   cannot convert 'data' (type 'const stf::SerializableVector<unsigned char, short unsigned int>') to type 'uint8_t' {aka 'unsigned char'}
  261 |         format_utils::formatHex(os, data);
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp: In instantiation of 'void stf::defaultProtocolFieldFormatter(std::ostream&, const char*, const Value&) [with Value = stf::SerializablePackedBitVector<unsigned char, short unsigned int>; std::ostream = std::basic_ostream<char>]':
/home/cc/riscv-perf-model/stf_lib/stf-inc/protocols/tilelink.hpp:28:13:   required from here
/home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp:261:32: error: no matching function for call to 'stf::format_utils::formatHex(std::ostream&, const stf::SerializablePackedBitVector<unsigned char, short unsigned int>&)'
In file included from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp:14,
                 from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_ifstream.hpp:14,
                 from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_factory.hpp:11,
                 from /home/cc/riscv-perf-model/stf_lib/lib/stf_protocol_types.cpp:1:
/home/cc/riscv-perf-model/stf_lib/stf-inc/format_utils.hpp:232:13: note: candidate: 'template<class OStream, class T> static std::enable_if_t<is_integral_v<T> > stf::format_utils::formatHex(OStream&&, T, int, char)'
  232 |             formatHex(OStream&& os, const T val, const int width = numHexDigits<T>(), const char pad_char = '0') {
      |             ^~~~~~~~~
/home/cc/riscv-perf-model/stf_lib/stf-inc/format_utils.hpp:232:13: note:   template argument deduction/substitution failed:
/home/cc/riscv-perf-model/stf_lib/stf-inc/format_utils.hpp:261:32: note: candidate: 'template<class OStream> static void stf::format_utils::formatHex(OStream&&, uint8_t, int, char)'
  261 |             static inline void formatHex(OStream&& os,
      |                                ^~~~~~~~~
/home/cc/riscv-perf-model/stf_lib/stf-inc/format_utils.hpp:261:32: note:   template argument deduction/substitution failed:
In file included from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_ifstream.hpp:14,
                 from /home/cc/riscv-perf-model/stf_lib/stf-inc/stf_factory.hpp:11,
                 from /home/cc/riscv-perf-model/stf_lib/lib/stf_protocol_types.cpp:1:
/home/cc/riscv-perf-model/stf_lib/stf-inc/stf_protocol_fields.hpp:261:32: note:   cannot convert 'data' (type 'const stf::SerializablePackedBitVector<unsigned char, short unsigned int>') to type 'uint8_t' {aka 'unsigned char'}
  261 |         format_utils::formatHex(os, data);
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
cc1plus: note: unrecognized command-line option '-Wno-gnu-zero-variadic-macro-arguments' may have been intended to silence earlier diagnostics
make[2]: *** [stf_lib/lib/CMakeFiles/stf.dir/build.make:174: stf_lib/lib/CMakeFiles/stf.dir/stf_protocol_types.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:682: stf_lib/lib/CMakeFiles/stf.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 62%] Linking CXX static library libcore.a
[ 62%] Built target core
make: *** [Makefile:91: all] Error 2
```

This is the error when I use the conda environment. And its related with `stf` dep

Managing the dependencies manually and with the distro gcc version it works.


@klingaard, thank you. I'll checkout the condor fork
Filed an issue with STF lib: https://github.com/sparcians/stf_lib/issues/39
Might need to know the compiler version, etc if you can supply that.
re: miniconda version

We use this version in production: py311_23.9.0-0

We are testing this version: py312_24.3.0-0, this seems to work, but we have not moved into main yet.

We ran into trouble with these:
"Issues testing against Conda 24.5.0 Python 3.12.4 released Jun 26, 2024."

Could be specific to us or could be a general issue.
 

Fix patch:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09e6c25b..5280e24e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,7 @@ include_directories(${SPARTA_INCLUDE_DIRS})
 # Set up STF library
 set (STF_LIB_BASE ${PROJECT_SOURCE_DIR}/stf_lib)
 set (DISABLE_STF_DOXYGEN ON)
+set (DISABLE_STF_TESTS ON)
 
 if (CMAKE_BUILD_TYPE MATCHES "^[Rr]elease")
   set (FULL_LTO true)
diff --git a/stf_lib b/stf_lib
index 69d48b1b..b874cc0c 160000
--- a/stf_lib
+++ b/stf_lib
@@ -1,1 +1,1 @@
-Subproject commit 69d48b1bab14a410c859aa3591b4eb175323ec98
+Subproject commit b874cc0c8dc6a7e95fe00c2f9cd8e4504270d395


Test patch: