CMakeLists.txt 2.0 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)
R
risemeup1 已提交
7 8
  file(MAKE_DIRECTORY
       ${PADDLE_BINARY_DIR}/python/paddle/distributed/fleet/proto)
9
  set(PSLIB_PROTO_DSTPATH
10
      "${PADDLE_SOURCE_DIR}/python/paddle/incubate/distributed/fleet/parameter_server/pslib/"
11
  )
12 13 14 15 16 17
  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/)
18 19 20 21
    add_custom_command(
      TARGET pslib_py_proto
      POST_BUILD
      COMMAND mv ps_pb2.py "${PSLIB_PROTO_DSTPATH}")
22
  else()
23 24 25 26 27 28
    string(
      REPLACE "/" "\\" fleet_proto_dstpath
              "${PADDLE_BINARY_DIR}/python/paddle/distributed/fleet/proto/")
    add_custom_command(
      TARGET ps_py_proto
      POST_BUILD
W
wangguanqun 已提交
29
      COMMAND copy /Y the_one_ps_pb2.py ${fleet_proto_dstpath}
30 31 32
      COMMENT
        "Copy generated python the_one_ps_pb2 into directory ${fleet_proto_dstpath}."
    )
33 34 35 36 37
    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})
38
  endif()
39 40 41
  message(
    STATUS
      "Copy generated python ps_pb2.py into directory ${PSLIB_PROTO_DSTPATH}")
W
wangguanqun 已提交
42 43
endif()

X
Xinger 已提交
44 45 46 47
if(WITH_RPC)
  add_subdirectory(rpc)
endif()

T
tangwei12 已提交
48
if(NOT WITH_PSCORE)
49
  return()
T
tangwei12 已提交
50 51
endif()

W
wangguanqun 已提交
52
proto_library(ps_framework_proto SRCS the_one_ps.proto)
T
tangwei12 已提交
53

54
set(DISTRIBUTE_COMPILE_FLAGS
55
    "-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=parentheses -Wno-error=unused-result"
56
)
T
tangwei12 已提交
57

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