BUILD.jemalloc 964 B

1234567891011121314151617181920212223242526272829303132
  1. load("@rules_foreign_cc//foreign_cc:configure.bzl", "configure_make")
  2. load("@com_github_ray_project_ray//bazel:ray.bzl", "filter_files_with_suffix")
  3. filegroup(
  4. name = "all",
  5. srcs = glob(["**"]),
  6. )
  7. configure_make(
  8. name = "libjemalloc",
  9. lib_source = ":all",
  10. linkopts = ["-ldl"],
  11. copts = ["-fPIC"],
  12. args = ["-j"],
  13. out_shared_libs = ["libjemalloc.so"],
  14. # See https://salsa.debian.org/debian/jemalloc/-/blob/c0a88c37a551be7d12e4863435365c9a6a51525f/debian/rules#L8-23
  15. # for why we are setting "--with-lg-page" on non x86 hardware here.
  16. configure_options = ["--disable-static", "--enable-prof"] +
  17. select({
  18. "@platforms//cpu:x86_64": [],
  19. "//conditions:default": ["--with-lg-page=16"],
  20. }),
  21. visibility = ["//visibility:public"],
  22. )
  23. filter_files_with_suffix(
  24. name = "shared",
  25. srcs = ["@jemalloc//:libjemalloc"],
  26. suffix = ".so",
  27. visibility = ["//visibility:public"],
  28. )