forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
102 lines (96 loc) · 2.26 KB
/
BUILD.bazel
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
# 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",
"src/ray/worker/default_worker.cc",
]),
hdrs = glob([
"include/ray/*.h",
"include/ray/**/*.h",
"include/ray/**/**/*.h",
]),
copts = COPTS,
linkopts = ["-ldl"],
linkstatic = True,
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"//:core_worker_lib",
"//:ray_common",
"//:ray_util",
"@boost//:asio",
"@boost//:thread",
"@com_google_absl//absl/synchronization",
"@msgpack",
],
)
cc_binary(
name = "example",
testonly = 1,
srcs = glob([
"src/example/example.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",
testonly = 0,
srcs = glob([
"src/ray/test/cluster/*.cc",
]),
copts = COPTS,
linkstatic = True,
deps = [
"ray_api",
"@com_google_googletest//:gtest_main",
],
)
genrule(
name = "ray_cpp_pkg",
srcs = [
"cluster_mode_test",
"ray_api",
],
outs = ["ray_cpp_pkg.out"],
cmd = """
WORK_DIR="$$(pwd)" &&
mkdir -p "$$WORK_DIR/python/ray/core/src/ray/cpp/" &&
cp -f $(location cluster_mode_test) "$$WORK_DIR/python/ray/core/src/ray/cpp/default_worker" &&
cp -f $(locations ray_api) "$$WORK_DIR/python/ray/core/src/ray/cpp/" &&
echo "$$WORK_DIR" > $@
""",
local = 1,
)