llvm-sys - 没有找到可用的系统级 LLVM

llvm-sys - Didn't find usable system-wide LLVM

我正在尝试学习 LLVM 以使用 Rust 制作编程语言。我正在使用环绕 LLVM API.

llvm-sys 板条箱

我已经安装了 LLVM:LLVM-8.0.0-win64

我在 cargo.toml

中的依赖项
[dependencies]
llvm-sys = "80.1.1"

当我 运行 cargo run 我得到以下错误,

    Updating crates.io index
   Compiling memchr v2.2.1
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.6.12
   Compiling semver-parser v0.7.0
   Compiling libc v0.2.65
   Compiling cc v1.0.47
   Compiling thread_local v0.3.6
   Compiling semver v0.9.0
   Compiling aho-corasick v0.7.6
   Compiling regex v1.3.1
   Compiling llvm-sys v80.1.1
error: failed to run custom build command for `llvm-sys v80.1.1`

Caused by:
  process didn't exit successfully: `C:\Users\Name\Desktop\Carbon\carbon-lang\target\debug\build\llvm-sys-ed5d351b1ae6a41b\build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=LLVM_SYS_80_PREFIX
cargo:rerun-if-env-changed=LLVM_SYS_80_IGNORE_BLACKLIST
cargo:rerun-if-env-changed=LLVM_SYS_80_STRICT_VERSIONING
cargo:rerun-if-env-changed=LLVM_SYS_80_NO_CLEAN_CFLAGS
cargo:rerun-if-env-changed=LLVM_SYS_80_USE_DEBUG_MSVCRT
cargo:rerun-if-env-changed=LLVM_SYS_80_FFI_WORKAROUND
Didn't find usable system-wide LLVM.

--- stderr
thread 'main' panicked at 'Failed to execute "C:\Program Files\LLVM\bin\llvm-config": Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', src\libcore\result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

但我已将 LLVM_SYS_80_PREFIX 设置为 C:\Program Files\LLVM,这是 bin 文件夹所在的位置。

llvm-config 文件是否需要单独安装?我到处都找不到它。

仅供参考:我在 Windows 10

感谢您的帮助!

LLVM 没有附带名为 llvm-config.exe 的组件,但我不确定如何绕过。

llvm-config 是一个开发人员端工具,它不随二进制文件一起提供。您需要从源构建 LLVM。