Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

cargo-bpf: compilation error #342

@Banyc

Description

@Banyc

I was following the instructions of https://github.com/foniod/redbpf/blob/main/README.md.

I first installed llvm as README.md said at section On Ubuntu 20.04 LTS:

$ llvm-config-13 --version | grep 13
13.0.1

But after running cargo install cargo-bpf, the compilation throws errors:

   Compiling llvm-sys v120.2.4
error: No suitable version of LLVM was found system-wide or pointed
              to by LLVM_SYS_120_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/USERNAME/.cargo/registry/src/github.com-1ecc6299db9ec823/llvm-sys-120.2.4/src/lib.rs:486:1
    |
486 | / std::compile_error!(concat!(
487 | |     "No suitable version of LLVM was found system-wide or pointed
488 | |        to by LLVM_SYS_",
489 | |     env!("CARGO_PKG_VERSION_MAJOR"),
...   |
496 | |        llvmenv: https://crates.io/crates/llvmenv"
497 | | ));
    | |__^

error: could not compile `llvm-sys` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-bpf v2.3.0`, intermediate artifacts can be found at `/tmp/cargo-install4oXpIf`

rustc version: rustc 1.63.0 (4b91a6ea7 2022-08-08)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions