Skip to content

Commit 5baa6b6

Browse files
lwfacebook-github-bot
authored andcommittedMay 2, 2020
Add a Bazel build config for TensorPipe (pytorch#37691)
Summary: See pytorch#37671 for the CI signals once the TensorPipe RPC agent is added. Pull Request resolved: pytorch#37691 Reviewed By: malfet Differential Revision: D21359470 Pulled By: lw fbshipit-source-id: 577dd6d73a4a11d67b50d8686628dc6d8b24201d
1 parent d639418 commit 5baa6b6

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed
 

‎BUILD.bazel

+2
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,7 @@ cc_library(
17401740
"@gloo",
17411741
"@onnx",
17421742
"@fmt",
1743+
"@tensorpipe",
17431744
] + if_cuda(
17441745
[
17451746
":caffe2_cpp_cuda",
@@ -1776,6 +1777,7 @@ cu_library(
17761777
"@cudnn",
17771778
"@eigen",
17781779
"@gloo",
1780+
"@tensorpipe",
17791781
],
17801782
alwayslink = True,
17811783
)

‎WORKSPACE

+6
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ new_patched_local_repository(
129129
path = "third_party/tbb",
130130
)
131131

132+
new_local_repository(
133+
name = "tensorpipe",
134+
build_file = "//third_party:tensorpipe.BUILD",
135+
path = "third_party/tensorpipe",
136+
)
137+
132138
http_archive(
133139
name = "mkl",
134140
build_file = "//third_party:mkl.BUILD",

‎third_party/tensorpipe.BUILD

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_library")
2+
3+
LIBUV_COMMON_SRCS = [
4+
"third_party/libuv/src/fs-poll.c",
5+
"third_party/libuv/src/idna.c",
6+
"third_party/libuv/src/inet.c",
7+
"third_party/libuv/src/strscpy.c",
8+
"third_party/libuv/src/threadpool.c",
9+
"third_party/libuv/src/timer.c",
10+
"third_party/libuv/src/uv-data-getter-setters.c",
11+
"third_party/libuv/src/uv-common.c",
12+
"third_party/libuv/src/version.c",
13+
]
14+
15+
LIBUV_POSIX_SRCS = [
16+
"third_party/libuv/src/unix/async.c",
17+
"third_party/libuv/src/unix/core.c",
18+
"third_party/libuv/src/unix/dl.c",
19+
"third_party/libuv/src/unix/fs.c",
20+
"third_party/libuv/src/unix/getaddrinfo.c",
21+
"third_party/libuv/src/unix/getnameinfo.c",
22+
"third_party/libuv/src/unix/loop.c",
23+
"third_party/libuv/src/unix/loop-watcher.c",
24+
"third_party/libuv/src/unix/pipe.c",
25+
"third_party/libuv/src/unix/poll.c",
26+
"third_party/libuv/src/unix/process.c",
27+
"third_party/libuv/src/unix/signal.c",
28+
"third_party/libuv/src/unix/stream.c",
29+
"third_party/libuv/src/unix/tcp.c",
30+
"third_party/libuv/src/unix/thread.c",
31+
"third_party/libuv/src/unix/tty.c",
32+
"third_party/libuv/src/unix/udp.c",
33+
]
34+
35+
LIBUV_LINUX_SRCS = LIBUV_POSIX_SRCS + [
36+
"third_party/libuv/src/unix/linux-core.c",
37+
"third_party/libuv/src/unix/linux-inotify.c",
38+
"third_party/libuv/src/unix/linux-syscalls.c",
39+
"third_party/libuv/src/unix/procfs-exepath.c",
40+
"third_party/libuv/src/unix/sysinfo-loadavg.c",
41+
]
42+
43+
cc_library(
44+
name = "libuv",
45+
srcs = LIBUV_COMMON_SRCS + LIBUV_LINUX_SRCS,
46+
includes = [
47+
"third_party/libuv/include",
48+
"third_party/libuv/src",
49+
],
50+
hdrs = glob(
51+
[
52+
"third_party/libuv/include/*.h",
53+
"third_party/libuv/include/uv/*.h",
54+
"third_party/libuv/src/*.h",
55+
"third_party/libuv/src/unix/*.h",
56+
],
57+
),
58+
visibility = ["//visibility:public"],
59+
)
60+
61+
proto_library(
62+
name = "tensorpipe_proto_source",
63+
srcs = glob([
64+
"tensorpipe/proto/*.proto",
65+
"tensorpipe/proto/*/*.proto",
66+
]),
67+
visibility = ["//visibility:public"],
68+
)
69+
70+
cc_proto_library(
71+
name = "tensorpipe_protos",
72+
deps = [":tensorpipe_proto_source"],
73+
)
74+
75+
cc_library(
76+
name = "tensorpipe",
77+
srcs = glob(
78+
[
79+
"tensorpipe/*.cc",
80+
"tensorpipe/channel/*.cc",
81+
"tensorpipe/channel/*/*.cc",
82+
"tensorpipe/common/*.cc",
83+
"tensorpipe/core/*.cc",
84+
"tensorpipe/transport/*.cc",
85+
"tensorpipe/transport/*/*.cc",
86+
"tensorpipe/util/*/*.cc",
87+
],
88+
),
89+
hdrs = glob(
90+
[
91+
"tensorpipe/*.h",
92+
"tensorpipe/channel/*.h",
93+
"tensorpipe/channel/*/*.h",
94+
"tensorpipe/common/*.h",
95+
"tensorpipe/core/*.h",
96+
"tensorpipe/transport/*.h",
97+
"tensorpipe/transport/*/*.h",
98+
"tensorpipe/util/*/*.h",
99+
],
100+
),
101+
includes = [
102+
".",
103+
],
104+
copts = [
105+
"-std=c++14",
106+
],
107+
visibility = ["//visibility:public"],
108+
deps = [":tensorpipe_protos", ":libuv"],
109+
)

0 commit comments

Comments
 (0)
Please sign in to comment.