-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
190 lines (157 loc) · 6.54 KB
/
MODULE.bazel
File metadata and controls
190 lines (157 loc) · 6.54 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
"""
This module file is used to manage external dependencies using Bzlmod.
Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
For more details, please check https://github.com/bazelbuild/bazel/issues/18958
"""
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
module(
name = "mmatrix",
version = "0.1.0",
)
######################################################################
# C/C++ external dependencies
######################################################################
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
bazel_dep(name = "apple_support", version = "1.24.2")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "rules_java", version = "9.0.3")
bazel_dep(name = "rules_foreign_cc", version = "0.14.0")
bazel_dep(name = "google_benchmark", version = "1.9.2")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "depend_on_what_you_use", version = "0.8.0")
bazel_dep(name = "openmp", version = "22.1.1")
# Required for objc_library / Apple-specific C(++) actions (e.g. MPS bridge)
apple_cc = use_extension("@apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")
use_repo(apple_cc, "local_config_apple_cc", "local_config_apple_cc_toolchains")
register_toolchains("@local_config_apple_cc_toolchains//:all")
######################################################################
# LLVM toolchain (C/C++/Rust)
######################################################################
bazel_dep(name = "toolchains_llvm", version = "1.6.0")
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
llvm_version = "20.1.0",
)
use_repo(llvm, "llvm_toolchain")
use_repo(llvm, "llvm_toolchain_llvm")
register_toolchains("@llvm_toolchain//:all")
#############################
# Compile Commands Extractor for Bazel (wolfd)
#############################
# https://github.com/wolfd/bazel-compile-commands
bazel_dep(name = "wolfd_bazel_compile_commands", version = "0.5.2", dev_dependency = True)
#############################
# Load external non-Bazel libraries
#############################
host_local_library = use_repo_rule("//tools:host_local_library.bzl", "host_local_library")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
# unity - A simple unit testing library for C.
# http_archive(
# name = "Unity",
# build_file = "@//:third_party/Unity.BUILD",
# sha256 = "4598298723ecca1f242b8c540a253ae4ab591f6810cbde72f128961007683034",
# strip_prefix = "Unity-2.5.2",
# urls = [
# "https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/v2.5.2.zip",
# ],
# )
# matio - A C library for reading and writing MATLAB MAT files.
http_archive(
name = "matio",
build_file = "@//:third_party/matio/matio.BUILD",
sha256 = "0a6aa00b18c4512b63a8d27906b079c8c6ed41d4b2844f7a4ae598e18d22d3b3",
strip_prefix = "matio-1.5.27",
urls = [
"https://github.com/tbeu/matio/releases/download/v1.5.27/matio-1.5.27.tar.gz",
],
)
git_repository(
name = "pcg",
build_file = "@//:third_party/pcg.BUILD",
commit = "83252d9c23df9c82ecb42210afed61a7b42402d7",
remote = "https://github.com/imneme/pcg-c.git",
)
# git_repository(
# name = "openblas",
# build_file = "@//:third_party/openblas.BUILD",
# commit = "02267d86f541fb82e3feae6647a0cbb4625f48df", # 29.05.2025
# remote = "https://github.com/OpenMathLib/OpenBLAS.git",
# )
#############################
# Hombrew Local Libraries (MacOS)
#############################
# define new_local_repository rule for local installed non-Bazel libraries:
new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
# unity from a local path
new_local_repository(
name = "Unity",
build_file = "@//:third_party/Unity.BUILD",
path = "/Users/uwe/Documents/Programmierung/3Party/Unity",
)
# due to license issues in private lib folder.
new_local_repository(
name = "hdf5",
path = "third_party/hdf5",
)
new_local_repository(
name = "log",
build_file = "@//:third_party/log.c/log.c.BUILD",
path = "third_party/log.c",
)
# libomp is now provided via bazel-registry as the 'openmp' module.
# See bazel_dep(name = "openmp", ...) above.
# openblas is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
host_local_library(
name = "openblas",
build_file = "@//:third_party/openblas.BUILD",
env_var = "OPENBLAS_ROOT",
linux_path = "/home/linuxbrew/.linuxbrew/opt/openblas",
macos_path = "/opt/homebrew/opt/openblas",
required_subdirs = [
"include",
"lib",
],
)
# suite-sparse is a collection of sparse matrix libraries
host_local_library(
name = "suitesparse",
build_file = "@//:third_party/suitesparse.BUILD",
env_var = "SUITESPARSE_ROOT",
linux_path = "/home/linuxbrew/.linuxbrew/opt/suite-sparse",
macos_path = "/opt/homebrew/opt/suite-sparse",
required_subdirs = [
"include",
"lib",
],
)
#############################
# Hombrew Local Libraries (Linux) - activate on Linux only
#############################
# # define new_local_repository rule for local installed non-Bazel libraries:
# new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
# # libomp is a library that supports multi-platform shared memory multiprocessing programming in C, C++, and Fortran.
# new_local_repository(
# name = "libomp",
# build_file = "@//:third_party/libomp.BUILD",
# path = "/home/linuxbrew/.linuxbrew/opt/libomp",
# )
# # openblas is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
# # new_local_repository(
# # name = "openblas",
# # build_file = "@//:third_party/openblas.BUILD",
# # path = "/home/linuxbrew/.linuxbrew/opt/openblas/",
# # )
# # suite-sparse is a collection of sparse matrix libraries
# new_local_repository(
# name = "suitesparse",
# build_file = "@//:third_party/suitesparse.BUILD",
# path = "/home/linuxbrew/.linuxbrew/opt/suite-sparse/",
# )