diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/rabit | |
Diffstat (limited to 'vcpkg/ports/rabit')
| -rw-r--r-- | vcpkg/ports/rabit/fix-file-conflict.patch | 52 | ||||
| -rw-r--r-- | vcpkg/ports/rabit/portfile.cmake | 32 | ||||
| -rw-r--r-- | vcpkg/ports/rabit/vcpkg.json | 19 |
3 files changed, 103 insertions, 0 deletions
diff --git a/vcpkg/ports/rabit/fix-file-conflict.patch b/vcpkg/ports/rabit/fix-file-conflict.patch new file mode 100644 index 0000000..6656953 --- /dev/null +++ b/vcpkg/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 <vector>
+ #include <string>
+ #include "./internal/utils.h"
+-#include "../dmlc/io.h"
++#include <dmlc/io.h>
+
+ namespace rabit {
+ /*!
diff --git a/vcpkg/ports/rabit/portfile.cmake b/vcpkg/ports/rabit/portfile.cmake new file mode 100644 index 0000000..06f0cb1 --- /dev/null +++ b/vcpkg/ports/rabit/portfile.cmake @@ -0,0 +1,32 @@ +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ message(FATAL_ERROR "${PORT} does not currently support UWP.")
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO dmlc/rabit
+ REF v0.1
+ SHA512 145fd839898cb95eaab9a88ad3301a0ccac0c8b672419ee2b8eb6ba273cc9a26e069e5ecbc37a3078e46dc64d11efb3e5ab10e5f8fed714e7add85b9e6ac2ec7
+ HEAD_REF master
+ PATCHES fix-file-conflict.patch
+)
+
+file(REMOVE_RECURSE "${SOURCE_PATH}/include/dmlc")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DRABIT_BUILD_TESTS=OFF
+ -DRABIT_BUILD_MPI=OFF
+)
+
+vcpkg_cmake_install()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
+
+vcpkg_copy_pdbs()
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/rabit/vcpkg.json b/vcpkg/ports/rabit/vcpkg.json new file mode 100644 index 0000000..a979746 --- /dev/null +++ b/vcpkg/ports/rabit/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "rabit", + "version": "0.1", + "port-version": 5, + "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.", + "homepage": "https://github.com/dmlc/rabit", + "supports": "!uwp", + "dependencies": [ + "dmlc", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |