Skip to content

Commit b534b2e

Browse files
committed
fix macos build issues by specifying enzyme lib dir
1 parent 3c13efb commit b534b2e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,8 +1092,11 @@ pub fn rustc_cargo(
10921092

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.
1095-
// FIXME(ZuseZ4): Get the LLVM version number automatically instead of hardcoding it.
10961095
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+
// FIXME(ZuseZ4): Get the LLVM version number automatically instead of hardcoding it.
10971100
cargo.rustflag("-l").rustflag("Enzyme-19");
10981101
}
10991102

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)