Skip to content

Commit bb80956

Browse files
committed
fix macos build issues by specifying enzyme lib dir
1 parent a03cc50 commit bb80956

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,10 @@ pub fn rustc_cargo(
10931093
// We want to link against registerEnzyme and in the future we want to use additional
10941094
// functionality from Enzyme core. For that we need to link against Enzyme.
10951095
if builder.config.llvm_enzyme {
1096+
let arch = builder.build.build;
1097+
let enzyme_dir = builder.build.out.join(arch).join("enzyme").join("lib");
1098+
cargo.rustflag("-L").rustflag(enzyme_dir.to_str().expect("Invalid path"));
1099+
10961100
let llvm_config = builder.llvm_config(builder.config.build).unwrap();
10971101
let llvm_version_major = llvm::get_llvm_version_major(builder, &llvm_config);
10981102
cargo.rustflag("-l").rustflag(&format!("Enzyme-{llvm_version_major}"));

tests/codegen/autodiff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -C opt-level=3 -Clto=fat
1+
//@ compile-flags: -Zautodiff=Enable -C opt-level=3 -Clto=fat
22
//@ no-prefer-dynamic
33
//@ needs-enzyme
44
#![feature(autodiff)]

0 commit comments

Comments
 (0)