onnx-mlir/onnxmlir.bzl

48 lines
1.8 KiB
Python

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",
)
def llvm_deps():
LLVM_COMMIT = "85763e0758fbd238c81f233c6f9510e81c7de177" # llvm 12
LLVM_BAZEL_TAG = "llvm-project-%s" % (LLVM_COMMIT,)
LLVM_BAZEL_SHA256 = "5d358075abc2db8192c138bdaa6ce74f2c59a0bde6d7d57813f3fc66d6b6da34"
if "llvm-bazel" not in native.existing_rules():
http_archive(
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),
)
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),
]
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,
)
def onnxmlir_deps():
llvm_deps()
third_party_deps()