-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathWORKSPACE
253 lines (209 loc) · 8.1 KB
/
WORKSPACE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
workspace(name = "com_google_gematria")
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")
SKYLIB_VERSION = "1.3.0"
http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = SKYLIB_VERSION),
],
)
git_repository(
name = "com_google_protobuf",
remote = "https://github.com/protocolbuffers/protobuf.git",
tag = "v23.2",
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
# Required for protobuf to build.
git_repository(
name = "com_google_absl",
remote = "https://github.com/abseil/abseil-cpp.git",
tag = "20230802.2",
)
git_repository(
name = "org_mizux_bazelpybind11",
commit = "27da411499fe62f7c0969ac2665d343ce162b6a9",
remote = "https://github.com/Mizux/bazel-pybind11.git",
)
git_repository(
name = "com_google_googletest",
remote = "https://github.com/google/googletest.git",
tag = "release-1.12.1",
)
# We use a patched version of google/benchmark/BUILD.bazel to keep the name
# used to refer to libpfm4 and its targets consistent with other dependencies.
git_repository(
name = "com_github_google_benchmark",
patch_args = ["-p1"],
patches = ["@//:benchmark_build.patch"],
remote = "https://github.com/google/benchmark.git",
tag = "v1.8.3",
)
# rules_foreign_cc is required to build libpfm4 since it is originally
# configured to be built using GNU Make.
git_repository(
name = "rules_foreign_cc",
commit = "816905a078773405803e86635def78b61d2f782d",
remote = "https://github.com/bazelbuild/rules_foreign_cc.git",
)
# Dependencies needed by rules_foreign_cc, in turn needed to build libpfm4.
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
rules_foreign_cc_dependencies()
# Used by benchmark to capture metrics using perf counter counters.
git_repository(
name = "pfm",
build_file = "@llvm-raw//utils/bazel/third_party_build:pfm.BUILD",
remote = "https://git.code.sf.net/p/perfmon2/libpfm4",
tag = "v4.13.0",
)
git_repository(
name = "rules_proto",
remote = "https://github.com/bazelbuild/rules_proto.git",
tag = "5.3.0-21.7",
)
# We only take the `quipper` sub-package from the `perf_data_converter`
# repository to keep things cleaner.
git_repository(
name = "com_google_perf_data_converter",
commit = "442981cd4071fa9b1057b2609406db027e6d6263",
patch_args = ["-p1"],
# `strip_prefix` would also work, but this makes generating the patch
# easier, since `patch_cmds` are applied after the patch itself.
patch_cmds = [
"mv ./src/quipper .",
"rm -rf ./src",
],
patches = ["@//:perf_data_converter.patch"],
remote = "https://github.com/google/perf_data_converter.git",
)
# `libelf` from `elfutils` and `boringssl` are dependencies for
# `quipper` from `perf_data_converter`.
http_archive(
name = "elfutils",
build_file = "//:elfutils.BUILD",
sha256 = "df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871",
strip_prefix = "elfutils-0.191",
urls = ["https://sourceware.org/pub/elfutils/0.191/elfutils-0.191.tar.bz2"],
)
http_archive(
name = "boringssl",
sha256 = "0a2b7a10fdce3d5ccdc6abf4f5701dca24b97efa75b00d203c50221269605476",
strip_prefix = "boringssl-ea4425fbb276871cfec5c4e19c12796b3cd1c9ab",
urls = ["https://github.com/google/boringssl/archive/ea4425fbb276871cfec5c4e19c12796b3cd1c9ab.tar.gz"],
)
# Python
load("@upb//bazel:system_python.bzl", "system_python")
system_python(
name = "system_python",
minimum_python_version = "3.10",
)
bind(
name = "python_headers",
actual = "@system_python//:python_headers",
)
git_repository(
name = "rules_python",
remote = "https://github.com/bazelbuild/rules_python.git",
tag = "0.19.0",
)
git_repository(
name = "pybind11_bazel",
commit = "b162c7c88a253e3f6b673df0c621aca27596ce6b",
patch_args = ["-p1"],
patches = ["@org_mizux_bazelpybind11//patches:pybind11_bazel.patch"],
remote = "https://github.com/pybind/pybind11_bazel.git",
)
new_git_repository(
name = "pybind11",
build_file = "@pybind11_bazel//:pybind11.BUILD",
remote = "https://github.com/pybind/pybind11.git",
tag = "v2.10.3",
)
git_repository(
# We can't use the name "pybind11_abseil" for the repository, as this would
# break the `sys.path` hack that we use for importing third-party Python
# modules. See the comment under "Python libraries" below for a detailed
# explanation.
name = "pybind11_abseil_repo",
commit = "1caf1890443e8e303bf88850d3c27d5422903168",
remote = "https://github.com/pybind/pybind11_abseil.git",
)
git_repository(
name = "com_google_pybind11_protobuf",
commit = "55916e14588b3c26203d4aefbdcaa888870c29ac",
remote = "https://github.com/pybind/pybind11_protobuf.git",
)
load("@pybind11_bazel//:python_configure.bzl", _pybind11_python_configure = "python_configure")
_pybind11_python_configure(
name = "local_config_python",
python_version = "3",
)
# Python libraries
# We need to manipulate sys.path to make these libraries work as if they were imported
# through PIP or the system package manager. When adding a new Python repository here,
# 1. the name of the repository should be different from the name used when importing it
# in Python, to avoid confusing the module loader; by convention, we add `_repo` at
# the end of the name.
# 2. the names of the repositories must be added to the list of third-party repositories
# in `gematria/__init__.py` to make sure that they are added to sys.path.
git_repository(
name = "sonnet_repo",
commit = "cd5b5fa48e15e4d020f744968f5209949ebe750f",
patch_args = ["-p1"],
patches = ["//:sonnet.patch"],
remote = "https://github.com/deepmind/sonnet.git",
)
new_git_repository(
name = "graph_nets_repo",
build_file = "@//:graph_nets.BUILD",
commit = "adf25162ba21bb0ae176c35483a74fb0c9dff576",
remote = "https://github.com/deepmind/graph_nets.git",
)
# LLVM and its dependencies
# The pinned version of LLVM, and its SHA256 hash. The `LLVM_COMMIT` variable in
# `.github/workflows/main.yaml` must be updated to match this everytime it is
# changed.
LLVM_COMMIT = "cd66c9b6a04689659348c0a3ff4c1205b1133fe9"
LLVM_SHA256 = "8d2a8b2e0accdf072a3897aec6a3e68d522dfc1b40416b3c4215bb5af36a36e1"
http_archive(
name = "llvm-raw",
build_file_content = "# empty",
sha256 = LLVM_SHA256,
strip_prefix = "llvm-project-" + LLVM_COMMIT,
urls = ["https://github.com/llvm/llvm-project/archive/{commit}.zip".format(commit = LLVM_COMMIT)],
)
load(
"@llvm-raw//utils/bazel:configure.bzl",
"llvm_configure",
)
llvm_configure(name = "llvm-project")
http_archive(
name = "llvm_zlib",
build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD",
sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731",
strip_prefix = "zlib-ng-2.0.7",
urls = [
"https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip",
],
)
http_archive(
name = "llvm_zstd",
build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
strip_prefix = "zstd-1.5.2",
urls = [
"https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz",
],
)
# compile_commands.json extraction for clangd
# https://github.com/hedronvision/bazel-compile-commands-extractor
http_archive(
name = "hedron_compile_commands",
sha256 = "3cd0e49f0f4a6d406c1d74b53b7616f5e24f5fd319eafc1bf8eee6e14124d115",
strip_prefix = "bazel-compile-commands-extractor-3dddf205a1f5cde20faf2444c1757abe0564ff4c",
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/3dddf205a1f5cde20faf2444c1757abe0564ff4c.tar.gz",
)
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
hedron_compile_commands_setup()