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/vowpal-wabbit | |
Diffstat (limited to 'vcpkg/ports/vowpal-wabbit')
| -rw-r--r-- | vcpkg/ports/vowpal-wabbit/cmake_remove_bin_targets.patch | 22 | ||||
| -rw-r--r-- | vcpkg/ports/vowpal-wabbit/fix-android-build.patch | 79 | ||||
| -rw-r--r-- | vcpkg/ports/vowpal-wabbit/fix-build-error-with-fmt11.patch | 89 | ||||
| -rw-r--r-- | vcpkg/ports/vowpal-wabbit/fix-external-libraries.patch | 23 | ||||
| -rw-r--r-- | vcpkg/ports/vowpal-wabbit/portfile.cmake | 39 | ||||
| -rw-r--r-- | vcpkg/ports/vowpal-wabbit/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/vowpal-wabbit/vcpkg.json | 31 |
7 files changed, 287 insertions, 0 deletions
diff --git a/vcpkg/ports/vowpal-wabbit/cmake_remove_bin_targets.patch b/vcpkg/ports/vowpal-wabbit/cmake_remove_bin_targets.patch new file mode 100644 index 0000000..444ccb7 --- /dev/null +++ b/vcpkg/ports/vowpal-wabbit/cmake_remove_bin_targets.patch @@ -0,0 +1,22 @@ +diff --git a/vowpalwabbit/CMakeLists.txt b/vowpalwabbit/CMakeLists.txt +index cd3f6cd92..d5f41a11e 100644 +--- a/vowpalwabbit/CMakeLists.txt ++++ b/vowpalwabbit/CMakeLists.txt +@@ -1,9 +1,7 @@ +-add_subdirectory(active_interactor) + add_subdirectory(allreduce) + if(VW_BUILD_VW_C_WRAPPER) + add_subdirectory(c_wrapper) + endif() +-add_subdirectory(cli) + add_subdirectory(cache_parser) + add_subdirectory(common) + add_subdirectory(config) +@@ -17,7 +15,6 @@ add_subdirectory(json_parser) + add_subdirectory(model_merger) + add_subdirectory(slim) + if(VW_FEAT_NETWORKING) +- add_subdirectory(spanning_tree_bin) + add_subdirectory(spanning_tree) + endif() + add_subdirectory(text_parser) diff --git a/vcpkg/ports/vowpal-wabbit/fix-android-build.patch b/vcpkg/ports/vowpal-wabbit/fix-android-build.patch new file mode 100644 index 0000000..b6d3dd2 --- /dev/null +++ b/vcpkg/ports/vowpal-wabbit/fix-android-build.patch @@ -0,0 +1,79 @@ +diff --git a/utl/flatbuffer/txt_to_flat.cc b/utl/flatbuffer/txt_to_flat.cc +index d63141e..784d329 100644 +--- a/utl/flatbuffer/txt_to_flat.cc ++++ b/utl/flatbuffer/txt_to_flat.cc +@@ -18,8 +18,6 @@ + #include "vw/core/parse_regressor.h" + #include "vw_to_flat.h" + +-#include <sys/timeb.h> +- + #include <fstream> + + using namespace VW::config; +diff --git a/utl/flatbuffer/vw_to_flat.cc b/utl/flatbuffer/vw_to_flat.cc +index b56b5b7..8ae9978 100644 +--- a/utl/flatbuffer/vw_to_flat.cc ++++ b/utl/flatbuffer/vw_to_flat.cc +@@ -13,8 +13,6 @@ + #include "vw/core/reductions/cb/cb_algs.h" + #include "vw/core/shared_data.h" + +-#include <sys/timeb.h> +- + #include <fstream> + #include <vector> + +diff --git a/vowpalwabbit/allreduce/src/allreduce_sockets.cc b/vowpalwabbit/allreduce/src/allreduce_sockets.cc +index a61e560..27d6446 100644 +--- a/vowpalwabbit/allreduce/src/allreduce_sockets.cc ++++ b/vowpalwabbit/allreduce/src/allreduce_sockets.cc +@@ -32,8 +32,6 @@ Alekh Agarwal and John Langford, with help Olivier Chapelle. + #include "vw/common/vw_exception.h" + #include "vw/io/logger.h" + +-#include <sys/timeb.h> +- + // port is already in network order + socket_t VW::all_reduce_sockets::sock_connect(const uint32_t ip, const int port, VW::io::logger& logger) + { +diff --git a/vowpalwabbit/core/src/confidence_sequence.cc b/vowpalwabbit/core/src/confidence_sequence.cc +index fc4b35d..0c2a40c 100644 +--- a/vowpalwabbit/core/src/confidence_sequence.cc ++++ b/vowpalwabbit/core/src/confidence_sequence.cc +@@ -204,7 +204,7 @@ double confidence_sequence::approxpolygammaone(double b) const + + double confidence_sequence::lblogwealth(double sumXt, double v, double eta, double s, double lb_alpha) const + { +-#if !defined(__APPLE__) && !defined(_WIN32) && !defined(__EMSCRIPTEN__) ++#if !defined(__APPLE__) && !defined(_WIN32) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__) + double zeta_s = std::riemann_zeta(s); + #else + double zeta_s = 10.584448464950803; // std::riemann_zeta(s) -- Assuming s=1.1 is constant +diff --git a/vowpalwabbit/core/src/parser.cc b/vowpalwabbit/core/src/parser.cc +index 26b0ccd..ff249fb 100644 +--- a/vowpalwabbit/core/src/parser.cc ++++ b/vowpalwabbit/core/src/parser.cc +@@ -53,9 +53,6 @@ int VW_GETPID() { return (int)::GetCurrentProcessId(); } + #else + # include <netdb.h> + # define VW_GETPID getpid +-#endif +- +-#if defined(__FreeBSD__) || defined(__APPLE__) + # include <netinet/in.h> + #endif + +diff --git a/vowpalwabbit/core/src/reductions/bfgs.cc b/vowpalwabbit/core/src/reductions/bfgs.cc +index 8b1e7ac..7728ea0 100644 +--- a/vowpalwabbit/core/src/reductions/bfgs.cc ++++ b/vowpalwabbit/core/src/reductions/bfgs.cc +@@ -20,8 +20,6 @@ Implementation by Miro Dudik. + #include "vw/core/shared_data.h" + #include "vw/core/simple_label.h" + +-#include <sys/timeb.h> +- + #include <cassert> + #include <cfloat> + #include <chrono> diff --git a/vcpkg/ports/vowpal-wabbit/fix-build-error-with-fmt11.patch b/vcpkg/ports/vowpal-wabbit/fix-build-error-with-fmt11.patch new file mode 100644 index 0000000..8d62d2d --- /dev/null +++ b/vcpkg/ports/vowpal-wabbit/fix-build-error-with-fmt11.patch @@ -0,0 +1,89 @@ +diff --git a/vowpalwabbit/config/src/cli_help_formatter.cc b/vowpalwabbit/config/src/cli_help_formatter.cc +index 8cc6dfe..10b9823 100644 +--- a/vowpalwabbit/config/src/cli_help_formatter.cc ++++ b/vowpalwabbit/config/src/cli_help_formatter.cc +@@ -8,6 +8,7 @@ + #include "vw/config/options.h" + + #include <fmt/format.h> ++#include <fmt/ranges.h> + + #include <sstream> + #include <string> +diff --git a/vowpalwabbit/config/src/options_cli.cc b/vowpalwabbit/config/src/options_cli.cc +index cec7c03..ea31810 100644 +--- a/vowpalwabbit/config/src/options_cli.cc ++++ b/vowpalwabbit/config/src/options_cli.cc +@@ -10,6 +10,7 @@ + #include "vw/config/option.h" + + #include <fmt/format.h> ++#include <fmt/ranges.h> + + #include <algorithm> + #include <cassert> +diff --git a/vowpalwabbit/core/include/vw/core/automl_impl.h b/vowpalwabbit/core/include/vw/core/automl_impl.h +index 4a44666..0d1b35d 100644 +--- a/vowpalwabbit/core/include/vw/core/automl_impl.h ++++ b/vowpalwabbit/core/include/vw/core/automl_impl.h +@@ -334,7 +334,7 @@ template <> + class formatter<VW::reductions::automl::automl_state> : public formatter<std::string> + { + public: +- auto format(VW::reductions::automl::automl_state c, format_context& ctx) -> decltype(ctx.out()) ++ auto format(VW::reductions::automl::automl_state c, format_context& ctx) const -> decltype(ctx.out()) + { + return formatter<std::string>::format(std::string{VW::to_string(c)}, ctx); + } +@@ -344,7 +344,7 @@ template <> + class formatter<VW::reductions::automl::config_state> : public formatter<std::string> + { + public: +- auto format(VW::reductions::automl::config_state c, format_context& ctx) -> decltype(ctx.out()) ++ auto format(VW::reductions::automl::config_state c, format_context& ctx) const -> decltype(ctx.out()) + { + return formatter<std::string>::format(std::string{VW::to_string(c)}, ctx); + } +@@ -354,7 +354,7 @@ template <> + class formatter<VW::reductions::automl::config_type> : public formatter<std::string> + { + public: +- auto format(VW::reductions::automl::config_type c, format_context& ctx) -> decltype(ctx.out()) ++ auto format(VW::reductions::automl::config_type c, format_context& ctx) const -> decltype(ctx.out()) + { + return formatter<std::string>::format(std::string{VW::to_string(c)}, ctx); + } +diff --git a/vowpalwabbit/core/include/vw/core/ccb_label.h b/vowpalwabbit/core/include/vw/core/ccb_label.h +index 2e7e985..b0050dd 100644 +--- a/vowpalwabbit/core/include/vw/core/ccb_label.h ++++ b/vowpalwabbit/core/include/vw/core/ccb_label.h +@@ -14,6 +14,7 @@ + #include "vw/core/v_array.h" + + #include <fmt/format.h> ++#include <fmt/ranges.h> + + #include <cstdint> + #include <string> +@@ -81,7 +82,7 @@ template <> + class formatter<VW::ccb_example_type> : public formatter<std::string> + { + public: +- auto format(VW::ccb_example_type c, format_context& ctx) -> decltype(ctx.out()) ++ auto format(VW::ccb_example_type c, format_context& ctx) const -> decltype(ctx.out()) + { + return formatter<std::string>::format(std::string{VW::to_string(c)}, ctx); + } +diff --git a/vowpalwabbit/core/include/vw/core/slates_label.h b/vowpalwabbit/core/include/vw/core/slates_label.h +index 0cd089c..d226893 100644 +--- a/vowpalwabbit/core/include/vw/core/slates_label.h ++++ b/vowpalwabbit/core/include/vw/core/slates_label.h +@@ -81,7 +81,7 @@ template <> + class formatter<VW::slates::example_type> : public formatter<std::string> + { + public: +- auto format(VW::slates::example_type c, format_context& ctx) -> decltype(ctx.out()) ++ auto format(VW::slates::example_type c, format_context& ctx) const -> decltype(ctx.out()) + { + return formatter<std::string>::format(std::string{VW::to_string(c)}, ctx); + } diff --git a/vcpkg/ports/vowpal-wabbit/fix-external-libraries.patch b/vcpkg/ports/vowpal-wabbit/fix-external-libraries.patch new file mode 100644 index 0000000..00e8ac7 --- /dev/null +++ b/vcpkg/ports/vowpal-wabbit/fix-external-libraries.patch @@ -0,0 +1,23 @@ +diff --git a/ext_libs/ext_libs.cmake b/ext_libs/ext_libs.cmake +index e03de86..073db1c 100644 +--- a/ext_libs/ext_libs.cmake ++++ b/ext_libs/ext_libs.cmake +@@ -37,8 +37,6 @@ endif() + if(RAPIDJSON_SYS_DEP) + # Since EXACT is not specified, any version compatible with 1.1.0 is accepted (>= 1.1.0) + find_package(RapidJSON 1.1.0 CONFIG REQUIRED) +- add_library(RapidJSON INTERFACE) +- target_include_directories(RapidJSON INTERFACE ${RapidJSON_INCLUDE_DIRS} ${RAPIDJSON_INCLUDE_DIRS}) + else() + add_library(RapidJSON INTERFACE) + target_include_directories(RapidJSON SYSTEM INTERFACE "${CMAKE_CURRENT_LIST_DIR}/rapidjson/include") +@@ -101,8 +99,7 @@ endif() + if(VW_EIGEN_SYS_DEP) + # Since EXACT is not specified, any version compatible with 3.4.0 is accepted (>= 3.4.0) + find_package(Eigen3 3.4.0 CONFIG REQUIRED) +- add_library(eigen INTERFACE) +- target_include_directories(eigen INTERFACE ${EIGEN3_INCLUDE_DIR}) ++ add_library(eigen ALIAS Eigen3::Eigen) + else() + if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/eigen/CMakeLists.txt) + message(SEND_ERROR "The eigen git submodule is not available.\ diff --git a/vcpkg/ports/vowpal-wabbit/portfile.cmake b/vcpkg/ports/vowpal-wabbit/portfile.cmake new file mode 100644 index 0000000..eeab070 --- /dev/null +++ b/vcpkg/ports/vowpal-wabbit/portfile.cmake @@ -0,0 +1,39 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO VowpalWabbit/vowpal_wabbit + REF "${VERSION}" + SHA512 f87229caf65c6c32fb863fa426a39592d41990a43ce4d79f0a076323e47cd3d1a8bd02884afceb662527c87d290e68c51df6263d6a97f3a044f3f7254a38f86a + HEAD_REF master + PATCHES + cmake_remove_bin_targets.patch + fix-build-error-with-fmt11.patch + fix-external-libraries.patch + fix-android-build.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DVW_INSTALL=ON + -DRAPIDJSON_SYS_DEP=ON + -DFMT_SYS_DEP=ON + -DSPDLOG_SYS_DEP=ON + -DVW_BOOST_MATH_SYS_DEP=ON + -DVW_ZLIB_SYS_DEP=ON + -DVW_EIGEN_SYS_DEP=ON + -DVW_BUILD_VW_C_WRAPPER=OFF + -DBUILD_TESTING=OFF + -DVW_STRING_VIEW_LITE_SYS_DEP=ON + -DVW_SSE2NEON_SYS_DEP=ON + -DVW_CXX_STANDARD=14 # boost-math require c++14 +) +vcpkg_cmake_install() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/VowpalWabbit) +vcpkg_fixup_pkgconfig() diff --git a/vcpkg/ports/vowpal-wabbit/usage b/vcpkg/ports/vowpal-wabbit/usage new file mode 100644 index 0000000..bd211f5 --- /dev/null +++ b/vcpkg/ports/vowpal-wabbit/usage @@ -0,0 +1,4 @@ +vowpalwabbit provides CMake targets: + + find_package(VowpalWabbit CONFIG REQUIRED) + target_link_libraries(main PRIVATE VowpalWabbit::vw_core) diff --git a/vcpkg/ports/vowpal-wabbit/vcpkg.json b/vcpkg/ports/vowpal-wabbit/vcpkg.json new file mode 100644 index 0000000..da00c9b --- /dev/null +++ b/vcpkg/ports/vowpal-wabbit/vcpkg.json @@ -0,0 +1,31 @@ +{ + "name": "vowpal-wabbit", + "version": "9.10.0", + "port-version": 3, + "description": "Reduction based online learning framework with a focus on contextual bandits and reinforcement learning.", + "homepage": "https://github.com/vowpalwabbit/vowpal_wabbit", + "license": "BSD-3-Clause", + "supports": "!x86 & !uwp & !(windows & arm)", + "dependencies": [ + "boost-math", + "eigen3", + "flatbuffers", + "fmt", + "rapidjson", + "spdlog", + { + "name": "sse2neon", + "platform": "arm" + }, + "string-view-lite", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ] +} |