diff --git a/recipes/fastpfor/all/conandata.yml b/recipes/fastpfor/all/conandata.yml index e16837fea8797..28f460ca23316 100644 --- a/recipes/fastpfor/all/conandata.yml +++ b/recipes/fastpfor/all/conandata.yml @@ -1,17 +1,9 @@ sources: - "cci.20221225": - url: "https://github.com/lemire/FastPFor/archive/3e7358f8656b4456f4ea1762075553f2984fefcf.tar.gz" - sha256: "cc50b03421db3aa21be2243f5996ea6d027a6563e0863b77cfc46dd08bcfcaf5" - "cci.20220205": - url: "https://github.com/lemire/FastPFor/archive/773283d4a11fa2440a1b3b28fd77f775e86d7898.tar.gz" - sha256: "d4419512420f3bcc65862c5c367021f201b5ba3e8cb0dad895cdf444e0867b30" - + "0.2.0": + url: "https://github.com/lemire/FastPFor/archive/refs/tags/v0.2.0.tar.gz" + sha256: "d9f0eacf9c3c61866cda23bae35107ca9c5d35fa7b7a96ca9ccc85803d7e753d" patches: - "cci.20221225": - - patch_file: "patches/cci.20221225-0001-fix-cmake.patch" - patch_description: "enable shared build, disable unittest/utility" - patch_type: "conan" - "cci.20220205": - - patch_file: "patches/cci.20220205-0001-fix-cmake.patch" + "0.2.0": + - patch_file: "patches/0.2.0-0001-fix-cmake.patch" patch_description: "enable shared build, disable unittest/utility" patch_type: "conan" diff --git a/recipes/fastpfor/all/conanfile.py b/recipes/fastpfor/all/conanfile.py index 3ea949a5a46d9..3e02d3498b338 100644 --- a/recipes/fastpfor/all/conanfile.py +++ b/recipes/fastpfor/all/conanfile.py @@ -2,10 +2,13 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir from conan.tools.build import check_min_cppstd -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.apple import is_apple_os +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" + class FastPFORConan(ConanFile): name = "fastpfor" description = "Fast integer compression" @@ -13,13 +16,12 @@ class FastPFORConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lemire/FastPFor" topics = ("compression", "sorted-lists", "simd", "x86", "x86-64") + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], "fPIC": [True, False], } default_options = { - "shared": False, "fPIC": True, } @@ -30,30 +32,37 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - def layout(self): cmake_layout(self, src_folder="src") - def validate(self): - if self.settings.arch != "x86_64": - raise ConanInvalidConfiguration(f"{self.settings.arch} architecture is not supported") + @property + def _has_simde(self): + return "arm" in str(self.settings.arch) + + def requirements(self): + if self._has_simde: + self.requires("simde/0.8.0", transitive_headers=True) - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, "11") + def validate(self): + check_min_cppstd(self, 11) + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "15.0": + raise ConanInvalidConfiguration("${self.ref} doesn't support ${self.settings.compiler} < 15.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["WITH_TEST"] = False + if self._has_simde: + tc.cache_variables["SUPPORT_NEON"] = True + tc.preprocessor_definitions["SIMDE_ENABLE_NATIVE_ALIASES"] = 1 + tc.generate() + tc = CMakeDeps(self) tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -75,8 +84,5 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "FastPFOR" - self.cpp_info.filenames["cmake_find_package_multi"] = "FastPFOR" - self.cpp_info.names["cmake_find_package"] = "FastPFOR" - self.cpp_info.names["cmake_find_package_multi"] = "FastPFOR" + if self._has_simde: + self.cpp_info.defines = ["SIMDE_ENABLE_NATIVE_ALIASES"] diff --git a/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..8ba1054fb355a --- /dev/null +++ b/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch @@ -0,0 +1,85 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f06b25f..1f6bd0f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,7 +4,7 @@ + # Copyright (c) 2012 Louis Dionne + # + cmake_minimum_required(VERSION 3.0) +-set (CMAKE_CXX_STANDARD 11) # for constexpr specifier and other goodies ++# set (CMAKE_CXX_STANDARD 11) # for constexpr specifier and other goodies + + if (NOT CMAKE_BUILD_TYPE) + message(STATUS "No build type selected, default to Release") +@@ -62,7 +62,7 @@ if( SUPPORT_SSE42 ) + MESSAGE( STATUS "SSE 4.2 support detected" ) + else() + if (SUPPORT_NEON) +- include("${CMAKE_MODULE_PATH}/simde.cmake") ++ find_package(simde REQUIRED CONFIG) + MESSAGE(STATUS "USING SIMDE FOR SIMD OPERATIONS") + else () + MESSAGE(STATUS "SIMDE and SSE 4.2 support not detected") +@@ -103,6 +103,10 @@ elseif(WIN32) + if(NOT MSVC12) + message(STATUS "On Windows, only MSVC version 12 is supported!") + endif() ++ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") ++ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX") ++ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /arch:AVX") ++ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX") + else () + message(FATAL_ERROR "Please, use GCC, Clang, or the Intel compiler!") + endif() +@@ -129,19 +133,19 @@ add_library(FastPFOR STATIC + src/streamvbyte.c) + set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + +- ++if(0) + # other executables + add_executable(gapstats src/gapstats.cpp) + add_executable(partitionbylength src/partitionbylength.cpp) + add_executable(csv2maropu src/csv2maropu.cpp) +- ++endif() + 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) ++ target_link_libraries(FastPFOR PUBLIC simde::simde) ++ # target_link_libraries(gapstats PUBLIC simde::simde) ++ # target_link_libraries(partitionbylength PUBLIC simde::simde) ++ # target_link_libraries(csv2maropu PUBLIC simde::simde) + endif() +- ++if(0) + add_executable(entropy src/entropy.cpp) + target_link_libraries(entropy FastPFOR) + +@@ -149,7 +153,7 @@ if( SUPPORT_SSE42 ) + add_executable(benchbitpacking src/benchbitpacking.cpp) + target_link_libraries(benchbitpacking FastPFOR) + endif() +- ++endif() + find_package(snappy) + if(NOT ${snappy_FOUND}) + message(STATUS "Snappy was not found. codecssnappy and " +@@ -158,6 +162,7 @@ else() + message(STATUS "Snappy was found. Building additional targets " + "codecssnappy and inmemorybenchmarksnappy.") + include_directories(${snappy_INCLUDE_DIRS}) ++ if(0) + add_executable(codecssnappy src/codecs.cpp) + set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) + target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) +@@ -165,6 +170,7 @@ else() + add_executable(inmemorybenchmarksnappy src/inmemorybenchmark.cpp) + set_target_properties(inmemorybenchmarksnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) + target_link_libraries(inmemorybenchmarksnappy FastPFOR ${snappy_LIBRARIES}) ++ endif() + endif() + + option(WITH_TEST "Build with Google Test" ON) diff --git a/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch deleted file mode 100644 index 831aaf49de782..0000000000000 --- a/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5520747..dfccbc1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -94,6 +94,10 @@ elseif(WIN32) - if(NOT MSVC12) - message(STATUS "On Windows, only MSVC version 12 is supported!") - endif() -+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") -+ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX") -+ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /arch:AVX") -+ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX") - else () - message(FATAL_ERROR "Please, use GCC, Clang, or the Intel compiler!") - endif() -@@ -108,7 +112,7 @@ MESSAGE( STATUS "CMAKE_C_FLAGS_RELEASE: " ${CMAKE_C_FLAGS_RELEASE} ) - - # library target - include_directories(headers) --add_library(FastPFOR STATIC -+add_library(FastPFOR - src/bitpacking.cpp - src/bitpackingaligned.cpp - src/bitpackingunaligned.cpp -@@ -117,9 +121,8 @@ add_library(FastPFOR STATIC - src/simdbitpacking.cpp - src/varintdecode.c - src/streamvbyte.c) --set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) -- - -+if(0) - # other executables - add_executable(gapstats src/gapstats.cpp) - add_executable(partitionbylength src/partitionbylength.cpp) -@@ -132,6 +135,7 @@ if( SUPPORT_SSE42 ) - add_executable(benchbitpacking src/benchbitpacking.cpp) - target_link_libraries(benchbitpacking FastPFOR) - endif() -+endif(0) - - find_package(snappy) - if(NOT ${snappy_FOUND}) -@@ -141,6 +145,8 @@ else() - message(STATUS "Snappy was found. Building additional targets " - "codecssnappy and inmemorybenchmarksnappy.") - include_directories(${snappy_INCLUDE_DIRS}) -+ -+ if(0) - add_executable(codecssnappy src/codecs.cpp) - set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) - target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) -@@ -148,8 +154,10 @@ else() - add_executable(inmemorybenchmarksnappy src/inmemorybenchmark.cpp) - set_target_properties(inmemorybenchmarksnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) - target_link_libraries(inmemorybenchmarksnappy FastPFOR ${snappy_LIBRARIES}) -+ endif(0) - endif() - -+if(0) - # Download and unpack googletest at configure time - configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) - execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -@@ -207,7 +215,7 @@ target_link_libraries(FastPFOR_unittest gtest FastPFOR) - enable_testing() - add_test("unit" unit) - add_test("FastPFOR_unittest" FastPFOR_unittest) -- -+endif(0) - - include(GNUInstallDirs) - install(TARGETS FastPFOR diff --git a/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch deleted file mode 100644 index 9ac6f1894f7c7..0000000000000 --- a/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 118fc00..d57a46e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -94,6 +94,10 @@ elseif(WIN32) - if(NOT MSVC12) - message(STATUS "On Windows, only MSVC version 12 is supported!") - endif() -+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") -+ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX") -+ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /arch:AVX") -+ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX") - else () - message(FATAL_ERROR "Please, use GCC, Clang, or the Intel compiler!") - endif() -@@ -108,7 +112,7 @@ MESSAGE( STATUS "CMAKE_C_FLAGS_RELEASE: " ${CMAKE_C_FLAGS_RELEASE} ) - - # library target - include_directories(headers) --add_library(FastPFOR STATIC -+add_library(FastPFOR - src/bitpacking.cpp - src/bitpackingaligned.cpp - src/bitpackingunaligned.cpp -@@ -118,9 +122,9 @@ add_library(FastPFOR STATIC - src/simdbitpacking.cpp - src/varintdecode.c - src/streamvbyte.c) --set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) - - -+if(0) - # other executables - add_executable(gapstats src/gapstats.cpp) - add_executable(partitionbylength src/partitionbylength.cpp) -@@ -133,6 +137,7 @@ if( SUPPORT_SSE42 ) - add_executable(benchbitpacking src/benchbitpacking.cpp) - target_link_libraries(benchbitpacking FastPFOR) - endif() -+endif() - - find_package(snappy) - if(NOT ${snappy_FOUND}) -@@ -142,6 +147,7 @@ else() - message(STATUS "Snappy was found. Building additional targets " - "codecssnappy and inmemorybenchmarksnappy.") - include_directories(${snappy_INCLUDE_DIRS}) -+ if(0) - add_executable(codecssnappy src/codecs.cpp) - set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) - target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) -@@ -149,8 +155,10 @@ else() - add_executable(inmemorybenchmarksnappy src/inmemorybenchmark.cpp) - set_target_properties(inmemorybenchmarksnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) - target_link_libraries(inmemorybenchmarksnappy FastPFOR ${snappy_LIBRARIES}) -+ endif() - endif() - -+if(0) - # Download and unpack googletest at configure time - configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) - execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -@@ -208,7 +216,7 @@ target_link_libraries(FastPFOR_unittest gtest FastPFOR) - enable_testing() - add_test("unit" unit) - add_test("FastPFOR_unittest" FastPFOR_unittest) -- -+endif() - - include(GNUInstallDirs) - install(TARGETS FastPFOR diff --git a/recipes/fastpfor/all/test_v1_package/CMakeLists.txt b/recipes/fastpfor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/fastpfor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/fastpfor/all/test_v1_package/conanfile.py b/recipes/fastpfor/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/fastpfor/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -import os - -class TestPackageV1Conan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/fastpfor/config.yml b/recipes/fastpfor/config.yml index 216ef81b387a5..b370fcee5fe7c 100644 --- a/recipes/fastpfor/config.yml +++ b/recipes/fastpfor/config.yml @@ -1,5 +1,3 @@ versions: - "cci.20221225": - folder: all - "cci.20220205": + "0.2.0": folder: all