forked from j2kun/mlir-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextensions.bzl
More file actions
44 lines (38 loc) · 1.55 KB
/
extensions.bzl
File metadata and controls
44 lines (38 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""Module extensions for MLIR Tutorial dependencies."""
load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def _mlir_tutorial_deps_impl(module_ctx):
"""Implementation of the mlir_tutorial_deps module extension."""
# Download LLVM/MLIR using a git repository
new_git_repository(
name = "llvm-raw",
build_file_content = "# empty",
commit = "d9190f8141661bd6120dea61d28ae8940fd775d0",
init_submodules = False,
remote = "https://github.com/llvm/llvm-project.git",
)
# Optional LLVM dependencies for performance
maybe(
http_archive,
name = "llvm_zstd",
build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
strip_prefix = "zstd-1.5.2",
urls = [
"https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz",
],
)
maybe(
http_archive,
name = "llvm_zlib",
build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD",
sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731",
strip_prefix = "zlib-ng-2.0.7",
urls = [
"https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip",
],
)
mlir_tutorial_deps = module_extension(
implementation = _mlir_tutorial_deps_impl,
)