diff --git a/CMakeLists.txt b/CMakeLists.txt index 5762baa2579396e42f9aacbe21287a597a1a4f82..c5d7f2c7ec76dcc7befcd16798d26a7d54a19328 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ option(WITH_COVERAGE "Compile PaddlePaddle with code coverage" OFF) option(COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF) option(ON_TRAVIS "Exclude special unit test on Travis CI" OFF) option(WITH_C_API "Compile PaddlePaddle with C-API(Prediction)" OFF) -option(WITH_Go "Compile PaddlePaddle with Go)" OFF) +option(WITH_GOLANG "Compile PaddlePaddle with GOLANG" OFF) # CMAKE_BUILD_TYPE if(NOT CMAKE_BUILD_TYPE) @@ -108,7 +108,7 @@ include(configure) # add paddle env configuration include_directories("${PROJ_ROOT}") include_directories("${PROJ_ROOT}/paddle/cuda/include") include_directories("${CMAKE_CURRENT_BINARY_DIR}/proto") -include_directories("${CMAKE_BINARY_DIR}/go/pserver/cclient") +include_directories("${CMAKE_CURRENT_BINARY_DIR}/go/pserver/cclient") set(EXTERNAL_LIBS ${GFLAGS_LIBRARIES} @@ -130,10 +130,10 @@ add_subdirectory(proto) add_subdirectory(paddle) add_subdirectory(python) -if(WITH_Go) - #add_subdirectory(go/pserver/cclient) - add_subdirectory(go/master/c) -endif(WITH_Go) +if(WITH_GOLANG) + #TODO (add go/master/c back when fixed) + add_subdirectory(go/pserver/cclient) +endif(WITH_GOLANG) if(WITH_DOC) add_subdirectory(doc) diff --git a/cmake/configure.cmake b/cmake/configure.cmake index 44c86bc4797e6615728e7981f4e481507b803202..e8425aedbdd269d54035a0457fa37e0ba834427a 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -40,9 +40,9 @@ if(NOT CMAKE_CROSSCOMPILING) endif() endif() -if(NOT WITH_Go) - add_definitions(-DPADDLE_WITHOUT_GO) -endif() +if(NOT WITH_GOLANG) + add_definitions(-DPADDLE_WITHOUT_GOLANG) +endif(NOT WITH_GOLANG) if(NOT WITH_GPU) add_definitions(-DPADDLE_ONLY_CPU) diff --git a/go/cmake/golang.cmake b/go/cmake/golang.cmake index 446f930f38b3c2493600d2731a284204c6b3fc04..a5a43886f887e495500fa26b3c26fa69c63eded0 100644 --- a/go/cmake/golang.cmake +++ b/go/cmake/golang.cmake @@ -10,8 +10,7 @@ function(GO_LIBRARY NAME BUILD_TYPE) else() set(BUILD_MODE -buildmode=c-shared) if(APPLE) -# set(LIB_NAME "lib${NAME}.dylib") - set(LIB_NAME "lib${NAME}.so") + set(LIB_NAME "lib${NAME}.dylib") else() set(LIB_NAME "lib${NAME}.so") endif() diff --git a/paddle/api/PaddleAPI.h b/paddle/api/PaddleAPI.h index d4b80fccbd7936f591f9b40410101bee4baf6030..5fb3d1c73bc56e921f13aafd27c25224e259b3fe 100644 --- a/paddle/api/PaddleAPI.h +++ b/paddle/api/PaddleAPI.h @@ -842,7 +842,8 @@ public: int passCount, bool useSparseUpdater); static ParameterUpdater* createNewRemoteUpdater( - OptimizationConfig* config, const std::string pserverSpec) throw(UnsupportError); + OptimizationConfig* config, + const std::string pserverSpec) throw(UnsupportError); ~ParameterUpdater(); /** diff --git a/paddle/api/ParameterUpdater.cpp b/paddle/api/ParameterUpdater.cpp index 7eb860cffc31b6cd69645d3eabfc52c371cfe822..1aaefdfb8107a2eaa0432211fd7df4f5f12d537f 100644 --- a/paddle/api/ParameterUpdater.cpp +++ b/paddle/api/ParameterUpdater.cpp @@ -15,7 +15,7 @@ limitations under the License. */ #include "PaddleAPI.h" #include "PaddleAPIPrivate.h" -#ifndef PADDLE_WITHOUT_GO +#ifndef PADDLE_WITHOUT_GOLANG #include "paddle/trainer/NewRemoteParameterUpdater.h" #endif #include "paddle/trainer/RemoteParameterUpdater.h" @@ -31,10 +31,10 @@ ParameterUpdater *ParameterUpdater::createLocalUpdater( return updater; } -ParameterUpdater *ParameterUpdater::createNewRemoteUpdater ( - OptimizationConfig *config, const std::string pserverSpec) -throw(UnsupportError) { -#ifndef PADDLE_WITHOUT_GO +ParameterUpdater *ParameterUpdater::createNewRemoteUpdater( + OptimizationConfig *config, + const std::string pserverSpec) throw(UnsupportError) { +#ifndef PADDLE_WITHOUT_GOLANG auto updater = new ParameterUpdater(); updater->m->updater.reset(new paddle::NewRemoteParameterUpdater( config->m->getConfig(), pserverSpec)); diff --git a/paddle/trainer/CMakeLists.txt b/paddle/trainer/CMakeLists.txt index 1072e3d5080222cc8d5b745c38dc095c6af895f5..f34d53ae99f913a8aed8767b7271a538efce4778 100644 --- a/paddle/trainer/CMakeLists.txt +++ b/paddle/trainer/CMakeLists.txt @@ -26,7 +26,7 @@ set(TRAINER_HEADERS ThreadParameterUpdater.h TrainerConfigHelper.h) -if(NOT WITH_Go) +if(NOT WITH_GOLANG) list(REMOVE_ITEM TRAINER_SOURCES NewRemoteParameterUpdater.cpp) list(REMOVE_ITEM TRAINER_HEADERS @@ -70,8 +70,8 @@ if(APPLE) set(CMAKE_EXE_LINKER_FLAGS "-framework CoreFoundation -framework Security") endif() -if(WITH_Go) +if(WITH_GOLANG) add_dependencies(paddle_trainer_lib paddle_pserver_cclient) target_link_libraries(paddle_trainer ${CMAKE_BINARY_DIR}/go/pserver/cclient/libpaddle_pserver_cclient.a) target_link_libraries(paddle_trainer_lib ${CMAKE_BINARY_DIR}/go/pserver/cclient/libpaddle_pserver_cclient.a) -endif(WITH_Go) +endif(WITH_GOLANG)