From a7c451bd6cd6f4c223de0dbfdc28499262423538 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 10 Feb 2026 14:32:42 +0900 Subject: [PATCH] [fastpfor] add new port (#49746) --- ports/fastpfor/fix-arm-checker.patch | 18 ++++++++ ports/fastpfor/portfile.cmake | 37 +++++++++++++++++ ports/fastpfor/remove-cpm.patch | 61 ++++++++++++++++++++++++++++ ports/fastpfor/vcpkg.json | 23 +++++++++++ versions/baseline.json | 4 ++ versions/f-/fastpfor.json | 9 ++++ 6 files changed, 152 insertions(+) create mode 100644 ports/fastpfor/fix-arm-checker.patch create mode 100644 ports/fastpfor/portfile.cmake create mode 100644 ports/fastpfor/remove-cpm.patch create mode 100644 ports/fastpfor/vcpkg.json create mode 100644 versions/f-/fastpfor.json diff --git a/ports/fastpfor/fix-arm-checker.patch b/ports/fastpfor/fix-arm-checker.patch new file mode 100644 index 0000000000..12015c49e9 --- /dev/null +++ b/ports/fastpfor/fix-arm-checker.patch @@ -0,0 +1,18 @@ +diff --git a/cmake_modules/environment.cmake b/cmake_modules/environment.cmake +index 8072ae8..9d05bcc 100644 +--- a/cmake_modules/environment.cmake ++++ b/cmake_modules/environment.cmake +@@ -1,10 +1,10 @@ + include(CheckCXXCompilerFlag) + +-if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") ++if (CMAKE_SYSTEM_PROCESSOR MATCHES "[Aa][Rr][Mm]64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "[Aa][Rr][Mm]" OR CMAKE_SYSTEM_PROCESSOR MATCHES "[Aa][Rr][Cc][Hh]64") + set(SUPPORT_NEON ON) + endif () + + # Check if the Visual Studio build is targeting ARM +-if (CMAKE_GENERATOR_PLATFORM MATCHES "ARM64" OR CMAKE_GENERATOR_PLATFORM MATCHES "ARM") ++if (CMAKE_GENERATOR_PLATFORM MATCHES "[Aa][Rr][Mm]64" OR CMAKE_GENERATOR_PLATFORM MATCHES "[Aa][Rr][Mm]") + set(SUPPORT_NEON ON) + endif () +\ No newline at end of file diff --git a/ports/fastpfor/portfile.cmake b/ports/fastpfor/portfile.cmake new file mode 100644 index 0000000000..c8a749504e --- /dev/null +++ b/ports/fastpfor/portfile.cmake @@ -0,0 +1,37 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO fast-pack/FastPFOR + REF "v${VERSION}" + SHA512 63eae397540e901e6b60420a92a165bbc16f35d97238221dac5d9d8819f40886a12edc17087d0aa2eeef706b8f411d1d19b77d6833d8bf34ad8340fa59f4cccf + HEAD_REF master + PATCHES + remove-cpm.patch + fix-arm-checker.patch +) + +file(REMOVE + ${SOURCE_PATH}/cmake_modules/CPM.cmake + ${SOURCE_PATH}/cmake_modules/Findsnappy.cmake + ${SOURCE_PATH}/cmake_modules/simde.cmake +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DFASTPFOR_WITH_TEST=OFF +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/FastPFOR") + +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/share/doc" +) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/fastpfor/remove-cpm.patch b/ports/fastpfor/remove-cpm.patch new file mode 100644 index 0000000000..1fe704370b --- /dev/null +++ b/ports/fastpfor/remove-cpm.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c32c332..a72eada 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,7 +13,6 @@ set(CMAKE_C_STANDARD_REQUIRED True) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") + include(AppendCompilerFlags) + +-include(cmake/CPM.cmake) + + project(FastPFOR CXX C) + set(PROJECT_URL "https://github.com/fast-pack/FastPFOR") +@@ -40,7 +39,6 @@ if( SUPPORT_SSE42 ) + MESSAGE( STATUS "SSE 4.2 support detected" ) + else() + if (SUPPORT_NEON) +- include(simde) + MESSAGE(STATUS "USING SIMDE FOR SIMD OPERATIONS") + else () + MESSAGE(STATUS "SIMDE and SSE 4.2 support not detected") +@@ -112,10 +110,9 @@ add_executable(csv2maropu src/csv2maropu.cpp) + target_link_libraries(csv2maropu PRIVATE FastPFOR) + + if (SUPPORT_NEON) +- target_link_libraries(FastPFOR PUBLIC simde) +- target_link_libraries(gapstats PUBLIC simde) +- target_link_libraries(partitionbylength PUBLIC simde) +- target_link_libraries(csv2maropu PUBLIC simde) ++ find_path(SIMDE_INCLUDE_DIRS "simde/arm/neon.h") ++ target_include_directories(FastPFOR PUBLIC ${SIMDE_INCLUDE_DIRS}) ++ target_compile_definitions(FastPFOR PUBLIC SIMDE_ENABLE_NATIVE_ALIASES) + else() + message(STATUS "SIMDE not used") + endif() +@@ -128,21 +125,21 @@ if( SUPPORT_SSE42 ) + target_link_libraries(benchbitpacking FastPFOR) + endif() + +-find_package(snappy) +-if(NOT ${snappy_FOUND}) ++find_package(Snappy CONFIG) ++if(NOT ${Snappy_FOUND}) + message(STATUS "Snappy was not found. codecssnappy and " + "inmemorybenchmarksnappy targets are not available.") + else() + message(STATUS "Snappy was found. Building additional targets " + "codecssnappy and inmemorybenchmarksnappy.") +- include_directories(${snappy_INCLUDE_DIRS}) ++ include_directories(${Snappy_INCLUDE_DIRS}) + add_executable(codecssnappy src/codecs.cpp) + set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) +- target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) ++ target_link_libraries(codecssnappy FastPFOR ${Snappy_LIBRARIES}) + + add_executable(inmemorybenchmarksnappy src/inmemorybenchmark.cpp) + set_target_properties(inmemorybenchmarksnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) +- target_link_libraries(inmemorybenchmarksnappy FastPFOR ${snappy_LIBRARIES}) ++ target_link_libraries(inmemorybenchmarksnappy FastPFOR ${Snappy_LIBRARIES}) + endif() + + option(FASTPFOR_WITH_TEST "Build with Google Test" ON) diff --git a/ports/fastpfor/vcpkg.json b/ports/fastpfor/vcpkg.json new file mode 100644 index 0000000000..48db735742 --- /dev/null +++ b/ports/fastpfor/vcpkg.json @@ -0,0 +1,23 @@ +{ + "name": "fastpfor", + "version": "0.3.1", + "description": "Fast integer compression", + "homepage": "https://github.com/fast-pack/FastPFOR", + "license": "Apache-2.0", + "supports": "!(arm & !arm64)", + "dependencies": [ + { + "name": "simde", + "platform": "arm" + }, + "snappy", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 9a1b8507fc..51c706ffd1 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2936,6 +2936,10 @@ "baseline": "0.6.4", "port-version": 0 }, + "fastpfor": { + "baseline": "0.3.1", + "port-version": 0 + }, "faudio": { "baseline": "26.2", "port-version": 0 diff --git a/versions/f-/fastpfor.json b/versions/f-/fastpfor.json new file mode 100644 index 0000000000..fd8968905c --- /dev/null +++ b/versions/f-/fastpfor.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "e9241b565fa01089f72ad03ebfc04af84c247977", + "version": "0.3.1", + "port-version": 0 + } + ] +}