onnx-mlir/onnxmlir.bzl

48 lines
1.8 KiB
Python
Raw Permalink Normal View History

2020-09-29 17:32:28 +08:00
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def clean_dep(dep):
return str(Label(dep))
def third_party_deps():
if "onnx" not in native.existing_rules():
new_git_repository(
name = "onnx",
build_file = "//third_party:onnx.BUILD",
commit = "553df22c67bee5f0fe6599cff60f1afc6748c635",
remote = "https://github.com/onnx/onnx",
)
2020-10-13 20:04:09 +08:00
def llvm_deps():
LLVM_COMMIT = "85763e0758fbd238c81f233c6f9510e81c7de177" # llvm 12
LLVM_BAZEL_TAG = "llvm-project-%s" % (LLVM_COMMIT,)
LLVM_BAZEL_SHA256 = "5d358075abc2db8192c138bdaa6ce74f2c59a0bde6d7d57813f3fc66d6b6da34"
2020-09-29 17:32:28 +08:00
2020-10-13 20:04:09 +08:00
if "llvm-bazel" not in native.existing_rules():
2020-09-29 17:32:28 +08:00
http_archive(
2020-10-13 20:04:09 +08:00
name = "llvm-bazel",
sha256 = LLVM_BAZEL_SHA256,
strip_prefix = "llvm-bazel-{tag}/llvm-bazel".format(tag = LLVM_BAZEL_TAG),
url = "https://github.com/google/llvm-bazel/archive/{tag}.tar.gz".format(tag = LLVM_BAZEL_TAG),
2020-09-29 17:32:28 +08:00
)
2020-10-13 20:04:09 +08:00
LLVM_SHA256 = "f33108ba4bc81c6704753838ee4d85ad87e195fda3df991c2b00f18872a9e2dd"
LLVM_SHA256 = ""
LLVM_URLS = [
# "https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
"https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
]
2020-09-29 17:32:28 +08:00
2020-10-13 20:04:09 +08:00
if "llvm-project-raw" not in native.existing_rules():
http_archive(
name = "llvm-project-raw",
build_file_content = "#empty",
sha256 = LLVM_SHA256,
strip_prefix = "llvm-project-" + LLVM_COMMIT,
urls = LLVM_URLS,
2020-09-29 17:32:28 +08:00
)
def onnxmlir_deps():
2020-10-13 20:04:09 +08:00
llvm_deps()
2020-09-29 17:32:28 +08:00
third_party_deps()