mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-16 19:36:37 +08:00
[rabit] Fix file conflict with dmlc (#8042)
* [rabit] Add new port. * [rabit] Fix file conflict with dmlc
This commit is contained in:
parent
384da059f5
commit
ca12944bb3
@ -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.
|
||||
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
|
||||
|
||||
|
52
ports/rabit/fix-file-conflict.patch
Normal file
52
ports/rabit/fix-file-conflict.patch
Normal file
@ -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 <vector>
|
||||
#include <string>
|
||||
#include "./internal/utils.h"
|
||||
-#include "../dmlc/io.h"
|
||||
+#include <dmlc/io.h>
|
||||
|
||||
namespace rabit {
|
||||
/*!
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user