2024-03-27 17:27:49 +00:00
|
|
|
# buildifier: disable=load-on-top
|
|
|
|
|
2016-05-26 19:05:13 +00:00
|
|
|
workspace(name = "org_tensorflow")
|
|
|
|
|
2023-07-06 19:19:25 +00:00
|
|
|
# We must initialize hermetic python first.
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
name = "bazel_skylib",
|
|
|
|
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
|
|
|
|
urls = [
|
|
|
|
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
|
|
|
|
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
name = "rules_python",
|
2023-10-09 12:28:06 +00:00
|
|
|
sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b",
|
|
|
|
strip_prefix = "rules_python-0.26.0",
|
|
|
|
url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz",
|
2023-07-06 19:19:25 +00:00
|
|
|
)
|
|
|
|
|
2023-10-09 12:28:06 +00:00
|
|
|
load("@rules_python//python:repositories.bzl", "py_repositories")
|
|
|
|
|
|
|
|
py_repositories()
|
|
|
|
|
2024-03-27 17:27:49 +00:00
|
|
|
load("@rules_python//python:repositories.bzl", "python_register_toolchains") # buildifier: disable=same-origin-load
|
2023-07-06 19:19:25 +00:00
|
|
|
load(
|
|
|
|
"//tensorflow/tools/toolchains/python:python_repo.bzl",
|
|
|
|
"python_repository",
|
|
|
|
)
|
|
|
|
|
|
|
|
python_repository(name = "python_version_repo")
|
|
|
|
|
2023-10-20 00:14:03 +00:00
|
|
|
load("@python_version_repo//:py_version.bzl", "TF_PYTHON_VERSION")
|
2023-07-06 19:19:25 +00:00
|
|
|
|
|
|
|
python_register_toolchains(
|
|
|
|
name = "python",
|
|
|
|
ignore_root_user_error = True,
|
2023-10-20 00:14:03 +00:00
|
|
|
python_version = TF_PYTHON_VERSION,
|
2023-07-06 19:19:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
load("@python//:defs.bzl", "interpreter")
|
|
|
|
load("@rules_python//python:pip.bzl", "package_annotation", "pip_parse")
|
|
|
|
|
|
|
|
NUMPY_ANNOTATIONS = {
|
|
|
|
"numpy": package_annotation(
|
|
|
|
additive_build_content = """\
|
|
|
|
filegroup(
|
|
|
|
name = "includes",
|
|
|
|
srcs = glob(["site-packages/numpy/core/include/**/*.h"]),
|
|
|
|
)
|
|
|
|
cc_library(
|
|
|
|
name = "numpy_headers",
|
|
|
|
hdrs = [":includes"],
|
|
|
|
strip_include_prefix="site-packages/numpy/core/include/",
|
|
|
|
)
|
|
|
|
""",
|
|
|
|
),
|
|
|
|
}
|
|
|
|
|
|
|
|
pip_parse(
|
|
|
|
name = "pypi",
|
|
|
|
annotations = NUMPY_ANNOTATIONS,
|
|
|
|
python_interpreter_target = interpreter,
|
2023-10-20 00:14:03 +00:00
|
|
|
requirements = "//:requirements_lock_" + TF_PYTHON_VERSION.replace(".", "_") + ".txt",
|
2023-07-06 19:19:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
load("@pypi//:requirements.bzl", "install_deps")
|
|
|
|
|
|
|
|
install_deps()
|
|
|
|
|
2020-12-03 07:52:23 +00:00
|
|
|
# Initialize the TensorFlow repository and all dependencies.
|
|
|
|
#
|
2021-02-01 19:59:46 +00:00
|
|
|
# The cascade of load() statements and tf_workspace?() calls works around the
|
2020-12-03 07:52:23 +00:00
|
|
|
# restriction that load() statements need to be at the top of .bzl files.
|
|
|
|
# E.g. we can not retrieve a new repository with http_archive and then load()
|
|
|
|
# a macro from that repository in the same file.
|
2021-02-01 19:59:46 +00:00
|
|
|
load("@//tensorflow:workspace3.bzl", "tf_workspace3")
|
2021-01-18 19:01:52 +00:00
|
|
|
|
2021-02-01 19:59:46 +00:00
|
|
|
tf_workspace3()
|
2021-01-18 19:01:52 +00:00
|
|
|
|
2021-02-01 19:59:46 +00:00
|
|
|
load("@//tensorflow:workspace2.bzl", "tf_workspace2")
|
2021-01-18 19:01:52 +00:00
|
|
|
|
2021-02-01 19:59:46 +00:00
|
|
|
tf_workspace2()
|
2018-11-30 19:11:23 +00:00
|
|
|
|
2021-02-01 19:59:46 +00:00
|
|
|
load("@//tensorflow:workspace1.bzl", "tf_workspace1")
|
2017-02-04 01:13:49 +00:00
|
|
|
|
2021-02-01 19:59:46 +00:00
|
|
|
tf_workspace1()
|
2019-06-19 11:14:12 +00:00
|
|
|
|
2021-02-01 19:59:46 +00:00
|
|
|
load("@//tensorflow:workspace0.bzl", "tf_workspace0")
|
2020-12-02 05:04:15 +00:00
|
|
|
|
2021-02-01 19:59:46 +00:00
|
|
|
tf_workspace0()
|