Skip to content

Commit 43638dc

Browse files
committed
Update build_tarballs.jl
1 parent d03aa0f commit 43638dc

File tree

2 files changed

+44
-19
lines changed

2 files changed

+44
-19
lines changed

.github/workflows/tagger.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ jobs:
3131
run: |
3232
cd ygg
3333
git rm -rf E/Enzyme
34-
mkdir -p E/Enzyme/Enzyme@11
34+
mkdir -p E/Enzyme/
3535
cd E/Enzyme
36-
cp ../../../enz/.packaging/build_tarballs.jl Enzyme@11/build_tarballs.jl
37-
sed "s~%ENZYME_VERSION%~${GITHUB_REF}~g" Enzyme@11/build_tarballs.jl -i
38-
sed "s~%ENZYME_HASH%~${GITHUB_SHA}~g" Enzyme@11/build_tarballs.jl -i
36+
cp ../../../enz/.packaging/build_tarballs.jl build_tarballs.jl
37+
sed "s~%ENZYME_VERSION%~${GITHUB_REF}~g" build_tarballs.jl -i
38+
sed "s~%ENZYME_HASH%~${GITHUB_SHA}~g" build_tarballs.jl -i
3939
git add Enzyme@11
4040
- name: Create Pull Request
4141
id: cpr

.packaging/build_tarballs.jl

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
using BinaryBuilder, Pkg
2+
using Base.BinaryPlatforms
3+
4+
include("../../fancy_toys.jl")
25

36
name = "Enzyme"
47
repo = "https://github.com/wsmoses/Enzyme.git"
@@ -9,10 +12,6 @@ version = VersionNumber(split(auto_version, "/")[end])
912
# Collection of sources required to build attr
1013
sources = [GitSource(repo, "%ENZYME_HASH%")]
1114

12-
# These are the platforms we will build for by default, unless further
13-
# platforms are passed in on the command line
14-
platforms = expand_cxxstring_abis(supported_platforms())
15-
1615
# Bash recipe for building across all platforms
1716
script = raw"""
1817
cd Enzyme
@@ -36,17 +35,43 @@ cmake -B build -S enzyme -GNinja ${CMAKE_FLAGS[@]}
3635
ninja -C build -j ${nproc} install
3736
"""
3837

39-
# The products that we will ensure are always built
40-
products = Product[
41-
LibraryProduct(["libEnzyme-11", "libEnzyme"], :libEnzyme),
42-
]
38+
function configure(julia_version, llvm_version)
39+
# These are the platforms we will build for by default, unless further
40+
# platforms are passed in on the command line
41+
platforms = expand_cxxstring_abis(supported_platforms())
42+
43+
foreach(platforms) do p
44+
BinaryPlatforms.add_tag!(p.tags, "julia_version", string(julia_version))
45+
end
46+
47+
# The products that we will ensure are always built
48+
products = Product[
49+
LibraryProduct(["libEnzyme-$(llvm_version.major)", "libEnzyme"], :libEnzyme),
50+
]
51+
52+
53+
dependencies = [
54+
BuildDependency(get_addable_spec("LLVM_full_jll", llvm_version))
55+
# Dependency(PackageSpec(name="libLLVM_jll", version=v"9.0.1")) is given through julia_version tag
56+
]
57+
58+
return platforms, products, dependencies
59+
end
60+
61+
# TODO: Don't require build-id on LLVM version
62+
supported = (
63+
(v"1.6", v"11.0.1+3"),
64+
(v"1.7", v"12.0.0+0"),
65+
(v"1.8", v"12.0.0+0"),
66+
)
67+
4368

44-
dependencies = [
45-
BuildDependency(PackageSpec(name="LLVM_full_jll", version=v"11.0.1")),
46-
# Dependency(PackageSpec(name="libLLVM_jll", version=v"9.0.1"))
47-
]
69+
for (julia_version, llvm_version) in supported
70+
platforms, products, dependencies = configure(julia_version, llvm_version)
4871

72+
any(should_build_platform.(triplet.(platforms))) || continue
4973

50-
# Build the tarballs.
51-
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
52-
preferred_gcc_version=v"8", julia_compat="1.6")
74+
# Build the tarballs.
75+
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
76+
preferred_gcc_version=v"8", julia_compat="1.6")
77+
end

0 commit comments

Comments
 (0)