CMakeLists.txt 2.2 KB
Newer Older
1
add_subdirectory(auto_parallel)
2
add_subdirectory(collective)
L
LiYuRio 已提交
3
add_subdirectory(fleet_executor)
W
wangguanqun 已提交
4
if(WITH_PYTHON)
5
  py_proto_compile(pslib_py_proto SRCS ps.proto)
W
wangguanqun 已提交
6
  py_proto_compile(ps_py_proto SRCS the_one_ps.proto)
7 8 9 10
  add_custom_target(
    ps_py_proto_init ALL
    COMMAND ${CMAKE_COMMAND} -E make_directory
            ${PADDLE_BINARY_DIR}/python/paddle/distributed/fleet/proto)
11
  add_dependencies(ps_py_proto ps_py_proto_init)
12 13 14
  set(PSLIB_PROTO_DSTPATH
      "${PADDLE_SOURCE_DIR}/python/paddle/fluid/incubate/fleet/parameter_server/pslib/"
  )
15 16 17 18 19 20
  if(NOT WIN32)
    add_custom_command(
      TARGET ps_py_proto
      POST_BUILD
      COMMAND mv the_one_ps_pb2.py
              ${PADDLE_BINARY_DIR}/python/paddle/distributed/fleet/proto/)
21 22 23 24
    add_custom_command(
      TARGET pslib_py_proto
      POST_BUILD
      COMMAND mv ps_pb2.py "${PSLIB_PROTO_DSTPATH}")
25
  else()
26 27 28 29 30 31
    string(
      REPLACE "/" "\\" fleet_proto_dstpath
              "${PADDLE_BINARY_DIR}/python/paddle/distributed/fleet/proto/")
    add_custom_command(
      TARGET ps_py_proto
      POST_BUILD
W
wangguanqun 已提交
32
      COMMAND copy /Y the_one_ps_pb2.py ${fleet_proto_dstpath}
33 34 35
      COMMENT
        "Copy generated python the_one_ps_pb2 into directory ${fleet_proto_dstpath}."
    )
36 37 38 39 40
    string(REPLACE "/" "\\" PSLIB_PROTO_DSTPATH "${PSLIB_PROTO_DSTPATH}")
    add_custom_command(
      TARGET pslib_py_proto
      POST_BUILD
      COMMAND copy /Y ps_pb2.py ${PSLIB_PROTO_DSTPATH})
41
  endif()
42 43 44
  message(
    STATUS
      "Copy generated python ps_pb2.py into directory ${PSLIB_PROTO_DSTPATH}")
W
wangguanqun 已提交
45 46
endif()

X
Xinger 已提交
47 48 49 50
if(WITH_RPC)
  add_subdirectory(rpc)
endif()

T
tangwei12 已提交
51
if(NOT WITH_PSCORE)
52
  return()
T
tangwei12 已提交
53 54
endif()

W
wangguanqun 已提交
55
proto_library(ps_framework_proto SRCS the_one_ps.proto)
T
tangwei12 已提交
56

57
set(DISTRIBUTE_COMPILE_FLAGS
58
    "-Wno-error=unused-value -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=unknown-pragmas -Wno-error=parentheses -Wno-error=unused-result"
59
)
T
tangwei12 已提交
60

61 62
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
  set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new")
T
tangwei12 已提交
63
endif()
64
add_subdirectory(common)
65
add_subdirectory(ps)
T
tangwei12 已提交
66
add_subdirectory(test)
1
123malin 已提交
67
add_subdirectory(index_dataset)