Skip to content

Commit 8fe2ec3

Browse files
committed
add enzyme distribution step
1 parent 7f69523 commit 8fe2ec3

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,3 +2586,47 @@ impl Step for Gcc {
25862586
tarball.generate()
25872587
}
25882588
}
2589+
2590+
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
2591+
pub struct Enzyme {
2592+
pub target: TargetSelection,
2593+
}
2594+
2595+
impl Step for Enzyme {
2596+
type Output = GeneratedTarball;
2597+
const ONLY_HOSTS: bool = true;
2598+
2599+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
2600+
run.alias("enzyme")
2601+
}
2602+
2603+
fn make_run(run: RunConfig<'_>) {
2604+
run.builder.ensure(Enzyme { target: run.target });
2605+
}
2606+
2607+
fn run(self, builder: &Builder<'_>) -> Self::Output {
2608+
let tarball = Tarball::new(builder, "enzyme", &self.target.triple);
2609+
let output = builder.ensure(super::llvm::Enzyme { target: self.target });
2610+
tarball.add_file(
2611+
output.join("lib").join("libEnzyme-20.so"),
2612+
"lib",
2613+
FileType::NativeLibrary,
2614+
);
2615+
let cmake_dir = output.join("lib").join("cmake").join("Enzyme");
2616+
let cmake_files = [
2617+
"EnzymeConfig.cmake",
2618+
"EnzymeConfigVersion.cmake",
2619+
"EnzymeTargets-release.cmake",
2620+
"EnzymeTargets.cmake",
2621+
];
2622+
for file in &cmake_files {
2623+
tarball.add_file(
2624+
cmake_dir.join(file),
2625+
Path::new("lib").join("cmake").join("Enzyme"),
2626+
FileType::Regular,
2627+
);
2628+
}
2629+
2630+
tarball.generate()
2631+
}
2632+
}

src/bootstrap/src/core/builder/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,8 @@ impl<'a> Builder<'a> {
10841084
dist::PlainSourceTarball,
10851085
dist::BuildManifest,
10861086
dist::ReproducibleArtifacts,
1087-
dist::Gcc
1087+
dist::Gcc,
1088+
dist::Enzyme
10881089
),
10891090
Kind::Install => describe!(
10901091
install::Docs,

0 commit comments

Comments
 (0)