CMakeLists.txt 2.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
if(NOT WITH_DISTRIBUTE)
    return()
endif()

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

Q
Qiao Longfei 已提交
12 13
set(DISTRIBUTE_COMPILE_FLAGS "-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor")

G
gongweibao 已提交
14
if(WITH_GRPC)
15
  grpc_library(sendrecvop_rpc SRCS grpc_bytebuffer_stream.cc sendrecvop_utils.cc grpc_client.cc
16
        request_handler_impl.cc rpc_client.cc rpc_server.cc grpc_server.cc variable_response.cc grpc_variable_response.cc grpc_serde.cc collective_client.cc collective_server.cc
17
      PROTO send_recv.proto 
18
      DEPS lod_tensor selected_rows_functor memory)
Q
Qiao Longfei 已提交
19

G
gongweibao 已提交
20
  set_source_files_properties(grpc_serde_test.cc rpc_server_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
21

22
  cc_test(grpc_serde_test SRCS grpc_serde_test.cc 
23
    DEPS grpc++_unsecure grpc_unsecure gpr cares zlib protobuf sendrecvop_rpc scope profiler math_function SERIAL)
24

25
  cc_test(rpc_server_test SRCS rpc_server_test.cc
26
    DEPS sendrecvop_rpc grpc++_unsecure grpc_unsecure gpr cares zlib protobuf executor  proto_desc lookup_sparse_table_op SERIAL)
27

G
gongweibao 已提交
28
  cc_test(varhandle_test SRCS varhandle_test.cc DEPS profiler)
29 30 31

  if(WITH_GPU)
  cc_test(collective_server_test SRCS collective_server_test.cc 
32
      DEPS sendrecvop_rpc grpc++_unsecure grpc_unsecure gpr cares zlib protobuf executor
33 34 35
      selected_rows_functor  scope math_function SERIAL)
  endif()

36
  cc_library(parameter_prefetch SRCS parameter_prefetch.cc DEPS sendrecvop_rpc memory)
Q
Qiao Longfei 已提交
37
else()
38 39 40
  set_source_files_properties(brpc_server.cc parameter_prefetch.cc brpc_client.cc rpc_server_test.cc brpc_serde_test.cc
      brpc_variable_response.cc brpc_sendrecvop_utils.cc brpc_rdma_pool.cc collective_server.cc collective_server_test.cc
      collective_client.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
41

42 43
  brpc_library(sendrecvop_rpc SRCS brpc_client.cc brpc_server.cc rpc_server.cc rpc_client.cc request_handler_impl.cc brpc_sendrecvop_utils.cc
      brpc_variable_response.cc variable_response.cc sendrecvop_utils.cc brpc_rdma_pool.cc collective_client.cc collective_server.cc
Q
Qiao Longfei 已提交
44 45
    PROTO send_recv.proto
    DEPS lod_tensor selected_rows memory)
46

47
  cc_library(parameter_prefetch SRCS parameter_prefetch.cc DEPS sendrecvop_rpc memory)
G
gongweibao 已提交
48

49 50
  set(brpc_test_depends sendrecvop_rpc brpc ssl crypto protobuf leveldb gflags glog executor
      proto_desc lookup_sparse_table_op snappystream snappy zlib)
G
gongweibao 已提交
51

52
  cc_test(rpc_server_test SRCS rpc_server_test.cc
Q
Qiao Longfei 已提交
53
      DEPS ${brpc_test_depends} SERIAL)
G
gongweibao 已提交
54

Q
Qiao Longfei 已提交
55 56
  cc_test(brpc_serde_test SRCS brpc_serde_test.cc
      DEPS ${brpc_test_depends} SERIAL)
57 58 59 60 61

  if(WITH_GPU)
  cc_test(collective_server_test SRCS collective_server_test.cc 
      DEPS ${brpc_test_depends} selected_rows_functor  scope math_function SERIAL)
  endif()
Q
Qiao Longfei 已提交
62
endif()