rapidstream-org / rapidstream-tapa

RapidStream TAPA compiles task-parallel HLS program into high-frequency FPGA accelerators.
https://tapa.rtfd.io
MIT License
155 stars 32 forks source link

MS demangle errors while building TAPA #123

Closed vkomenda closed 1 month ago

vkomenda commented 1 year ago

How to bypass compilation of MicrosoftDemangle.cpp? I'm getting those errors again:

[  0%] Building CXX object _deps/llvm-build/lib/Demangle/CMakeFiles/LLVMDemangle.dir/MicrosoftDemangle.cpp.o
In file included from /home/vk/src/tapa/tapa/build/_deps/llvm-src/llvm/include/llvm/Demangle/MicrosoftDemangle.h:14,
                 from /home/vk/src/tapa/tapa/build/_deps/llvm-src/llvm/lib/Demangle/MicrosoftDemangle.cpp:17:
/home/vk/src/tapa/tapa/build/_deps/llvm-src/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h:14:17: error: found ‘:’ in nested-name-specifier, expected ‘::’
   14 | enum Qualifiers : uint8_t {
      |                 ^
      |                 ::
/home/vk/src/tapa/tapa/build/_deps/llvm-src/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h:14:6: error: ‘Qualifiers’ has not been declared
   14 | enum Qualifiers : uint8_t {
      |      ^~~~~~~~~~
...
Blaok commented 1 year ago

I suspect this is the same issue as https://github.com/facebook/hermes/issues/261; you need to add #include <cstdint> to the llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h file.

vkomenda commented 1 year ago

Is it possible to upgrade the LLVM dependency? It's really old. Including cstdint doesn't fix all errors.

tapa/build/_deps/llvm-src/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h:241:8: error: ‘string’ in namespace ‘std’ does not name a type
  241 |   std::string toString(OutputFlags Flags = OF_Default) const;
      |        ^~~~~~

tapa/build/_deps/llvm-src/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp:117:13: error: no declaration matches ‘std::string llvm::ms_demangle::Node::toString(llvm::ms_demangle::OutputFlags) const’
  117 | std::string Node::toString(OutputFlags Flags) const {
      |             ^~~~
vkomenda commented 1 year ago

I tried LLVM 11 and 15. I think either can work. I'm only getting undefined references to Google logging. Not sure how to fix that right now.

Blaok commented 1 year ago

Is it possible to upgrade the LLVM dependency? It's really old. Including cstdint doesn't fix all errors.

tapa/build/_deps/llvm-src/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h:241:8: error: ‘string’ in namespace ‘std’ does not name a type
  241 |   std::string toString(OutputFlags Flags = OF_Default) const;
      |        ^~~~~~

tapa/build/_deps/llvm-src/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp:117:13: error: no declaration matches ‘std::string llvm::ms_demangle::Node::toString(llvm::ms_demangle::OutputFlags) const’
  117 | std::string Node::toString(OutputFlags Flags) const {
      |             ^~~~

Did you try #include <string>?

I tried LLVM 11 and 15. I think either can work. I'm only getting undefined references to Google logging. Not sure how to fix that right now.

I'd be happy to merge if you can do another PR😁

dotkrnl commented 1 month ago

LLVM is now compiled using reproducible toolchains with Bazel.