Reputation: 21
I am trying to build a Rust program on Centos with kernel 6.20. When trying to compile a Rust file I keep getting the following error messages.
cargo build --manifest-path=atropos/Cargo.toml --release
Compiling proc-macro2 v1.0.56
Compiling unicode-ident v1.0.8
Compiling quote v1.0.26
Compiling libc v0.2.141
Compiling autocfg v1.1.0
Compiling version_check v0.9.4
Compiling syn v1.0.109
Compiling serde_derive v1.0.159
Compiling cc v1.0.79
Compiling bitflags v1.3.2
Compiling hashbrown v0.12.3
Compiling serde v1.0.159
Compiling pkg-config v0.3.26
Compiling memchr v2.5.0
Compiling toml_datetime v0.6.1
Compiling thiserror v1.0.40
Compiling winnow v0.4.1
Compiling once_cell v1.17.1
Compiling io-lifetimes v1.0.10
Compiling cfg-if v1.0.0
Compiling rustix v0.37.7
Compiling proc-macro-error-attr v1.0.4
Compiling proc-macro-error v1.0.4
Compiling indexmap v1.9.3
Compiling glob v0.3.1
Compiling heck v0.4.1
Compiling anyhow v1.0.70
Compiling memoffset v0.6.5
Compiling camino v1.1.4
Compiling linux-raw-sys v0.3.1
Compiling serde_json v1.0.95
Compiling clang-sys v1.6.1
Compiling semver v1.0.17
Compiling aho-corasick v0.7.20
Compiling syn v2.0.13
Compiling regex-syntax v0.6.29
Compiling itoa v1.0.6
Compiling log v0.4.17
Compiling libbpf-sys v1.1.1+v1.1.0
Compiling minimal-lexical v0.2.1
Compiling os_str_bytes v6.5.0
Compiling ryu v1.0.13
Compiling nom v7.1.3
Compiling toml_edit v0.19.8
Compiling clap_lex v0.2.4
error: failed to run custom build command for `clang-sys v1.6.1`
Caused by:
process didn't exit successfully: `/root/sched_ext/tools/sched_ext/atropos/target/release/build/clang-sys-eaa3a1b9c03ac901/build-script-build` (exit status: 101)
--- stderr
thread 'main' panicked at 'could not find any static libraries', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/clang-sys-1.6.1/build/static.rs:92:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
make: *** [Makefile:201: atropos] Error 101
When I run with RUST_BACKTRACE=1
environment variable to display a backtrace, I get the following information.
or: failed to run custom build command for `clang-sys v1.6.1`
Caused by:
process didn't exit successfully: `/root/sched_ext/tools/sched_ext/atropos/target/release/build/clang-sys-eaa3a1b9c03ac901/build-script-build` (exit status: 101)
--- stderr
thread 'main' panicked at 'could not find any static libraries', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/clang-sys-1.6.1/build/static.rs:92:9
stack backtrace:
0: std::panicking::begin_panic
1: build_script_build::static::find
2: build_script_build::static::link
3: build_script_build::main
4: core::ops::function::FnOnce::call_once
Why does this error occur and How do I fix this error? Thanks.
Upvotes: 2
Views: 3091
Reputation: 747
Had similar problem when working with crate
opencv, error:
Compiling clang-sys v1.6.1
The following warnings were emitted during compilation:
warning: could not execute `llvm-config` one or more times, if the LLVM_CONFIG_PATH environment variable is set to a full path to valid `llvm-config` executable it will be used to try to find an instance of `libclang` on your system: "couldn't execute `llvm-config --prefix` (path=llvm-config) (error: No such file or directory (os error 2))"
error: failed to run custom build command for `clang-sys v1.6.1`
I'm building on Ubuntu
machine so it was solved by installing: apt install libopencv-dev clang libclang-dev
Upvotes: 2