Skip to content

test failed to compile with llvm-7: No LLVM_SYS_70_PREFIX #419

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

Closed
huangjj27 opened this issue May 3, 2019 · 3 comments
Closed

test failed to compile with llvm-7: No LLVM_SYS_70_PREFIX #419

huangjj27 opened this issue May 3, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@huangjj27
Copy link

huangjj27 commented May 3, 2019

Describe the bug

make test on WSL(Ubuntu 18.04, with initial llvm6 removed and llvm-7 installed by apt) fails:

error: failed to run custom build command for `wasmer-llvm-backend v0.4.0 (/home/huangjj27/wasmer/lib/llvm-backend)`
process didn't exit successfully: `/home/huangjj27/wasmer/target/debug/build/wasmer-llvm-backend-3d1adc9289268860/build-script-build` (exit code: 101)
--- stdout
Didn't find usable system-wide LLVM.
No suitable version of LLVM was found system-wide or pointed
                  to by LLVM_SYS_70_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

--- stderr
thread 'main' panicked at 'Could not find a compatible version of LLVM', lib/llvm-backend/build.rs:83:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

what value should be set to LLVM_SYS_70_PREFIX?

Steps to reproduce

  1. remove preinstalled llvm: sudo apt remove llvm -y, and install llvm-7: sudo apt install llvm-7
  2. git clone [email protected]:wasmerio/wasmer.git to WSL
  3. cd wasmer
  4. make test

If applicable, add a link to a test case (as a zip file or link to a repository we can clone).

Expected behavior

it should pass compile and run the tests

Actual behavior

failed to compile test as shown

Additional context

related to #364

@huangjj27 huangjj27 added the bug Something isn't working label May 3, 2019
@huangjj27
Copy link
Author

huangjj27 commented May 3, 2019

And I found that the llvm-7 I installed has a config with commaned llvm-config-7

@penberg
Copy link
Contributor

penberg commented May 6, 2019

I see the same error on Fedora 30 if I install the llvm7.0 and llvm7.0-devel packages. The issue seems to be that Fedora 30 switched to LLVM 8 by default and renames llvm-config of older versions to something else:

mesonbuild/meson#5059

I managed to fix the discovery issue with the following patch:

diff --git a/lib/llvm-backend/build.rs b/lib/llvm-backend/build.rs
index ab59748b..bc8b7731 100644
--- a/lib/llvm-backend/build.rs
+++ b/lib/llvm-backend/build.rs
@@ -25,8 +25,8 @@ lazy_static! {
     static ref LLVM_CONFIG_BINARY_NAMES: Vec<String> = {
         vec![
             "llvm-config".into(),
-            // format!("llvm-config-{}", CRATE_VERSION.major),
-            // format!("llvm-config-{}.{}", CRATE_VERSION.major, CRATE_VERSION.minor),
+            "llvm-config-7".into(),
+            "llvm-config-7.0-64".into(),
         ]
     };

But I'm seeing some LLVM link errors on Inkwell so I guess someone who actually knows what they're doing should have a look at this.

@syrusakbary
Copy link
Member

We switched by default to use LLVM-8 so based on @penberg comments I believe that should fix the issue.

Please let us know if that's not the case.
Closing the issue :)

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

3 participants