mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
125 lines
2.6 KiB
Text
125 lines
2.6 KiB
Text
# Bazel build
|
|
# C/C++ documentation: https://docs.bazel.build/versions/master/be/c-cpp.html
|
|
|
|
load("//bazel:ray.bzl", "COPTS")
|
|
|
|
cc_library(
|
|
name = "ray_api",
|
|
srcs = glob([
|
|
"src/ray/api.cc",
|
|
"src/ray/api/*.cc",
|
|
"src/ray/api/*.h",
|
|
"src/ray/app/*.cc",
|
|
"src/ray/app/*.h",
|
|
"src/ray/runtime/*.cc",
|
|
"src/ray/runtime/*.h",
|
|
"src/ray/runtime/**/*.cc",
|
|
"src/ray/runtime/**/*.h",
|
|
"src/ray/runtime/task/*.cc",
|
|
"src/ray/runtime/task/*.h",
|
|
"src/ray/util/*.cc",
|
|
"src/ray/util/*.h",
|
|
"src/ray/*.cc",
|
|
"src/ray/*.h",
|
|
]),
|
|
hdrs = glob([
|
|
"include/ray/*.h",
|
|
"include/ray/**/*.h",
|
|
"include/ray/**/**/*.h",
|
|
]),
|
|
copts = COPTS,
|
|
linkopts = ["-ldl"],
|
|
strip_include_prefix = "include",
|
|
# linkstatic = False,
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//:core_worker_lib",
|
|
"//:ray_common",
|
|
"//:ray_util",
|
|
"@boost//:asio",
|
|
"@boost//:thread",
|
|
"@com_google_absl//absl/synchronization",
|
|
"@msgpack",
|
|
],
|
|
)
|
|
|
|
cc_binary(
|
|
name = "default_worker",
|
|
srcs = [
|
|
"src/ray/worker/default_worker.cc",
|
|
],
|
|
copts = COPTS,
|
|
linkstatic = True,
|
|
deps = [
|
|
"//:core_worker_lib",
|
|
],
|
|
)
|
|
|
|
genrule(
|
|
name = "ray_cpp_pkg",
|
|
srcs = [
|
|
"default_worker",
|
|
"ray_api",
|
|
],
|
|
outs = ["ray_cpp_pkg.out"],
|
|
cmd = """
|
|
WORK_DIR="$$(pwd)" &&
|
|
mkdir -p "$$WORK_DIR/python/ray/core/src/ray/cpp/" &&
|
|
cp -f $(location default_worker) "$$WORK_DIR/python/ray/core/src/ray/cpp/" &&
|
|
cp -f $(locations ray_api) "$$WORK_DIR/python/ray/core/src/ray/cpp/" &&
|
|
echo "$$WORK_DIR" > $@
|
|
""",
|
|
local = 1,
|
|
)
|
|
|
|
cc_binary(
|
|
name = "example",
|
|
testonly = 1,
|
|
srcs = glob([
|
|
"src/example/example.cc",
|
|
]),
|
|
copts = COPTS,
|
|
linkstatic = False,
|
|
deps = [
|
|
"ray_api",
|
|
],
|
|
)
|
|
|
|
cc_binary(
|
|
name = "example_cluster_mode",
|
|
testonly = 1,
|
|
srcs = glob([
|
|
"src/example/example_cluster_mode.cc",
|
|
]),
|
|
copts = COPTS,
|
|
linkstatic = False,
|
|
deps = [
|
|
"ray_api",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "api_test",
|
|
srcs = glob([
|
|
"src/ray/test/*.cc",
|
|
]),
|
|
copts = COPTS,
|
|
linkstatic = False,
|
|
deps = [
|
|
"ray_api",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "cluster_mode_test",
|
|
srcs = glob([
|
|
"src/ray/test/cluster/*.cc",
|
|
]),
|
|
copts = COPTS,
|
|
linkstatic = False,
|
|
deps = [
|
|
"ray_api",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|