forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.jemalloc
32 lines (28 loc) · 991 Bytes
/
BUILD.jemalloc
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
load("@rules_foreign_cc//foreign_cc:configure.bzl", "configure_make")
load("@com_github_ray_project_ray//bazel:ray.bzl", "filter_files_with_suffix")
filegroup(
name = "all",
srcs = glob(["**"]),
)
configure_make(
name = "libjemalloc",
lib_source = ":all",
linkopts = ["-ldl"],
copts = ["-fPIC"],
args = ["-j"],
out_shared_libs = ["libjemalloc.so"],
# See https://salsa.debian.org/debian/jemalloc/-/blob/c0a88c37a551be7d12e4863435365c9a6a51525f/debian/rules#L8-23
# for why we are setting "--with-lg-page" on non x86 hardware here.
configure_options = ["--disable-static", "--enable-prof", "--enable-prof-libunwind"] +
select({
"@platforms//cpu:x86_64": [],
"//conditions:default": ["--with-lg-page=16"],
}),
visibility = ["//visibility:public"],
)
filter_files_with_suffix(
name = "shared",
srcs = ["@jemalloc//:libjemalloc"],
suffix = ".so",
visibility = ["//visibility:public"],
)