CMakeLists.txt 3.9 KB
Newer Older
T
tangwei12 已提交
1
return()
2 3 4 5 6 7

if(WITH_GRPC)
    set(cc_generic_services "false")
else()
    set(cc_generic_services "true")
endif()
8
configure_file(send_recv.proto.in ${CMAKE_CURRENT_SOURCE_DIR}/send_recv.proto @ONLY)
9

Q
Qiao Longfei 已提交
10 11 12
cc_library(async_sparse_param_update_recorder SRCS async_sparse_param_update_recorder.cc DEPS enforce simple_threadpool)
cc_test(async_sparse_param_update_recorder_test SRCS async_sparse_param_update_recorder_test.cc DEPS async_sparse_param_update_recorder)

13
cc_library(heart_beat_monitor SRCS heart_beat_monitor.cc DEPS enforce simple_threadpool)
T
tangwei12 已提交
14
cc_library(large_scale_kv SRCS large_scale_kv.cc DEPS enforce simple_threadpool device_context)
15 16
cc_test(heart_beat_monitor_test SRCS heart_beat_monitor_test.cc DEPS heart_beat_monitor)

W
Wu Yi 已提交
17
# FIXME(typhoonzero): use add_subdirectory once we clean the dependency of these files
Q
Qiao Longfei 已提交
18
set(DISTRIBUTE_COMPILE_FLAGS "-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor")
G
gongweibao 已提交
19
if(WITH_GRPC)
20
  set(GRPC_DEPS grpc++_unsecure grpc_unsecure gpr zlib protobuf)
W
Wu Yi 已提交
21 22 23 24 25 26
  set(GRPC_SRCS grpc/grpc_client.cc grpc/grpc_server.cc grpc/grpc_serde.cc grpc/grpc_bytebuffer_stream.cc grpc/grpc_variable_response.cc)
  grpc_library(sendrecvop_rpc SRCS sendrecvop_utils.cc
        request_handler_impl.cc rpc_client.cc rpc_server.cc
        variable_response.cc
        collective_client.cc collective_server.cc
        ${GRPC_SRCS}
27
      PROTO send_recv.proto 
28
      DEPS lod_tensor selected_rows_functor memory scope ${GRPC_DEPS} async_sparse_param_update_recorder heart_beat_monitor large_scale_kv)
Q
Qiao Longfei 已提交
29

G
gongweibao 已提交
30
  set_source_files_properties(grpc_serde_test.cc rpc_server_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
Y
Yiqun Liu 已提交
31
  set(RPC_DEPS sendrecvop_rpc ${GRPC_DEPS})
32

W
Wu Yi 已提交
33
  cc_test(grpc_serde_test SRCS grpc/grpc_serde_test.cc 
34
    DEPS ${RPC_DEPS} scope profiler math_function)
35

Q
Qiao Longfei 已提交
36
else()
G
gongweibao 已提交
37
  set(BRPC_SRCS brpc/brpc_client.cc brpc/brpc_server.cc brpc/brpc_sendrecvop_utils.cc brpc/brpc_variable_response.cc brpc/brpc_rdma_pool.cc)
Q
can run  
Qiao Longfei 已提交
38
  set_source_files_properties(${BRPC_SRCS} parameter_prefetch.cc parameter_send.cc parameter_recv.cc communicator.cc rpc_server_test.cc brpc/brpc_serde_test.cc collective_server.cc collective_server_test.cc collective_client.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
39

40
  set(BRPC_DEPS brpc ssl crypto protobuf leveldb zlib)
41

W
Wu Yi 已提交
42 43 44 45 46
  brpc_library(sendrecvop_rpc SRCS sendrecvop_utils.cc
      request_handler_impl.cc rpc_client.cc rpc_server.cc
      variable_response.cc
      collective_client.cc collective_server.cc
      ${BRPC_SRCS}
G
gongweibao 已提交
47
    PROTO send_recv.proto
48
    DEPS lod_tensor selected_rows memory scope ${BRPC_DEPS})
49

50
  set(RPC_DEPS sendrecvop_rpc ${BRPC_DEPS})
W
Wu Yi 已提交
51
  cc_test(brpc_serde_test SRCS brpc/brpc_serde_test.cc
52
      DEPS ${RPC_DEPS} gflags glog executor proto_desc lookup_sparse_table_read_op)
W
Wu Yi 已提交
53
endif()
G
gongweibao 已提交
54

55

W
Wu Yi 已提交
56
cc_test(rpc_server_test SRCS rpc_server_test.cc
57
    DEPS ${RPC_DEPS} executor scope proto_desc lookup_sparse_table_read_op checkpoint_notify_op scale_op )
Q
Qiao Longfei 已提交
58
cc_test(varhandle_test SRCS varhandle_test.cc DEPS profiler scope)
59
cc_library(parameter_prefetch SRCS parameter_prefetch.cc DEPS sendrecvop_rpc memory node)
Q
Qiao Longfei 已提交
60
cc_library(parameter_send SRCS parameter_send.cc DEPS sendrecvop_rpc memory)
Q
Qiao Longfei 已提交
61
cc_library(parameter_recv SRCS parameter_recv.cc DEPS sendrecvop_rpc memory)
62
cc_library(communicator SRCS communicator.cc DEPS scope selected_rows tensor variable_helper selected_rows_functor simple_threadpool parameter_send parameter_recv generator)
Q
Qiao Longfei 已提交
63
cc_test(communicator_test SRCS communicator_test.cc DEPS communicator)
64
if(WITH_GPU OR WITH_ROCM)
W
Wu Yi 已提交
65
    cc_test(collective_server_test SRCS collective_server_test.cc 
G
gongweibao 已提交
66
        DEPS sendrecvop_rpc executor ${RPC_DEPS}
67
        selected_rows_functor  scope math_function)
Q
Qiao Longfei 已提交
68
endif()
Y
YUNSHEN XIE 已提交
69
if(WITH_TESTING)
70 71 72 73 74 75
    if(TEST rpc_server_test)
        set_tests_properties(rpc_server_test PROPERTIES TIMEOUT 120)
    endif()
    if(TEST heart_beat_monitor_test)
        set_tests_properties(heart_beat_monitor_test PROPERTIES TIMEOUT 120)
    endif()
Y
YUNSHEN XIE 已提交
76
endif()