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", |
Scott Todd | 4da193c | 2020-02-25 14:39:50 -0800 | [diff] [blame] | 49 | sha256 = "4d348abfaddbcee0c077fc51bb1177065c3663191588ab3d958f027cbfe1818b", |
| 50 | strip_prefix = "bazel-toolchains-2.1.0", |
Geoffrey Martin-Noble | 2c8b5a4 | 2019-12-11 11:30:39 -0800 | [diff] [blame] | 51 | urls = [ |
Scott Todd | 4da193c | 2020-02-25 14:39:50 -0800 | [diff] [blame] | 52 | "https://github.com/bazelbuild/bazel-toolchains/releases/download/2.1.0/bazel-toolchains-2.1.0.tar.gz", |
| 53 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/2.1.0.tar.gz", |
Geoffrey Martin-Noble | 2c8b5a4 | 2019-12-11 11:30:39 -0800 | [diff] [blame] | 54 | ], |
| 55 | ) |
| 56 | |
Scott Todd | b5331d2 | 2020-02-25 17:22:00 -0800 | [diff] [blame] | 57 | # Disable RBE until compatibility issues with the experimental_repo_remote_exec |
| 58 | # flag are fixed. |
| 59 | # load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig") |
| 60 | # rbe_autoconfig(name = "rbe_default") |
Geoffrey Martin-Noble | 2c8b5a4 | 2019-12-11 11:30:39 -0800 | [diff] [blame] | 61 | |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 62 | ############################################################################### |
| 63 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 64 | ############################################################################### |
| 65 | # io_bazel_rules_closure |
| 66 | # This is copied from https://github.com/tensorflow/tensorflow/blob/v2.0.0-alpha0/WORKSPACE. |
| 67 | # Dependency of: |
| 68 | # TensorFlow (boilerplate for tf_workspace(), apparently) |
| 69 | http_archive( |
| 70 | name = "io_bazel_rules_closure", |
| 71 | sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9", |
| 72 | strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149", |
| 73 | urls = [ |
| 74 | "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", |
| 75 | "https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", # 2019-06-13 |
| 76 | ], |
| 77 | ) |
| 78 | ############################################################################### |
| 79 | |
| 80 | ############################################################################### |
| 81 | # Skylib |
| 82 | # Dependency of: |
| 83 | # TensorFlow |
| 84 | http_archive( |
| 85 | name = "bazel_skylib", |
| 86 | urls = [ |
| 87 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", |
| 88 | "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", |
| 89 | ], |
| 90 | sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", |
| 91 | ) |
| 92 | load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") |
| 93 | bazel_skylib_workspace() |
| 94 | ############################################################################### |
| 95 | |
| 96 | ############################################################################### |
Stella Laurenzo | 15d8ae4 | 2020-01-03 13:52:12 -0800 | [diff] [blame] | 97 | # llvm-project |
| 98 | load("@iree_core//build_tools/bazel/third_party_import/llvm-project:configure.bzl", "llvm_configure") |
| 99 | maybe(llvm_configure, |
| 100 | name = "llvm-project", |
| 101 | workspace = "@iree_core//:WORKSPACE", |
| 102 | path = "third_party/llvm-project", |
| 103 | ) |
| 104 | ############################################################################### |
| 105 | |
| 106 | ############################################################################### |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 107 | # Bootstrap TensorFlow. |
| 108 | # 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] | 109 | # 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] | 110 | # In the mean-time: we're sorry. |
| 111 | # TODO(laurenzo): Come up with a way to make this optional. Also, see if we can |
| 112 | # get the TensorFlow tf_repositories() rule to use maybe() so we can provide |
| 113 | # local overrides safely. |
| 114 | maybe(local_repository, |
| 115 | name = "org_tensorflow", |
| 116 | path = "third_party/tensorflow", |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 117 | ) |
| 118 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 119 | # Import all of the tensorflow dependencies. |
| 120 | load("@org_tensorflow//tensorflow:workspace.bzl", "tf_repositories") |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 121 | ############################################################################### |
| 122 | |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 123 | ############################################################################### |
| 124 | # Autoconfigure native build repo for python. |
Marius Brehler | b18c388 | 2020-01-14 17:06:28 -0800 | [diff] [blame] | 125 | load("//bindings/python/build_tools/python:configure.bzl", "python_configure") |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 126 | |
| 127 | # TODO(laurenzo): Scoping to "iree" to avoid conflicts with other things that |
| 128 | # take an opinion until we can isolate. |
| 129 | maybe(python_configure, |
| 130 | name = "iree_native_python", |
| 131 | ) |
| 132 | ############################################################################### |
| 133 | |
Scott Todd | 0d41620 | 2019-11-12 16:22:05 -0800 | [diff] [blame] | 134 | ############################################################################### |
| 135 | # Find and configure the Vulkan SDK, if installed. |
| 136 | load("//build_tools/third_party/vulkan_sdk:repo.bzl", "vulkan_sdk_setup") |
| 137 | maybe(vulkan_sdk_setup, |
| 138 | name = "vulkan_sdk", |
| 139 | ) |
| 140 | ############################################################################### |
| 141 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 142 | maybe(local_repository, |
| 143 | name = "com_google_absl", |
| 144 | path = "third_party/abseil-cpp", |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 145 | ) |
| 146 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 147 | maybe(local_repository, |
| 148 | name = "com_google_googletest", |
| 149 | path = "third_party/googletest", |
| 150 | ) |
| 151 | |
| 152 | # Note that TensorFlow provides this as "flatbuffers" which is wrong. |
| 153 | # It is only used for TFLite and may cause ODR issues if not fixed. |
| 154 | maybe(local_repository, |
Stella Laurenzo | 7f6af20 | 2019-10-09 16:33:24 -0700 | [diff] [blame] | 155 | name = "com_github_google_flatbuffers", |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 156 | path = "third_party/flatbuffers", |
| 157 | ) |
| 158 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 159 | maybe(new_local_repository, |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 160 | name = "com_google_tracing_framework_cpp", |
| 161 | path = "third_party/google_tracing_framework/bindings/cpp", |
Stella Laurenzo | 7f6af20 | 2019-10-09 16:33:24 -0700 | [diff] [blame] | 162 | build_file = "build_tools/third_party/google_tracing_framework_cpp/BUILD.overlay", |
| 163 | ) |
| 164 | |
Scott Todd | 6152a70 | 2020-03-23 16:47:25 -0700 | [diff] [blame^] | 165 | # TODO(scotttodd): TensorFlow is squatting on the vulkan_headers repo name, so |
| 166 | # we use a temporary one until resolved. Theirs is set to an outdated version. |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 167 | maybe(new_local_repository, |
Scott Todd | 6152a70 | 2020-03-23 16:47:25 -0700 | [diff] [blame^] | 168 | name = "iree_vulkan_headers", |
Stella Laurenzo | 7f6af20 | 2019-10-09 16:33:24 -0700 | [diff] [blame] | 169 | path = "third_party/vulkan_headers", |
| 170 | build_file = "build_tools/third_party/vulkan_headers/BUILD.overlay", |
| 171 | ) |
| 172 | |
Stella Laurenzo | e7d9e88 | 2019-10-10 14:32:38 -0700 | [diff] [blame] | 173 | maybe(new_local_repository, |
Stella Laurenzo | 7f6af20 | 2019-10-09 16:33:24 -0700 | [diff] [blame] | 174 | name = "vulkan_memory_allocator", |
| 175 | path = "third_party/vulkan_memory_allocator", |
| 176 | build_file = "build_tools/third_party/vulkan_memory_allocator/BUILD.overlay", |
Stella Laurenzo | 196ad74 | 2019-10-09 10:33:08 -0700 | [diff] [blame] | 177 | ) |
Stella Laurenzo | 5e8573b | 2019-10-10 15:31:51 -0700 | [diff] [blame] | 178 | |
| 179 | maybe(new_local_repository, |
| 180 | name = "glslang", |
| 181 | path = "third_party/glslang", |
| 182 | build_file = "build_tools/third_party/glslang/BUILD.overlay", |
| 183 | ) |
| 184 | |
| 185 | maybe(local_repository, |
| 186 | name = "spirv_tools", |
| 187 | path = "third_party/spirv_tools", |
| 188 | ) |
| 189 | |
| 190 | maybe(local_repository, |
| 191 | name = "spirv_headers", |
| 192 | path = "third_party/spirv_headers", |
| 193 | ) |
Stella Laurenzo | c4a6edf | 2019-10-17 16:59:08 -0700 | [diff] [blame] | 194 | |
| 195 | # TODO(laurenzo): TensorFlow is squatting on the pybind11 repo name, so |
| 196 | # we use a temporary one until resolved. Theirs pulls in a bunch of stuff. |
| 197 | maybe(new_local_repository, |
| 198 | name = "iree_pybind11", |
| 199 | path = "third_party/pybind11", |
| 200 | build_file = "build_tools/third_party/pybind11/BUILD.overlay", |
| 201 | ) |
Stella Laurenzo | 0da4af5 | 2019-10-23 12:54:53 -0700 | [diff] [blame] | 202 | |
| 203 | maybe(local_repository, |
| 204 | name = "com_google_benchmark", |
| 205 | path = "third_party/benchmark") |
Scott Todd | f700355 | 2019-11-11 09:14:19 -0800 | [diff] [blame] | 206 | |
| 207 | maybe(new_local_repository, |
| 208 | name = "sdl2", |
| 209 | path = "third_party/sdl2", |
| 210 | build_file = "build_tools/third_party/sdl2/BUILD.overlay", |
| 211 | ) |
| 212 | |
| 213 | maybe(new_local_repository, |
| 214 | name = "sdl2_config", |
| 215 | path = "build_tools/third_party/sdl2", |
| 216 | build_file_content = """ |
| 217 | package(default_visibility = ["//visibility:public"]) |
| 218 | cc_library(name = "headers", srcs = glob(["*.h"])) |
| 219 | """, |
| 220 | ) |
Scott Todd | 0d41620 | 2019-11-12 16:22:05 -0800 | [diff] [blame] | 221 | |
| 222 | maybe(new_local_repository, |
| 223 | name = "dear_imgui", |
| 224 | path = "third_party/dear_imgui", |
| 225 | build_file = "build_tools/third_party/dear_imgui/BUILD.overlay", |
| 226 | ) |
Stella Laurenzo | 15d8ae4 | 2020-01-03 13:52:12 -0800 | [diff] [blame] | 227 | |
Scott Todd | d624815 | 2020-02-07 09:57:05 -0800 | [diff] [blame] | 228 | maybe(new_local_repository, |
| 229 | name = "renderdoc_api", |
| 230 | path = "third_party/renderdoc_api", |
| 231 | build_file = "build_tools/third_party/renderdoc_api/BUILD.overlay", |
| 232 | ) |
| 233 | |
Stella Laurenzo | 15d8ae4 | 2020-01-03 13:52:12 -0800 | [diff] [blame] | 234 | # Bootstrap TensorFlow deps last so that ours can take precedence. |
| 235 | tf_repositories() |