From ca12944bb33a6b5c68f7bbf68e58d6053b9a1060 Mon Sep 17 00:00:00 2001 From: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Date: Mon, 16 Sep 2019 05:23:27 -0700 Subject: [rabit] Fix file conflict with dmlc (#8042) * [rabit] Add new port. * [rabit] Fix file conflict with dmlc --- ports/rabit/CONTROL | 8 +++--- ports/rabit/fix-file-conflict.patch | 52 +++++++++++++++++++++++++++++++++++++ ports/rabit/portfile.cmake | 11 +++++--- 3 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 ports/rabit/fix-file-conflict.patch diff --git a/ports/rabit/CONTROL b/ports/rabit/CONTROL index 7ad9bcfdb..e4fff769f 100644 --- a/ports/rabit/CONTROL +++ b/ports/rabit/CONTROL @@ -1,4 +1,6 @@ -Source: rabit -Version: 0.1 +Source: rabit +Version: 0.1-1 Homepage: https://github.com/dmlc/rabit -Description: rabit is a light weight library that provides a fault tolerant interface of Allreduce and Broadcast. It is designed to support easy implementations of distributed machine learning programs, many of which fall naturally under the Allreduce abstraction. \ No newline at end of file +Description: rabit is a light weight library that provides a fault tolerant interface of Allreduce and Broadcast. It is designed to support easy implementations of distributed machine learning programs, many of which fall naturally under the Allreduce abstraction. +Build-Depends: dmlc + diff --git a/ports/rabit/fix-file-conflict.patch b/ports/rabit/fix-file-conflict.patch new file mode 100644 index 000000000..665695305 --- /dev/null +++ b/ports/rabit/fix-file-conflict.patch @@ -0,0 +1,52 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 08330d9..a58d669 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,10 +5,16 @@ project(rabit VERSION 0.0.0) + option(RABIT_BUILD_TESTS "Build rabit tests" OFF) + option(RABIT_BUILD_MPI "Build MPI" OFF) + ++find_package(dmlc CONFIG REQUIRED) ++ + add_library(rabit src/allreduce_base.cc src/allreduce_robust.cc src/engine.cc src/c_api.cc) + add_library(rabit_base src/allreduce_base.cc src/engine_base.cc src/c_api.cc) + add_library(rabit_empty src/engine_empty.cc src/c_api.cc) + ++target_link_libraries(rabit dmlc::dmlc) ++target_link_libraries(rabit_base dmlc::dmlc) ++target_link_libraries(rabit_empty dmlc::dmlc) ++ + set(rabit_libs rabit rabit_base rabit_empty) + if(RABIT_BUILD_MPI) + find_package(MPI REQUIRED) +@@ -22,7 +28,6 @@ if(RABIT_BUILD_TESTS) + add_library(rabit_mock STATIC src/allreduce_base.cc src/allreduce_robust.cc src/engine_mock.cc src/c_api.cc) + list(APPEND rabit_libs rabit_mock) # add to list to apply build settings, then remove + endif() +- + foreach(lib ${rabit_libs}) + #include "./internal/utils.h" + target_include_directories(${lib} PUBLIC +@@ -42,7 +47,8 @@ if(RABIT_BUILD_TESTS) + if(RABIT_BUILD_MPI) + add_executable(speed_test_mpi test/speed_test.cc) + target_link_libraries(speed_test_mpi rabit_mpi) +- install(TARGETS speed_test_mpi DESTINATION bin) ++ install(TARGETS speed_test_mpi DESTINATION bin) ++ message("IN MPI ") + endif() + endif() + +diff --git a/include/rabit/serializable.h b/include/rabit/serializable.h +index 4a3c2a1..0fd4154 100644 +--- a/include/rabit/serializable.h ++++ b/include/rabit/serializable.h +@@ -9,7 +9,7 @@ + #include + #include + #include "./internal/utils.h" +-#include "../dmlc/io.h" ++#include + + namespace rabit { + /*! diff --git a/ports/rabit/portfile.cmake b/ports/rabit/portfile.cmake index cd009150f..90e93a6a7 100644 --- a/ports/rabit/portfile.cmake +++ b/ports/rabit/portfile.cmake @@ -10,11 +10,17 @@ vcpkg_from_github( REF v0.1 SHA512 145fd839898cb95eaab9a88ad3301a0ccac0c8b672419ee2b8eb6ba273cc9a26e069e5ecbc37a3078e46dc64d11efb3e5ab10e5f8fed714e7add85b9e6ac2ec7 HEAD_REF master + PATCHES fix-file-conflict.patch ) +file(REMOVE_RECURSE ${SOURCE_PATH}/include/dmlc) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA + PREFER_NINJA + OPTIONS + -DRABIT_BUILD_TESTS=OFF + -DRABIT_BUILD_MPI=OFF ) vcpkg_install_cmake() @@ -27,5 +33,4 @@ vcpkg_copy_pdbs() # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) - +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) -- cgit v1.2.3