-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMODULE.bazel
More file actions
150 lines (133 loc) · 6.08 KB
/
MODULE.bazel
File metadata and controls
150 lines (133 loc) · 6.08 KB
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
# Copyright 2024 The Fleetbench Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
module(name = "com_google_fleetbench")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
bazel_dep(name = "protoc-gen-validate", version = "1.2.1.bcr.1")
bazel_dep(name = "protobuf", version = "31.1", repo_name = "com_google_protobuf")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_python", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.1.5")
bazel_dep(name = "abseil-cpp", version = "20250512.1", repo_name = "com_google_absl")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "abseil-py", version = "2.1.0", repo_name = "com_google_absl_py")
bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest")
bazel_dep(name = "google_benchmark", version = "1.8.5", repo_name = "com_google_benchmark")
bazel_dep(name = "tcmalloc", version = "0.0.0-20240411-5ed309d", repo_name = "com_google_tcmalloc")
bazel_dep(name = "brotli", version = "1.1.0")
bazel_dep(name = "snappy", version = "1.2.1")
bazel_dep(name = "highway", version = "1.2.0", repo_name = "com_google_highway")
bazel_dep(name = "grpc", version = "1.74.0", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "libpfm", version = "4.11.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
# Required to avoid an error when running as root e.g. in Docker builds.
ignore_root_user_error = True,
python_version = "3.12",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "fleetbench_pip_deps",
python_version = "3.12",
requirements_lock = "//fleetbench:requirements.txt",
)
use_repo(pip, "fleetbench_pip_deps")
# Deps that need custom BUILD files.
# Flate
http_archive(
name = "chromium_zlib", # 2023-08-11
build_file = "//fleetbench/compression:zlib.BUILD",
# sha256 is not stable for googlesource.com
urls = ["https://chromium.googlesource.com/chromium/src/third_party/zlib/+archive/f5fd0ad2663e239a31184ad4c9919991dda16f46.tar.gz"],
)
http_archive(
name = "libzip", # 2024-04-09
build_file = "//fleetbench/compression:libzip.BUILD",
integrity = "sha256-1W2FfRw61KfzpMAaUcam5VMONauTUD9iJ26LorMGGGo=",
strip_prefix = "libzip-1.10.1",
urls = ["https://github.com/nih-at/libzip/archive/v1.10.1.tar.gz"],
)
http_archive(
name = "ZSTD", # 2020-05-22
build_file = "//fleetbench/compression:zstd.BUILD",
sha256 = "b6c537b53356a3af3ca3e621457751fa9a6ba96daf3aebb3526ae0f610863532",
strip_prefix = "zstd-1.4.5/lib",
urls = ["https://github.com/facebook/zstd/archive/v1.4.5.zip"],
)
# Use a more recent tcmalloc version than is available in the bazel repository.
archive_override(
module_name = "tcmalloc", # 2025-01-07
integrity = "sha256-e3p59ZEQU8BDXQmrl+9MUxTSz5mPgWYUKX4/t02B7BI=",
strip_prefix = "tcmalloc-b6563dbdc7905f7b0b31c97256c83e7c9b2f08c2",
urls = ["https://github.com/google/tcmalloc/archive/b6563dbdc7905f7b0b31c97256c83e7c9b2f08c2.zip"],
)
# Use the more recent libpfm4 version from github, and apply our patches for a native Bazel build.
archive_override(
module_name = "libpfm", # 2024-10-30
patch_strip = 1,
patches = ["//fleetbench/patches:0001-BUILD-and-MODULE-files-for-libpfm.patch"],
#integrity = "sha256-0YuXdkx1VSjBBR03bjNUXQ62DG6/hWgENoE/pbBMw9E=",
strip_prefix = "libpfm4-4.13.0",
urls = ["https://github.com/wcohen/libpfm4/archive/v4.13.0.zip"],
)
# ScaNN
http_archive(
name = "com_google_research_scann", # 2024-12-01
integrity = "sha256-mWvgZi31LGbkqSQxSCgVRuG9p1rosNVTT2tVs6Rw0rs=",
patch_args = [
# Remove scann/scann prefix from patch filenames.
"-p2",
],
patches = [
"//fleetbench/patches:0001-Remove-more_deps-argument.patch",
"//fleetbench/patches:0002-Replace-gtest_main-with-gtest.patch",
"//fleetbench/patches:0003-Replace-non-standard-uint32-with-uint32_t.patch",
"//fleetbench/patches:0004-Remove-dependency-on-absl-endian.patch",
"//fleetbench/patches:0005-Update-path-to-py_proto_library.patch",
],
strip_prefix = "google-research-084accd3286a43da7f43b4a1bf0bba7fddd90527/scann",
urls = ["https://github.com/google-research/google-research/archive/084accd3286a43da7f43b4a1bf0bba7fddd90527.zip"],
)
bazel_dep(name = "local_config_tf")
# Provide minimal Tensorflow library support for ScaNN
local_path_override(
module_name = "local_config_tf",
path = "fleetbench/simd/tensorflow_support",
)
# Configure LLVM repo.
http_archive(
name = "llvm", # 2023-03-07
build_file = "@//fleetbench:llvmlibc.BUILD.bazel",
sha256 = "ee98a255becf4b8d2667cea777a497e0fea87a294abfc5c01ee28897dbfc7c3f",
strip_prefix = "llvm-project-e002a38b20e3ac40aecbbfa0774f8ba7b9690b0c",
urls = ["https://github.com/llvm/llvm-project/archive/e002a38b20e3ac40aecbbfa0774f8ba7b9690b0c.tar.gz"],
)
# Apply the overlay to produce llvm-project.
llvm_project = use_extension(
"//fleetbench:llvm_project.bzl",
"llvm_project",
)
use_repo(llvm_project, "llvm-project")
http_archive(
name = "libnuma",
build_file = "@//fleetbench:libnuma.BUILD.bazel",
patch_cmds = [
"./autogen.sh",
"./configure",
# clang does not support the symver attribute
"sed -i -e 's/\\(#define HAVE_ATTRIBUTE_SYMVER 1\\)/#ifndef __clang__\\n\\1\\n#endif/' config.h",
],
sha256 = "c7aebfc925f2c3827e3cb607092065f3a48986a16aea1bb10ca70937edac278b",
strip_prefix = "numactl-2.0.19",
url = "https://github.com/numactl/numactl/archive/refs/tags/v2.0.19.zip",
)