1
1
using BinaryBuilder, Pkg
2
+ using Base. BinaryPlatforms
3
+
4
+ include (" ../../fancy_toys.jl" )
2
5
3
6
name = " Enzyme"
4
7
repo = " https://github.com/wsmoses/Enzyme.git"
@@ -9,10 +12,6 @@ version = VersionNumber(split(auto_version, "/")[end])
9
12
# Collection of sources required to build attr
10
13
sources = [GitSource (repo, " %ENZYME_HASH%" )]
11
14
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
-
16
15
# Bash recipe for building across all platforms
17
16
script = raw """
18
17
cd Enzyme
@@ -36,17 +35,43 @@ cmake -B build -S enzyme -GNinja ${CMAKE_FLAGS[@]}
36
35
ninja -C build -j ${nproc} install
37
36
"""
38
37
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
+
43
68
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)
48
71
72
+ any (should_build_platform .(triplet .(platforms))) || continue
49
73
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