From 3c926f08154ddf2c7962989046bc73d8e583cc59 Mon Sep 17 00:00:00 2001 From: Zhihong Zhang Date: Wed, 10 Apr 2024 12:08:19 -0400 Subject: [PATCH] Updated doc --- integration/xgboost/processor/CMakeLists.txt | 19 ++++++++++++------- integration/xgboost/processor/README.md | 15 +++++++++++++++ integration/xgboost/processor/src/dam/dam.cc | 1 + 3 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 integration/xgboost/processor/README.md diff --git a/integration/xgboost/processor/CMakeLists.txt b/integration/xgboost/processor/CMakeLists.txt index 208bc39fd7..d29b246377 100644 --- a/integration/xgboost/processor/CMakeLists.txt +++ b/integration/xgboost/processor/CMakeLists.txt @@ -3,6 +3,8 @@ project(proc_nvflare LANGUAGES CXX C VERSION 1.0) set(CMAKE_CXX_STANDARD 17) set(CMAKE_BUILD_TYPE Debug) +option(GOOGLE_TEST "Build google tests" OFF) + file(GLOB_RECURSE LIB_SRC "src/*.h" "src/*.cc" @@ -26,22 +28,25 @@ endif () target_link_libraries(proc_nvflare ${XGB_SRC}/lib/libxgboost${CMAKE_SHARED_LIBRARY_SUFFIX}) #-- Unit Tests -find_package(GTest REQUIRED) -enable_testing() -add_executable(proc_test) -target_link_libraries(proc_test PRIVATE proc_nvflare) +if(GOOGLE_TEST) + find_package(GTest REQUIRED) + enable_testing() + add_executable(proc_test) + target_link_libraries(proc_test PRIVATE proc_nvflare) + -target_include_directories(proc_test PRIVATE ${proc_nvflare_SOURCE_DIR}/src/include + target_include_directories(proc_test PRIVATE ${proc_nvflare_SOURCE_DIR}/src/include ${XGB_SRC}/src ${XGB_SRC}/rabit/include ${XGB_SRC}/include ${XGB_SRC}/dmlc-core/include ${XGB_SRC}/tests) -add_subdirectory(${proc_nvflare_SOURCE_DIR}/tests) + add_subdirectory(${proc_nvflare_SOURCE_DIR}/tests) -add_test( + add_test( NAME TestProcessor COMMAND proc_test WORKING_DIRECTORY ${proc_nvflare_BINARY_DIR}) +endif() \ No newline at end of file diff --git a/integration/xgboost/processor/README.md b/integration/xgboost/processor/README.md new file mode 100644 index 0000000000..08afc24e42 --- /dev/null +++ b/integration/xgboost/processor/README.md @@ -0,0 +1,15 @@ +# Build Instruction + +This plugin build requires xgboost source code, checkout xgboost source and build it with FEDERATED plugin, + +cd xgboost +mkdir build +cd build +cmake .. -DPLUGIN_FEDERATED=ON +make + +cd NVFlare/integration/xgboost/processor +mkdir build +cd build +cmake .. +make diff --git a/integration/xgboost/processor/src/dam/dam.cc b/integration/xgboost/processor/src/dam/dam.cc index 82dcafcb28..0148c2b37b 100644 --- a/integration/xgboost/processor/src/dam/dam.cc +++ b/integration/xgboost/processor/src/dam/dam.cc @@ -14,6 +14,7 @@ * limitations under the License. */ #include +#include #include "dam.h" void print_buffer(uint8_t *buffer, int size) {