Geoffrey Martin-Noble | 15545b4 | 2019-11-09 16:40:38 -0800 | [diff] [blame] | 1 | # Copyright 2019 Google LLC |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Stella Laurenzo | 1128d50 | 2019-10-07 14:34:41 -0700 | [diff] [blame] | 15 | # Workspace file for the IREE project. |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 16 | # buildozer: disable=positional-args |
| 17 | |
| 18 | workspace(name = "iree_core") |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 19 | |
| 20 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 21 | load(":repo_utils.bzl", "maybe") |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 22 | |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 23 | ############################################################################### |
Geoffrey Martin-Noble | 8602997 | 2020-01-28 18:27:03 -0800 | [diff] [blame^] | 24 | # Bazel rules. |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 25 | http_archive( |
Geoffrey Martin-Noble | 8602997 | 2020-01-28 18:27:03 -0800 | [diff] [blame^] | 26 | name = "rules_cc", |
| 27 | sha256 = "cf3b76a90c86c0554c5b10f4b160f05af71d252026b71362c4674e2fb9936cf9", |
| 28 | strip_prefix = "rules_cc-01d4a48911d5e7591ecb1c06d3b8af47fe872371", |
| 29 | urls = [ |
| 30 | "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_cc/archive/01d4a48911d5e7591ecb1c06d3b8af47fe872371.zip", |
| 31 | "https://github.com/bazelbuild/rules_cc/archive/01d4a48911d5e7591ecb1c06d3b8af47fe872371.zip", |
| 32 | ], |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 33 | ) |
| 34 | |
Geoffrey Martin-Noble | 8602997 | 2020-01-28 18:27:03 -0800 | [diff] [blame^] | 35 | http_archive( |
| 36 | name = "rules_python", |
| 37 | url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.1/rules_python-0.0.1.tar.gz", |
| 38 | sha256 = "aa96a691d3a8177f3215b14b0edc9641787abaaa30363a080165d06ab65e1161", |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 39 | ) |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 40 | load("@rules_python//python:repositories.bzl", "py_repositories") |
| 41 | py_repositories() |
Geoffrey Martin-Noble | 2c8b5a4 | 2019-12-11 11:30:39 -0800 | [diff] [blame] | 42 | |
| 43 | ############################################################################### |
| 44 | |
| 45 | ############################################################################### |
| 46 | # bazel toolchains rules for remote execution (https://releases.bazel.build/bazel-toolchains.html). |
| 47 | http_archive( |
| 48 | name = "bazel_toolchains", |
| 49 | sha256 = "ca8aa49ceb47e9bee04dd67f0bec0b010032b37ebbe67147b535237e801d9a87", |
| 50 | strip_prefix = "bazel-toolchains-1.2.2", |
| 51 | urls = [ |
| 52 | "https://github.com/bazelbuild/bazel-toolchains/releases/download/1.2.2/bazel-toolchains-1.2.2.tar.gz", |
| 53 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/1.2.2.tar.gz", |
| 54 | ], |
| 55 | ) |
| 56 | |
| 57 | load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig") |
| 58 | rbe_autoconfig(name = "rbe_default") |
| 59 | |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 60 | ############################################################################### |
| 61 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 62 | ############################################################################### |
| 63 | # io_bazel_rules_closure |
| 64 | # This is copied from https://github.com/tensorflow/tensorflow/blob/v2.0.0-alpha0/WORKSPACE. |
| 65 | # Dependency of: |
| 66 | # TensorFlow (boilerplate for tf_workspace(), apparently) |
| 67 | http_archive( |
| 68 | name = "io_bazel_rules_closure", |
| 69 | sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9", |
| 70 | strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149", |
| 71 | urls = [ |
| 72 | "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", |
| 73 | "https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", # 2019-06-13 |
| 74 | ], |
| 75 | ) |
| 76 | ############################################################################### |
| 77 | |
| 78 | ############################################################################### |
| 79 | # Skylib |
| 80 | # Dependency of: |
| 81 | # TensorFlow |
| 82 | http_archive( |
| 83 | name = "bazel_skylib", |
| 84 | urls = [ |
| 85 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", |
| 86 | "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", |
| 87 | ], |
| 88 | sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", |
| 89 | ) |
| 90 | load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") |
| 91 | bazel_skylib_workspace() |
| 92 | ############################################################################### |
| 93 | |
| 94 | ############################################################################### |
Stella Laurenzo | 15d8ae4 | 2020-01-03 13:52:12 -0800 | [diff] [blame] | 95 | # llvm-project |
| 96 | load("@iree_core//build_tools/bazel/third_party_import/llvm-project:configure.bzl", "llvm_configure") |
| 97 | maybe(llvm_configure, |
| 98 | name = "llvm-project", |
| 99 | workspace = "@iree_core//:WORKSPACE", |
| 100 | path = "third_party/llvm-project", |
| 101 | ) |
| 102 | ############################################################################### |
| 103 | |
| 104 | ############################################################################### |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 105 | # Bootstrap TensorFlow. |
| 106 | # Note that we ultimately would like to avoid doing this at the top level like |
Scott Todd | 13aeb4b | 2020-01-24 15:14:54 -0800 | [diff] [blame] | 107 | # this but need to unbundle some of the deps from the tensorflow repo first. |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 108 | # In the mean-time: we're sorry. |
| 109 | # TODO(laurenzo): Come up with a way to make this optional. Also, see if we can |
| 110 | # get the TensorFlow tf_repositories() rule to use maybe() so we can provide |
| 111 | # local overrides safely. |
| 112 | maybe(local_repository, |
| 113 | name = "org_tensorflow", |
| 114 | path = "third_party/tensorflow", |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 115 | ) |
| 116 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 117 | # Import all of the tensorflow dependencies. |
| 118 | load("@org_tensorflow//tensorflow:workspace.bzl", "tf_repositories") |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 119 | ############################################################################### |
| 120 | |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 121 | ############################################################################### |
| 122 | # Autoconfigure native build repo for python. |
Marius Brehler | b18c388 | 2020-01-14 17:06:28 -0800 | [diff] [blame] | 123 | load("//bindings/python/build_tools/python:configure.bzl", "python_configure") |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 124 | |
| 125 | # TODO(laurenzo): Scoping to "iree" to avoid conflicts with other things that |
| 126 | # take an opinion until we can isolate. |
| 127 | maybe(python_configure, |
| 128 | name = "iree_native_python", |
| 129 | ) |
| 130 | ############################################################################### |
| 131 | |
Scott Todd | 0d41620 | 2019-11-12 16:22:05 -0800 | [diff] [blame] | 132 | ############################################################################### |
| 133 | # Find and configure the Vulkan SDK, if installed. |
| 134 | load("//build_tools/third_party/vulkan_sdk:repo.bzl", "vulkan_sdk_setup") |
| 135 | maybe(vulkan_sdk_setup, |
| 136 | name = "vulkan_sdk", |
| 137 | ) |
| 138 | ############################################################################### |
| 139 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 140 | maybe(local_repository, |
| 141 | name = "com_google_absl", |
| 142 | path = "third_party/abseil-cpp", |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 143 | ) |
| 144 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 145 | maybe(local_repository, |
| 146 | name = "com_google_googletest", |
| 147 | path = "third_party/googletest", |
| 148 | ) |
| 149 | |
| 150 | # Note that TensorFlow provides this as "flatbuffers" which is wrong. |
| 151 | # It is only used for TFLite and may cause ODR issues if not fixed. |
| 152 | maybe(local_repository, |
Stella Laurenzo | 7f6af20 | 2019-10-09 16:33:24 -0700 | [diff] [blame] | 153 | name = "com_github_google_flatbuffers", |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 154 | path = "third_party/flatbuffers", |
| 155 | ) |
| 156 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 157 | maybe(new_local_repository, |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 158 | name = "com_google_tracing_framework_cpp", |
| 159 | path = "third_party/google_tracing_framework/bindings/cpp", |
Stella Laurenzo | 7f6af20 | 2019-10-09 16:33:24 -0700 | [diff] [blame] | 160 | build_file = "build_tools/third_party/google_tracing_framework_cpp/BUILD.overlay", |
| 161 | ) |
| 162 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 163 | maybe(new_local_repository, |
Stella Laurenzo | 7f6af20 | 2019-10-09 16:33:24 -0700 | [diff] [blame] | 164 | name = "vulkan_headers", |
| 165 | path = "third_party/vulkan_headers", |
| 166 | build_file = "build_tools/third_party/vulkan_headers/BUILD.overlay", |
| 167 | ) |
| 168 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 169 | maybe(new_local_repository, |
Stella Laurenzo | 7f6af20 | 2019-10-09 16:33:24 -0700 | [diff] [blame] | 170 | name = "vulkan_memory_allocator", |
| 171 | path = "third_party/vulkan_memory_allocator", |
| 172 | build_file = "build_tools/third_party/vulkan_memory_allocator/BUILD.overlay", |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 173 | ) |
Stella Laurenzo | 5e8573b | 2019-10-10 15:31:51 -0700 | [diff] [blame] | 174 | |
| 175 | maybe(new_local_repository, |
| 176 | name = "glslang", |
| 177 | path = "third_party/glslang", |
| 178 | build_file = "build_tools/third_party/glslang/BUILD.overlay", |
| 179 | ) |
| 180 | |
| 181 | maybe(local_repository, |
| 182 | name = "spirv_tools", |
| 183 | path = "third_party/spirv_tools", |
| 184 | ) |
| 185 | |
| 186 | maybe(local_repository, |
| 187 | name = "spirv_headers", |
| 188 | path = "third_party/spirv_headers", |
| 189 | ) |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 190 | |
| 191 | # TODO(laurenzo): TensorFlow is squatting on the pybind11 repo name, so |
| 192 | # we use a temporary one until resolved. Theirs pulls in a bunch of stuff. |
| 193 | maybe(new_local_repository, |
| 194 | name = "iree_pybind11", |
| 195 | path = "third_party/pybind11", |
| 196 | build_file = "build_tools/third_party/pybind11/BUILD.overlay", |
| 197 | ) |
Stella Laurenzo | 0da4af5 | 2019-10-23 12:54:53 -0700 | [diff] [blame] | 198 | |
| 199 | maybe(local_repository, |
| 200 | name = "com_google_benchmark", |
| 201 | path = "third_party/benchmark") |
Scott Todd | f700355 | 2019-11-11 09:14:19 -0800 | [diff] [blame] | 202 | |
| 203 | maybe(new_local_repository, |
| 204 | name = "sdl2", |
| 205 | path = "third_party/sdl2", |
| 206 | build_file = "build_tools/third_party/sdl2/BUILD.overlay", |
| 207 | ) |
| 208 | |
| 209 | maybe(new_local_repository, |
| 210 | name = "sdl2_config", |
| 211 | path = "build_tools/third_party/sdl2", |
| 212 | build_file_content = """ |
| 213 | package(default_visibility = ["//visibility:public"]) |
| 214 | cc_library(name = "headers", srcs = glob(["*.h"])) |
| 215 | """, |
| 216 | ) |
Scott Todd | 0d41620 | 2019-11-12 16:22:05 -0800 | [diff] [blame] | 217 | |
| 218 | maybe(new_local_repository, |
| 219 | name = "dear_imgui", |
| 220 | path = "third_party/dear_imgui", |
| 221 | build_file = "build_tools/third_party/dear_imgui/BUILD.overlay", |
| 222 | ) |
Stella Laurenzo | 15d8ae4 | 2020-01-03 13:52:12 -0800 | [diff] [blame] | 223 | |
| 224 | # Bootstrap TensorFlow deps last so that ours can take precedence. |
| 225 | tf_repositories() |