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

llvm backend for android #4637

Open
tkkcc opened this issue May 6, 2024 · 1 comment
Open

llvm backend for android #4637

tkkcc opened this issue May 6, 2024 · 1 comment
Labels
❓ question I've a question!

Comments

@tkkcc
Copy link

tkkcc commented May 6, 2024

attempt to ship wasmer runtime in an android app, the demo code on doc work. when i switch to llvm compiler, llvm-sys fail to compile.

reproduce commit: https://github.com/tkkcc/GameBot/tree/369c821d6d880df7273b7355234b20dbd297c941

the following build error says to set LLVM_SYS_150_PREFIX, i wonder how to do next for android. or is it even possible.

Compiling llvm-sys v150.1.3
error: No suitable version of LLVM was found system-wide or pointed
              to by LLVM_SYS_150_PREFIX.
       
              Consider using `llvmenv` to compile an appropriate copy of LLVM, and
              refer to the llvm-sys documentation for more information.
       
              llvm-sys: https://crates.io/crates/llvm-sys
              llvmenv: https://crates.io/crates/llvmenv
   --> /home/bilabila/.cargo/registry/src/index.crates.io-6f17d22bba15001f/llvm-sys-150.1.3/src/lib.rs:489:1
    |
489 | / std::compile_error!(concat!(
490 | |     "No suitable version of LLVM was found system-wide or pointed
491 | |        to by LLVM_SYS_",
492 | |     env!("CARGO_PKG_VERSION_MAJOR"),
...   |
499 | |        llvmenv: https://crates.io/crates/llvmenv"
500 | | ));
    | |__^

error: could not compile `llvm-sys` (lib) due to 1 previous error
@tkkcc tkkcc added the ❓ question I've a question! label May 6, 2024
@syrusakbary
Copy link
Member

syrusakbary commented May 14, 2024

It shall be possible to include Wasmer + LLVM for Android, although we recommend on this case to use Cranelift or Singlepass as LLVM might be too heavy.

If you want to use LLVM compiler with Wasmer here, you'll need to set up the LLVM_SYS_150_PREFIX when compiling the crate, pointing to your local LLVM 15.

We'd recommend following some tutorials on how to use LLVM inside of Android such as:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ question I've a question!
Projects
None yet
Development

No branches or pull requests

2 participants