rust-lang / rust-lang/rust

std::autodiff should work with download-llvm

Open
#147,535 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug T-bootstrap
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Summary

The current build instructions for rustc with std::autodiff enabled are given here:
https://rustc-dev-guide.rust-lang.org/autodiff/installation.html#build-instructions
Especially

./configure --enable-llvm-link-shared --enable-llvm-plugins --enable-llvm-enzyme --release-channel=nightly --enable-llvm-assertions --enable-clang --enable-lld --enable-option-checking --enable-ninja --disable-docs

We can already drop the --enable-llvm-plugins, as well as --enable-llvm-assertions --enable-clang --enable-lld
They are for convenience, but not strictly needed.

Command used
./x build --stage 1 library
./x test --stage 1 tests/codegen-llvm/autodiff
./x test --stage 1 tests/pretty/autodiff
./x test --stage 1 tests/ui/autodiff
./x test --stage 1 tests/ui/feature-gates/feature-gate-autodiff.rs
Expected behaviour

It should build rustc and pass all autodiff tests

Actual behaviour

The last time I tested the build failed. Building Enzyme in bootstrap requires the path to LLVM, and that path is different when we build LLVM vs when we download it.
We should handle both cases.

Bootstrap configuration (bootstrap.toml)
<config>
Operating system
HEAD
Additional context
Build Log

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the autodiff build instructions in rustc-dev-guide/autodiff/installation.html and the bootstrap path used to build Enzyme. Reproduce with download-llvm using the listed ./x build and ./x test commands, then trace the LLVM path passed to Enzyme's CMake invocation. Done means rustc builds and all listed autodiff tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, rust
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.