-
Couldn't load subscription status.
- Fork 5.9k
Improve Go cmake, add go/master/c into cmake include path.. #2659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,3 @@ | ||
| cmake_minimum_required(VERSION 3.0) | ||
|
|
||
| get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) | ||
| get_filename_component(PARENT_DIR ${PARENT_DIR} DIRECTORY) | ||
| set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PARENT_DIR}/cmake") | ||
|
|
||
| project(cxx_go C Go) | ||
|
|
||
| include(golang) | ||
| include(flags) | ||
|
|
||
| set(MASTER_LIB_NAME "paddle_master") | ||
| go_library(${MASTER_LIB_NAME} SHARED) | ||
|
|
||
| if(PROJ_ROOT) | ||
| add_custom_command(OUTPUT ${PROJ_ROOT}/python/paddle/v2/master/lib${MASTER_LIB_NAME}.so | ||
| COMMAND rm ${CMAKE_CURRENT_BINARY_DIR}/lib${MASTER_LIB_NAME}.h | ||
| COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/lib${MASTER_LIB_NAME}.so ${PROJ_ROOT}/python/paddle/v2/master/ | ||
| DEPENDS ${MASTER_LIB_NAME}) | ||
| add_custom_target(paddle_master_shared ALL DEPENDS ${PROJ_ROOT}/python/paddle/v2/master/lib${MASTER_LIB_NAME}.so) | ||
| endif(PROJ_ROOT) | ||
| go_library(paddle_master SHARED) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
|
|
||
| cc_library(main SRCS main.c DEPS paddle_pserver_cclient) | ||
| cc_binary(main SRCS main.c DEPS paddle_pserver_cclient) | ||
| cc_test(test_cclient SRCS test_cclient.c DEPS paddle_pserver_cclient) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,18 +7,26 @@ file(GLOB UTILS_PY_FILES . ./paddle/utils/*.py) | |
| file(GLOB_RECURSE V2_PY_FILES ./paddle/v2/ *.py) | ||
|
|
||
| set(PY_FILES paddle/__init__.py | ||
| ${TRAINER_PY_FILES} | ||
| ${HELPERS_PY_FILES} | ||
| ${UTILS_PY_FILES} | ||
| ${V2_PY_FILES}) | ||
| ${TRAINER_PY_FILES} | ||
| ${HELPERS_PY_FILES} | ||
| ${UTILS_PY_FILES} | ||
| ${V2_PY_FILES}) | ||
|
|
||
| add_custom_target(copy_paddle_master) | ||
| if(WITH_GOLANG) | ||
| add_custom_command(TARGET copy_paddle_master | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. configure_file( If the input file is modified the build system will re-run CMake to re-configure the file and generate the build system again. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After talking with @gangliao , we decide not to change here, since it depends on target |
||
| COMMAND cp ${paddle_master_LIB_PATH} ${PROJ_ROOT}/python/paddle/v2/master/ | ||
| ) | ||
| add_dependencies(copy_paddle_master paddle_master) | ||
| endif(WITH_GOLANG) | ||
|
|
||
| configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in | ||
| ${CMAKE_CURRENT_BINARY_DIR}/setup.py) | ||
|
|
||
| add_custom_command(OUTPUT ${OUTPUT_DIR}/.timestamp | ||
| COMMAND env ${py_env} ${PYTHON_EXECUTABLE} setup.py bdist_wheel | ||
| COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT_DIR}/.timestamp | ||
| DEPENDS gen_proto_py ${PY_FILES} ${external_project_dependencies}) | ||
| DEPENDS gen_proto_py ${PY_FILES} ${external_project_dependencies} copy_paddle_master) | ||
|
|
||
| add_custom_target(paddle_python ALL DEPENDS | ||
| ${OUTPUT_DIR}/.timestamp) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,6 +56,7 @@ | |
| 'plot', | ||
| 'evaluator', | ||
| 'image', | ||
| 'master', | ||
| ] | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can put this configuration into
configure.cmaketo keep the root CMAKE FILE as simple as possible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Done.