Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Building the project #285

Closed
philipp-strack opened this issue Oct 3, 2023 · 6 comments
Closed

Error Building the project #285

philipp-strack opened this issue Oct 3, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@philipp-strack
Copy link

Hello,

when trying to build the project using ./configure && make I get the following error:

/webr/tools/flang/f18-llvm-project/llvm/include/llvm/Support/Signals.h:119:8: error: variable or field ‘CleanupOnSignal’ declared void
  119 |   void CleanupOnSignal(uintptr_t Context);
      |        ^~~~~~~~~~~~~~~
/webr/tools/flang/f18-llvm-project/llvm/include/llvm/Support/Signals.h:119:24: error: ‘uintptr_t’ was not declared in this scope
  119 |   void CleanupOnSignal(uintptr_t Context);
      |                        ^~~~~~~~~
/webr/tools/flang/f18-llvm-project/llvm/include/llvm/Support/Signals.h:18:1: note: ‘uintptr_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   17 | #include <string>
  +++ |+#include <cstdint>
   18 | 
[  8%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Threading.cpp.o
[  8%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Valgrind.cpp.o
[  8%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Watchdog.cpp.o
In file included from /webr/tools/flang/f18-llvm-project/llvm/lib/Support/Signals.cpp:251:
/webr/tools/flang/f18-llvm-project/llvm/lib/Support/Unix/Signals.inc:348:44: error: ‘void llvm::sys::CleanupOnSignal(uintptr_t)’ should have been declared inside ‘llvm::sys’

I on Ubuntu 32.10 with

cmake v3.27.6
node v18.13.0
gperf v3.1

Do you know how to resolve this error? Thanks a lot for your help!

@georgestagg
Copy link
Member

georgestagg commented Oct 5, 2023

This is an issue in building our patched version of LLVM flang, so I don't know too much about the heavy details.

Can you double check your version of Ubuntu for me, and let me know which version of GCC or clang that you have installed and are building with?

@georgestagg
Copy link
Member

(Apologies for the accidental close...)

@philipp-strack
Copy link
Author

Thank you!

ubuntu v23.10
gcc v13.2.0

@philipp-strack
Copy link
Author

please let me know if any other information would be helpful.

@georgestagg
Copy link
Member

It looks like this is due to an issue compiling LLVM with GCC 13. See, for example, JuliaLang/julia#49581. The thread includes a fix, which seems to work.

Edit the file: webr/tools/flang/f18-llvm-project/llvm/include/llvm/Support/Signals.h to add the following line near the top of the file

@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_SIGNALS_H
 #define LLVM_SUPPORT_SIGNALS_H
 
+#include <cstdint>
 #include <string>
 
 namespace llvm {

Then run make in the webr directory again.

I'll try and get this change cherry-picked into our patched LLVM fork.

@georgestagg georgestagg added the bug Something isn't working label Oct 26, 2023
@georgestagg
Copy link
Member

Recent updates to the version of LLVM Flang that webR builds means that the patched source at https://github.com/r-wasm/llvm-project now includes the upstream commit that adds #include <cstdint> to the above file. So, webR should now build OK on 23.10.

Let me know if you still have issues and I'll reopen this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants