-
Notifications
You must be signed in to change notification settings - Fork 140
Expand file tree
/
Copy pathMODULE.bazel
More file actions
190 lines (158 loc) · 6.03 KB
/
Copy pathMODULE.bazel
File metadata and controls
190 lines (158 loc) · 6.03 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
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
module(name = "heir")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "rules_cc", version = "0.2.19")
# hermetic LLVM toolchain (for C++ compiler and linker)
bazel_dep(name = "llvm", version = "0.8.9")
register_toolchains("@llvm//:all")
# Apple compilation support.
# Note this requires full xcode, not just commandline tools
#
# Tested with:
#
# $ /usr/bin/xcodebuild -version
# Xcode 16.2
# Build version 16C5032a
bazel_dep(name = "apple_support", version = "1.24.1", repo_name = "build_bazel_apple_support")
bazel_dep(name = "rules_apple", version = "3.20.1")
# Gazelle puglin for BUILD file autogeneration
bazel_dep(name = "gazelle", version = "0.47.0")
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.8.2", dev_dependency = True)
# provides the `license` rule, which is required because llvm's gentbl_rule
# implicitly depends upon the target '//:license'. How bizarre.
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "rules_go", version = "0.53.0")
bazel_dep(name = "rules_python", version = "1.7.0")
bazel_dep(name = "googletest", version = "1.17.0")
bazel_dep(name = "fuzztest", version = "20250805.0")
bazel_dep(name = "google_benchmark", version = "1.9.1")
bazel_dep(name = "abseil-cpp", version = "20250512.1", repo_name = "com_google_absl")
bazel_dep(name = "abseil-py", version = "2.1.0")
bazel_dep(name = "pybind11_bazel", version = "2.13.6")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "re2", version = "2025-08-12")
bazel_dep(name = "isl", version = "0.27")
bazel_dep(name = "pocketfft", version = "0.0.2")
bazel_dep(name = "openfhe", version = "1.4.2.bcr.1")
bazel_dep(name = "abc", version = "0.64-yosyshq.bcr.1")
bazel_dep(name = "yosys", version = "0.57.bcr.2")
# yosys deps needing newer versions for bazel compatibility
bazel_dep(name = "fmt", version = "12.1.0")
bazel_dep(name = "bison", version = "3.8.2.bcr.5")
bazel_dep(name = "m4", version = "1.4.21.bcr.1")
bazel_dep(name = "libffi", version = "3.4.7.bcr.4")
# Clang 21 compatibility
# Cf. https://github.com/bazelbuild/bazel-central-registry/pull/7989
bazel_dep(name = "gawk", version = "5.3.2.bcr.7")
# Clang 21 compatibility
# Cf. https://github.com/bazelbuild/bazel-central-registry/pull/7915
bazel_dep(name = "sed", version = "4.9.bcr.5")
# LLVM dependency requires us to manually pull in some transitive deps
bazel_dep(name = "zlib-ng", version = "2.3.3", repo_name = "llvm_zlib")
bazel_dep(name = "zstd", version = "1.5.7", repo_name = "llvm_zstd")
llvm_extensions = use_extension("//bazel:extensions.bzl", "llvm_deps")
use_repo(
llvm_extensions,
"llvm-raw",
)
# The subset of LLVM backend targets that should be compiled
_LLVM_TARGETS = [
"X86",
# Needed for Apple M1 targets, see
# https://github.com/j2kun/mlir-tutorial/issues/11
"AArch64",
]
# Configure LLVM project using use_repo_rule
llvm_configure = use_repo_rule("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure")
llvm_configure(
name = "llvm-project",
targets = _LLVM_TARGETS,
)
# eigen 4.0.0-20241125.bcr.1 has issues with gitlab changing the checksum
# Cf. https://github.com/google/heir/issues/1840
bazel_dep(name = "eigen", version = "3.4.0.bcr.3")
bazel_dep(name = "soplex", version = "7.1.4.bcr.1")
bazel_dep(name = "or-tools", version = "9.12", repo_name = "com_google_ortools")
# openfhe deps that are needed for bundling openfhe with the python frontend
bazel_dep(name = "cereal", version = "1.3.2.bcr.3")
bazel_dep(name = "rapidjson", version = "1.1.0.bcr.20250205")
# Hermetic python setup
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
python.toolchain(python_version = "3.11")
python.toolchain(python_version = "3.12")
# or-tools requires python3.13
python.toolchain(python_version = "3.13")
pip.parse(
hub_name = "heir_pip_deps",
python_version = "3.11",
requirements_lock = "//:requirements.txt",
)
use_repo(python, python_3_11 = "python_3_11")
use_repo(pip, "heir_pip_deps")
# Go setup
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
# Bazel ignores go.mod for the purpose of selecting a go version. To see which
# go version will be used, run:
#
# bazel run @rules_go//go -- version
#
go_sdk.download(version = "1.24.2")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
# All *direct* Go dependencies of the module have to be listed explicitly.
use_repo(
go_deps,
"com_github_tuneinsight_lattigo_v6",
)
# compile_commands extracts the relevant compile data from bazel into
# `compile_commands.json` so that clangd, clang-tidy, etc., can use it.
# Whenever a build file changes, you must re-run
#
# bazel run @hedron_compile_commands//:refresh_all
#
# to ingest new data into these tools.
#
# See the project repo for more details and configuration options
# https://github.com/hedronvision/bazel-compile-commands-extractor
#
# For the override pointing to a different repo, see
# https://github.com/hedronvision/bazel-compile-commands-extractor/pull/219
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
commit = "02d15621b528efd877f5d5657c4b738523a0eb17",
remote = "https://github.com/mikael-s-persson/bazel-compile-commands-extractor",
)
bazel_dep(name = "rules_rust", version = "0.68.1")
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2024",
versions = ["1.92.0"],
)
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.spec(
features = ["derive"],
package = "clap",
version = "4.5.54",
)
crate.spec(
package = "rayon",
version = "1.11.0",
)
crate.spec(
features = ["derive"],
package = "serde",
version = "1.0.228",
)
crate.spec(
features = [
"boolean",
"shortint",
"integer",
],
package = "tfhe",
version = "1.5.0",
)
crate.from_specs()
use_repo(crate, "crates")