onnx-mlir/WORKSPACE

178 lines
6.4 KiB
Python

workspace(name = "onnxmlir")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
load("//third_party:repo.bzl", "tf_http_archive")
# def clean_dep(dep):
# return str(Label(dep))
LLVM_COMMIT = "85763e0758fbd238c81f233c6f9510e81c7de177" # llvm 12
LLVM_COMMIT_xx = "91671e13efbc5dbd17b832d7973401350d0a6ee6" #
LLVM_BAZEL_TAG = "llvm-project-%s" % (LLVM_COMMIT,)
LLVM_BAZEL_SHA256 = "5d358075abc2db8192c138bdaa6ce74f2c59a0bde6d7d57813f3fc66d6b6da34"
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_xx),
# "https://github.com/llvm/llvm-project/archive/llvmorg-11.0.0-rc6.tar.gz"
]
http_archive(
name = "llvm-project-raw",
build_file_content = "#empty",
sha256 = LLVM_SHA256,
strip_prefix = "llvm-project-" + LLVM_COMMIT_xx,
# strip_prefix = "llvm-project-85763e0758fbd238c81f233c6f9510e81c7de177",
urls = LLVM_URLS,
)
load("@llvm-bazel//:configure.bzl", "llvm_configure")
llvm_configure(
name = "llvm-project",
src_path = ".",
src_workspace = "@llvm-project-raw//:WORKSPACE",
)
ONNX_MLIR_SHA256 = "f33108ba4bc81c6704753838ee4d85ad87e195fda3df991c2b00f18872a9e2dd"
# http_archive(
# name = "onnx-mlir-raw",
# build_file_content = "#empty",
# sha256 = ONNX_MLIR_SHA256,
# strip_prefix = "src",
# urls = [
# "https://github.com/onnx/onnx-mlir.git",
# ],
# )
# protobuf #####################################################################
# http_archive(
# name = "protobuf_archive",
# sha256 = "1c020fafc84acd235ec81c6aac22d73f23e85a700871466052ff231d69c1b17a",
# strip_prefix = "protobuf-5902e759108d14ee8e6b0b07653dac2f4e70ac73",
# build_file = "//third_party:protobuf.BUILD",
# # system_build_file = clean_dep("//third_party/systemlibs:protobuf.BUILD"),
# # system_link_files = {
# # "//third_party/systemlibs:protobuf.bzl": "protobuf.bzl",
# # },
# urls = [
# "https://github.com/protocolbuffers/protobuf/archive/5902e759108d14ee8e6b0b07653dac2f4e70ac73.tar.gz",
# "http://mirror.tensorflow.org/github.com/protocolbuffers/protobuf/archive/5902e759108d14ee8e6b0b07653dac2f4e70ac73.tar.gz",
# ],
# )
# PROTOBUF_URLS = [
# "http://mirror.tensorflow.org/github.com/protocolbuffers/protobuf/archive/5902e759108d14ee8e6b0b07653dac2f4e70ac73.tar.gz",
# "https://github.com/protocolbuffers/protobuf/archive/5902e759108d14ee8e6b0b07653dac2f4e70ac73.tar.gz",
# ]
# PROTOBUF_SHA256 = "1c020fafc84acd235ec81c6aac22d73f23e85a700871466052ff231d69c1b17a"
# PROTOBUF_STRIP_PREFIX = "protobuf-5902e759108d14ee8e6b0b07653dac2f4e70ac73"
# tf_http_archive(
# name = "protobuf_archive",
# sha256 = PROTOBUF_SHA256,
# strip_prefix = PROTOBUF_STRIP_PREFIX,
# system_build_file = clean_dep("//third_party/systemlibs:protobuf.BUILD"),
# system_link_files = {
# "//third_party/systemlibs:protobuf.bzl": "protobuf.bzl",
# },
# urls = PROTOBUF_URLS,
# )
# # We need to import the protobuf library under the names com_google_protobuf
# # and com_google_protobuf_cc to enable proto_library support in bazel.
# # Unfortunately there is no way to alias http_archives at the moment.
# tf_http_archive(
# name = "com_google_protobuf",
# sha256 = PROTOBUF_SHA256,
# strip_prefix = PROTOBUF_STRIP_PREFIX,
# system_build_file = clean_dep("//third_party/systemlibs:protobuf.BUILD"),
# system_link_files = {
# "//third_party/systemlibs:protobuf.bzl": "protobuf.bzl",
# },
# urls = PROTOBUF_URLS,
# )
# tf_http_archive(
# name = "com_google_protobuf_cc",
# sha256 = PROTOBUF_SHA256,
# strip_prefix = PROTOBUF_STRIP_PREFIX,
# system_build_file = clean_dep("//third_party/systemlibs:protobuf.BUILD"),
# system_link_files = {
# "//third_party/systemlibs:protobuf.bzl": "protobuf.bzl",
# },
# urls = PROTOBUF_URLS,
# )
# rules_cc defines rules for generating C++ code from Protocol Buffers.
http_archive(
name = "rules_cc",
sha256 = "35f2fb4ea0b3e61ad64a369de284e4fbbdcdba71836a5555abb5e194cf119509",
strip_prefix = "rules_cc-624b5d59dfb45672d4239422fa1e3de1822ee110",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/624b5d59dfb45672d4239422fa1e3de1822ee110.tar.gz",
"https://github.com/bazelbuild/rules_cc/archive/624b5d59dfb45672d4239422fa1e3de1822ee110.tar.gz",
],
)
# rules_proto defines abstract rules for building Protocol Buffers.
http_archive(
name = "rules_proto",
sha256 = "2490dca4f249b8a9a3ab07bd1ba6eca085aaf8e45a734af92aad0c42d9dc7aaf",
strip_prefix = "rules_proto-218ffa7dfa5408492dc86c01ee637614f8695c45",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/218ffa7dfa5408492dc86c01ee637614f8695c45.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/218ffa7dfa5408492dc86c01ee637614f8695c45.tar.gz",
],
)
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies")
rules_cc_dependencies()
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()
###############################################################################
# Skylib #######################################################################
http_archive(
name = "bazel_skylib",
sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
],
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
###############################################################################
load(":onnxmlir.bzl", "onnxmlir_deps")
onnxmlir_deps()