-
Notifications
You must be signed in to change notification settings - Fork 224
Expand file tree
/
Copy pathMODULE.bazel
More file actions
216 lines (192 loc) · 9.67 KB
/
MODULE.bazel
File metadata and controls
216 lines (192 loc) · 9.67 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
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
#===============================================================================
# Copyright contributors to the oneDAL project
#
# 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
#
# http://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 = "onedal")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "rules_shell", version = "0.7.1")
bazel_dep(name = "fmt", version = "12.1.0")
declare_onedal_config = use_repo_rule("@onedal//dev/bazel/config:config.bzl", "declare_onedal_config")
declare_onedal_config(name = "config",)
sh_config_ext = use_extension("@onedal//dev/bazel/toolchains:cc_toolchain_extension.bzl", "cc_toolchain_extension")
use_repo(sh_config_ext, "onedal_cc_toolchain")
register_toolchains("@{}//:all".format("onedal_cc_toolchain"))
extra_toolchain_ext = use_extension("@onedal//dev/bazel/toolchains:extra_toolchain_extension.bzl", "onedal_extra_toolchain_extension")
use_repo(extra_toolchain_ext, "onedal_extra_toolchain")
register_toolchains("@{}//:all".format("onedal_extra_toolchain"))
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "catch2",
url = "https://github.com/catchorg/Catch2/archive/v3.9.1.tar.gz",
sha256 = "a215c2a723bd7483efd236dc86066842a389cb4e344c61119c978acdf24d39be",
strip_prefix = "Catch2-3.9.1",
build_file = "//dev/bazel/deps:catch2.BUILD",
)
opencl_repo = use_repo_rule("@onedal//dev/bazel/deps:opencl.bzl", "opencl_repo")
opencl_repo(name = "opencl")
# GNU OpenMP (libgomp) - required by MKL gnu_thread
openmp_repo = use_repo_rule("@onedal//dev/bazel/deps:openmp.bzl", "openmp_repo")
openmp_repo(
name = "openmp",
root_env_var = "GOMPROOT",
urls = [
"https://anaconda.org/conda-forge/libgomp/14.2.0/download/linux-64/libgomp-14.2.0-h77fa898_1.conda",
],
sha256s = [
"1911c29975ec99b6b906904040c855772ccb265a1c79d5d75c8ceec4ed89cd63",
],
strip_prefixes = [
"", # libgomp .conda extracts directly
],
)
openblas_repo = use_repo_rule("@onedal//dev/bazel/deps:openblas.bzl", "openblas_repo")
openblas_repo(name = "openblas", root_env_var = "OPENBLASROOT",)
tbb_repo = use_repo_rule("@onedal//dev/bazel/deps:tbb.bzl", "tbb_repo")
tbb_repo(
name = "tbb",
root_env_var = "TBBROOT",
urls = [
"https://files.pythonhosted.org/packages/cd/5c/019acaccf0038b8e05b0a54189439d0987891017a84ca43675589f7e460c/tbb-2022.2.0-py2.py3-none-manylinux_2_28_x86_64.whl",
"https://files.pythonhosted.org/packages/75/b8/de55540aecc77a7f308db1b0667e017578be7d4c18d7235cbc8f1fd1f59a/tbb_devel-2022.2.0-py2.py3-none-manylinux_2_28_x86_64.whl",
],
sha256s = [
"522189f3e370a6b9c92b8a7fbdecf3633f7c53f0ea4eb8d6891a7f5f00c78099",
"3cf12760779cdbdad1006112a1384e1f8853e46f8bc7a41e7e7bcfd5557b6983",
],
strip_prefixes = [
"tbb-2022.2.0.data/data",
"tbb_devel-2022.2.0.data/data",
]
)
mpi_repo = use_repo_rule("@onedal//dev/bazel/deps:mpi.bzl", "mpi_repo")
mpi_repo(
name = "mpi",
root_env_var = "MPIROOT",
urls = [
"https://files.pythonhosted.org/packages/e5/44/6867aebd60d8b8bcf8f7e3b1fa781debd4fc3df16bfb1525e732570ea214/impi_rt-2021.16.1-py2.py3-none-manylinux_2_28_x86_64.whl",
"https://files.pythonhosted.org/packages/41/75/46b81412f336dde770a56960c7b10af6860efa4dd3aa9796d5eb2645644a/impi_devel-2021.16.1-py2.py3-none-manylinux_2_28_x86_64.whl",
],
sha256s = [
"0f70499bc42eab6923c0ae8fa6dd409c047d93626d686ac21d04e295b120bb95",
"d1081a1647a4de521e2680983629d627704364a07f16c60aaec0bb85535e25bd",
],
strip_prefixes = [
"impi_rt-2021.16.1.data/data",
"impi_devel-2021.16.1.data/data",
]
)
ccl_repo = use_repo_rule("@onedal//dev/bazel/deps:ccl.bzl", "ccl_repo")
ccl_repo(
name = "ccl",
root_env_var = "CCL_ROOT",
urls = [
"https://files.pythonhosted.org/packages/20/84/80906846a15a688214479b30c5a25044f3356216f6ee473b5f33010d7db0/oneccl-2021.16.2-py2.py3-none-manylinux_2_28_x86_64.whl",
],
sha256s = [
"83fa5c0ac8e7c06569480fd27eb5f26a3bb383902277e2d22c93212b6cf26e9e",
],
strip_prefixes = [
"oneccl-2021.16.2.data/data",
]
)
dpl_repo = use_repo_rule("@onedal//dev/bazel/deps:dpl.bzl", "dpl_repo")
dpl_repo(
name = "dpl",
root_env_var = "DPL_ROOT",
urls = [
"https://files.pythonhosted.org/packages/73/54/1bac6739304afa4d598e022e9ff5e988c58e4bef1be0f16623061dfa12ee/onedpl_devel-2022.9.0-py2.py3-none-manylinux_2_28_x86_64.whl",
],
sha256s = [
"6d4410d565cceb9160e756d189b3adab1a54d2c1ac3055a268189298961bc57b",
],
strip_prefixes = [
"onedpl_devel-2022.9.0.data/data",
],
)
# oneMKL dependencies for Bazel build.
#
# NOTE:
# PyPI packages provide only the versioned .so files (e.g., libmkl_blas_sycl.so.5),
# but for building and linking we also need the unversioned symlinks (e.g., libmkl_blas_sycl.so).
# Anaconda packages provide both, so we use them to ensure proper dynamic linking.
#
mkl_repo = use_repo_rule("@onedal//dev/bazel/deps:mkl.bzl", "mkl_repo")
mkl_repo(
name = "mkl",
root_env_var = "MKLROOT",
urls = [
# Due to issues with dispatcher, its not possible to use dynamic mkl core in bazel
# There are conflicts between avx512/avx2/cm3/def symbols in cc_library
# TODO: investigate the how to provide global runtime dependencies in bazel.
# Core static MKL runtime libraries (.a)
# Includes libmkl_intel_lp64.a, libmkl_core.a, libmkl_sequential.a, etc.
"https://anaconda.org/conda-forge/mkl-static/2025.2.0/download/linux-64/mkl-static-2025.2.0-ha770c72_629.conda",
# Header files for classic MKL (C/C++) interface(mkl_include_)
# Contains "mkl.h" and related headers, not using oneAPI directory structure
"https://files.pythonhosted.org/packages/11/58/6f583b3bac7d3952a89a00ab34e61baa17f6d6de3454a8005958289bef22/mkl_include-2025.2.0-py2.py3-none-manylinux_2_28_x86_64.whl",
# oneMKL SYCL C++ headers (DPC++/SYCL interface)
# Provides headers for SYCL-based oneAPI MKL development (e.g., onemkl/*.hpp)
"https://files.pythonhosted.org/packages/67/60/183badc2d807be1abb95a20315e84a2075cb44a1d1ede104d42cb1ed3092/onemkl_sycl_include-2025.2.0-py2.py3-none-manylinux_2_28_x86_64.whl",
# oneMKL SYCL - BLAS domain
# Provides libmkl_sycl_blas.so.5 with SYCL-enabled BLAS (e.g., GEMM, AXPY)
"https://anaconda.org/conda-forge/onemkl-sycl-blas/2025.2.0/download/linux-64/onemkl-sycl-blas-2025.2.0-haf5e11a_628.conda",
# oneMKL SYCL - LAPACK domain
# Provides libmkl_sycl_lapack.so.5 for linear algebra (e.g., LU, QR, eigenvalues)
"https://anaconda.org/conda-forge/onemkl-sycl-lapack/2025.2.0/download/linux-64/onemkl-sycl-lapack-2025.2.0-haf5e11a_628.conda",
# oneMKL SYCL - Sparse domain
# Provides libmkl_sycl_sparse.so.5 for sparse matrix operations and solvers
"https://anaconda.org/conda-forge/onemkl-sycl-sparse/2025.2.0/download/linux-64/onemkl-sycl-sparse-2025.2.0-haf5e11a_628.conda",
# oneMKL SYCL - Random Number Generator (RNG)
# Provides libmkl_sycl_rng.so.5 for random number generation with SYCL
"https://anaconda.org/conda-forge/onemkl-sycl-rng/2025.2.0/download/linux-64/onemkl-sycl-rng-2025.2.0-haf5e11a_628.conda",
# oneMKL devel core
# Provides libmkl_core.so.2 for correct SYCL execution
"https://anaconda.org/conda-forge/mkl/2025.3.0/download/linux-64/mkl-2025.3.0-h0e700b2_463.conda",
],
sha256s = [
# Core static MKL runtime libraries (.a)
"a982243984e68abc692ad1c855902163f646d0c2121e8821c54c28e77f1939ec",
# Header files for classic MKL (C/C++) interface(mkl_include)
"691ceaccf6d960e19d47304d24ca2ee4e807810077e93c1c86c2e32cd6223012",
# oneMKL SYCL C++ headers (DPC++/SYCL interface)
"4e995c02e5f43265aa830a06e538b2e5ada76b7c2785c26b788d6073ba605b0f",
# oneMKL SYCL - BLAS domain
"0748e4f91e328f4ae995013b10ae79966f80cf62a72e76495dfe1841cd022235",
# oneMKL SYCL - LAPACK domain
"e56ec1e4e0fbfa28783a28e99337ca541934cb3aaaa0ecca469a27dab2f3a762",
# oneMKL SYCL - Sparse domain
"b2cdba1894464927a05115c04bcc1a5b64e25c116c45ae44c75990c101162b35",
# oneMKL SYCL - Random Number Generator (RNG)
"e5664adaca1c2e15a771b0d67ec7691137c8ba8e0a5a6af6fdffece9ae37692e",
# oneMKL devel
"659d79976f06d2b796a0836414573a737a0856b05facfa77e5cc114081a8b3d4",
],
strip_prefixes = [
"", # mkl-static .conda extracts directly to lib/, no .data/data wrapper
"mkl_include-2025.2.0.data/data",
"onemkl_sycl_include-2025.2.0.data/data",
"", # onemkl-sycl-blas .conda extracts directly
"", # onemkl-sycl-lapack .conda extracts directly
"", # onemkl-sycl-sparse .conda extracts directly
"", # onemkl-sycl-rng .conda extracts directly
"", # onemkl devel
],
)
onedal_repo = use_repo_rule("@onedal//dev/bazel/deps:onedal.bzl", "onedal_repo")
onedal_repo(
name = "onedal_release",
root_env_var = "DALROOT",
)