Skip to content

autodiff: fix sysroot candidates in libEnzyme not found error - #163028

Open
sgasho wants to merge 1 commit into
rust-lang:mainfrom
sgasho:enzyme-wrapper-cleanup
Open

sgasho wants to merge 1 commit into
rust-lang:mainfrom
sgasho:enzyme-wrapper-cleanup

Conversation

@sgasho

@sgasho sgasho commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

fix: #160335 (comment)

Before

RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23` folder in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib
    |
    = note: it will be distributed via rustup in the future

After: points out the right candidate dir

RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run --release
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23.so` in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib
    |
    = note: it will be distributed via rustup in the future

I also verified that sample autodiff code ran successfully using local build, without breaking anything.

r? @ZuseZ4

@rustbot

rustbot commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs

cc @ZuseZ4

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. F-autodiff `#![feature(autodiff)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. F-autodiff `#![feature(autodiff)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants