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

cargo install c2rust failed: Could not find a configuration file for package "LLVM" that exactly matches requested version "16.0.6". #1059

Open
tjyang opened this issue Jan 13, 2024 · 2 comments

Comments

@tjyang
Copy link

tjyang commented Jan 13, 2024

Hi
please advise

  • os and rust info
[me@rocky9t01a ~]$ rpm -qa |grep llvm14
llvm14-libs-14.0.5-6.el9.x86_64
llvm14-14.0.5-6.el9.x86_64
llvm14-static-14.0.5-6.el9.x86_64
llvm14-devel-14.0.5-6.el9.x86_64
[me@rocky9t01a ~]$

-- error message

 --- stderr
  CMake Error at /usr/lib64/cmake/clang/ClangConfig.cmake:10 (find_package):
    Could not find a configuration file for package "LLVM" that exactly matches
    requested version "16.0.6".

  • cargo install c2rust full detail log

[me@rocky9t01a ~]$ cargo install c2rust
Updating crates.io index
Installing c2rust v0.18.0
Updating crates.io index
Compiling proc-macro2 v1.0.76
Compiling unicode-ident v1.0.12
Compiling libc v0.2.152
Compiling syn v1.0.109
Compiling rustix v0.38.30
Compiling memchr v2.7.1
Compiling serde v1.0.195
Compiling thiserror v1.0.56
Compiling glob v0.3.1
Compiling linux-raw-sys v0.4.12
Compiling bitflags v2.4.1
Compiling aho-corasick v1.1.2
Compiling clang-sys v1.7.0
Compiling prettyplease v0.2.16
Compiling quote v1.0.35
Compiling regex-syntax v0.8.2
Compiling syn v2.0.48
Compiling cc v1.0.83
Compiling version_check v0.9.4
Compiling log v0.4.20
Compiling cfg-if v1.0.0
Compiling minimal-lexical v0.2.1
Compiling regex-automata v0.4.3
Compiling nom v7.1.3
Compiling libloading v0.8.1
Compiling either v1.9.0
Compiling bindgen v0.65.1
Compiling home v0.5.9
Compiling ucd-trie v0.1.6
Compiling cexpr v0.6.0
Compiling which v4.4.2
Compiling regex v1.10.2
Compiling is-terminal v0.4.10
Compiling proc-macro-error-attr v1.0.4
Compiling rustc-hash v1.1.0
Compiling once_cell v1.19.0
Compiling termcolor v1.4.1
Compiling print_bytes v1.2.0
Compiling autocfg v1.1.0
Compiling bitflags v1.3.2
Compiling lazy_static v1.4.0
Compiling peeking_take_while v0.1.2
Compiling lazycell v1.3.0
Compiling shlex v1.2.0
Compiling humantime v2.1.0
Compiling indexmap v1.9.3
Compiling env_logger v0.10.1
Compiling thiserror-impl v1.0.56
Compiling c2rust-build-paths v0.18.0
Compiling backtrace v0.3.69
Compiling cmake v0.1.50
Compiling proc-macro-error v1.0.4
Compiling adler v1.0.2
Compiling heck v0.4.1
Compiling rustversion v1.0.14
Compiling time-core v0.1.0
Compiling prettyplease v0.1.25
Compiling serde_json v1.0.111
Compiling failure_derive v0.1.8
Compiling gimli v0.28.1
Compiling pest v2.7.6
Compiling unicode-xid v0.2.4
Compiling synstructure v0.12.6
Compiling pest_meta v2.7.6
Compiling pest_generator v2.7.6
Compiling addr2line v0.21.0
Compiling time-macros v0.2.6
Compiling miniz_oxide v0.7.1
Compiling serde_bytes v0.11.14
Compiling object v0.32.2
Compiling hashbrown v0.12.3
Compiling itoa v1.0.10
Compiling ryu v1.0.16
Compiling rustc-demangle v0.1.23
Compiling half v1.8.2
Compiling c2rust-ast-exporter v0.18.0
Compiling serde_cbor v0.11.2
Compiling time v0.3.18
Compiling pest_derive v2.7.6
error: failed to run custom build command for c2rust-ast-exporter v0.18.0

Caused by:
process didn't exit successfully: /tmp/cargo-installIMjScu/release/build/c2rust-ast-exporter-16554e8dea17429c/build-script-build (exit status: 101)
--- stdout
CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
HOST_CMAKE_TOOLCHAIN_FILE = None
CMAKE_TOOLCHAIN_FILE = None
CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
HOST_CMAKE_GENERATOR = None
CMAKE_GENERATOR = None
CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
HOST_CMAKE_PREFIX_PATH = None
CMAKE_PREFIX_PATH = None
CMAKE_x86_64-unknown-linux-gnu = None
CMAKE_x86_64_unknown_linux_gnu = None
HOST_CMAKE = None
CMAKE = None
running: cd "/tmp/cargo-installIMjScu/release/build/c2rust-ast-exporter-124aff5e9367e267/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/home/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src" "-DLLVM_DIR=/usr/lib64/llvm14/lib/cmake/llvm" "-DClang_DIR=/usr/lib64/llvm14/lib/cmake/clang" "-DCMAKE_INSTALL_PREFIX=/tmp/cargo-installIMjScu/release/build/c2rust-ast-exporter-124aff5e9367e267/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
-- The C compiler identification is GNU 11.4.1
-- The CXX compiler identification is GNU 11.4.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: /usr/lib64/libffi.so
-- Performing Test Terminfo_LINKABLE
-- Performing Test Terminfo_LINKABLE - Success
-- Found Terminfo: /usr/lib64/libtinfo.so
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Configuring incomplete, errors occurred!
See also "/tmp/cargo-installIMjScu/release/build/c2rust-ast-exporter-124aff5e9367e267/out/build/CMakeFiles/CMakeOutput.log".

--- stderr
CMake Error at /usr/lib64/cmake/clang/ClangConfig.cmake:10 (find_package):
Could not find a configuration file for package "LLVM" that exactly matches
requested version "16.0.6".

The following configuration files were considered but not accepted:

  /usr/lib64/llvm14/lib/cmake/llvm/LLVMConfig.cmake, version: 14.0.5

Call Stack (most recent call first):
CMakeLists.txt:62 (find_package)

thread 'main' panicked at /home/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

command did not execute successfully, got: exit status: 1

build script failed, must exit now
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile c2rust v0.18.0, intermediate artifacts can be found at /tmp/cargo-installIMjScu.
To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.
[me@rocky9t01a ~]$

@thedataking
Copy link
Contributor

thedataking commented Mar 13, 2024

Can you try building the c2rust version from this repo instead of the one on crates.io to check if the issue still happens on the master branch? It looks like there may be a problem picking up the cmake files for the version of LLVM that your host OS provides.

@tjyang
Copy link
Author

tjyang commented Mar 13, 2024

Hi @thedataking, Thanks for the response.

latest rocky9.3 only have llvm14.

[me@rocky9t01a c2rust]$ cargo build
<snipped
  -- Performing Test HAVE_FFI_CALL - Success
  -- Found FFI: /usr/lib64/libffi.so
  -- Performing Test Terminfo_LINKABLE
  -- Performing Test Terminfo_LINKABLE - Success
  -- Found Terminfo: /usr/lib64/libtinfo.so
  -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
  -- Configuring incomplete, errors occurred!
  See also "/home/me/github/learnrust/c2rust/target/debug/build/c2rust-ast-exporter-8e5ec6fbe6f94814/out/build/CMakeFiles/CMakeOutput.log".

  --- stderr
  CMake Error at /usr/lib64/cmake/clang/ClangConfig.cmake:10 (find_package):
    Could not find a configuration file for package "LLVM" that exactly matches
    requested version "16.0.6".

    The following configuration files were considered but not accepted:

      /usr/lib64/llvm14/lib/cmake/llvm/LLVMConfig.cmake, version: 14.0.5

  Call Stack (most recent call first):
    CMakeLists.txt:62 (find_package)


  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.50/src/lib.rs:1098:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
[me@rocky9t01a c2rust]$ git log -1
commit 21907d84a26490550e470eddbdf5f7d38ffebfe5 (HEAD -> master, origin/master, origin/HEAD)
Merge: 689653c0 209f4214
Author: Khyber Sen <kkysen@gmail.com>
Date:   Mon Dec 11 15:41:19 2023 -0500

    Fix nix build (#1047)

    * fix #1045
[me@rocky9t01a c2rust]$

[me@rocky9t01a c2rust]$ sudo dnf search llvm1
Last metadata expiration check: 3:16:18 ago on Wed 13 Mar 2024 02:09:56 AM CDT.
======================================== Name Matched: llvm1 ========================================
llvm11.x86_64 : The Low Level Virtual Machine
llvm11-devel.x86_64 : Libraries and header files for LLVM
llvm11-doc.noarch : Documentation for LLVM
llvm11-libs.x86_64 : LLVM shared libraries
llvm11-static.x86_64 : LLVM static libraries
llvm12.x86_64 : The Low Level Virtual Machine
llvm12-devel.x86_64 : Libraries and header files for LLVM
llvm12-doc.noarch : Documentation for LLVM
llvm12-libs.x86_64 : LLVM shared libraries
llvm12-static.x86_64 : LLVM static libraries
llvm13.x86_64 : The Low Level Virtual Machine
llvm13-devel.x86_64 : Libraries and header files for LLVM
llvm13-doc.noarch : Documentation for LLVM
llvm13-libs.x86_64 : LLVM shared libraries
llvm13-static.x86_64 : LLVM static libraries
llvm14.x86_64 : The Low Level Virtual Machine
llvm14-devel.x86_64 : Libraries and header files for LLVM
llvm14-doc.noarch : Documentation for LLVM
llvm14-libs.x86_64 : LLVM shared libraries
llvm14-static.x86_64 : LLVM static libraries
[me@rocky9t01a c2rust]$


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants