From 7611a54a990f948bf098be50767f8043c740fed1 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 3 Nov 2024 18:04:15 +0900 Subject: [PATCH 01/12] fastpfor: add version 0.1.8.cci.20240810, make static-library --- recipes/fastpfor/all/conandata.yml | 8 ++- recipes/fastpfor/all/conanfile.py | 10 ++-- .../0.1.8.cci.20240810-0001-fix-cmake.patch | 49 +++++++++++++++++++ .../patches/cci.20220205-0001-fix-cmake.patch | 9 ---- .../patches/cci.20221225-0001-fix-cmake.patch | 9 ---- recipes/fastpfor/config.yml | 2 + 6 files changed, 61 insertions(+), 26 deletions(-) create mode 100644 recipes/fastpfor/all/patches/0.1.8.cci.20240810-0001-fix-cmake.patch diff --git a/recipes/fastpfor/all/conandata.yml b/recipes/fastpfor/all/conandata.yml index e16837fea8797..22d82a38d80ab 100644 --- a/recipes/fastpfor/all/conandata.yml +++ b/recipes/fastpfor/all/conandata.yml @@ -1,12 +1,18 @@ sources: + "0.1.8.cci.20240810": + url: "https://github.com/lemire/FastPFor/archive/52e45deeab9c3a481daa9d2bb00d10e1ba6db9fd.tar.gz" + sha256: "706b9844ab7e57ddbf4dc73330b570b91ff177a603afdc3c25d451ffdcb4c7d7" "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" - patches: + "0.1.8.cci.20240810": + - patch_file: "patches/0.1.8.cci.20240810-0001-fix-cmake.patch" + patch_description: "enable shared build, disable unittest/utility" + patch_type: "conan" "cci.20221225": - patch_file: "patches/cci.20221225-0001-fix-cmake.patch" patch_description: "enable shared build, disable unittest/utility" diff --git a/recipes/fastpfor/all/conanfile.py b/recipes/fastpfor/all/conanfile.py index 3ea949a5a46d9..0c16c907ad201 100644 --- a/recipes/fastpfor/all/conanfile.py +++ b/recipes/fastpfor/all/conanfile.py @@ -6,6 +6,7 @@ import os required_conan_version = ">=1.53.0" + class FastPFORConan(ConanFile): name = "fastpfor" description = "Fast integer compression" @@ -13,13 +14,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,10 +30,6 @@ 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") @@ -49,7 +45,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["WITH_TEST"] = False tc.generate() def build(self): diff --git a/recipes/fastpfor/all/patches/0.1.8.cci.20240810-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/0.1.8.cci.20240810-0001-fix-cmake.patch new file mode 100644 index 0000000000000..60a00b4693506 --- /dev/null +++ b/recipes/fastpfor/all/patches/0.1.8.cci.20240810-0001-fix-cmake.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 38590f3..40beff4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -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,7 +133,7 @@ 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) +@@ -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 index 831aaf49de782..75377b188a873 100644 --- a/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch +++ b/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch @@ -13,15 +13,6 @@ index 5520747..dfccbc1 100644 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 diff --git a/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch index 9ac6f1894f7c7..28f178297e097 100644 --- a/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch +++ b/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch @@ -13,15 +13,6 @@ index 118fc00..d57a46e 100644 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 diff --git a/recipes/fastpfor/config.yml b/recipes/fastpfor/config.yml index 216ef81b387a5..5733558e77eb2 100644 --- a/recipes/fastpfor/config.yml +++ b/recipes/fastpfor/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.8.cci.20240810": + folder: all "cci.20221225": folder: all "cci.20220205": From 4482b80a3b8ba8e3c8b063d553e7a3fc3eb2ac4b Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 13 Nov 2024 00:30:49 +0900 Subject: [PATCH 02/12] update 0.2.0 --- recipes/fastpfor/all/conandata.yml | 10 +++---- ...cmake.patch => 0.2.0-0001-fix-cmake.patch} | 28 ++++++++++++------- recipes/fastpfor/config.yml | 2 +- 3 files changed, 24 insertions(+), 16 deletions(-) rename recipes/fastpfor/all/patches/{0.1.8.cci.20240810-0001-fix-cmake.patch => 0.2.0-0001-fix-cmake.patch} (66%) diff --git a/recipes/fastpfor/all/conandata.yml b/recipes/fastpfor/all/conandata.yml index 22d82a38d80ab..2590f702e3dd4 100644 --- a/recipes/fastpfor/all/conandata.yml +++ b/recipes/fastpfor/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "0.1.8.cci.20240810": - url: "https://github.com/lemire/FastPFor/archive/52e45deeab9c3a481daa9d2bb00d10e1ba6db9fd.tar.gz" - sha256: "706b9844ab7e57ddbf4dc73330b570b91ff177a603afdc3c25d451ffdcb4c7d7" + "0.2.0": + url: "https://github.com/lemire/FastPFor/archive/refs/tags/v0.2.0.tar.gz" + sha256: "6722f2cba2edb4c20a49280b1c6b8a999895c4bc1c031584a9b2670c3e54173e" "cci.20221225": url: "https://github.com/lemire/FastPFor/archive/3e7358f8656b4456f4ea1762075553f2984fefcf.tar.gz" sha256: "cc50b03421db3aa21be2243f5996ea6d027a6563e0863b77cfc46dd08bcfcaf5" @@ -9,8 +9,8 @@ sources: url: "https://github.com/lemire/FastPFor/archive/773283d4a11fa2440a1b3b28fd77f775e86d7898.tar.gz" sha256: "d4419512420f3bcc65862c5c367021f201b5ba3e8cb0dad895cdf444e0867b30" patches: - "0.1.8.cci.20240810": - - patch_file: "patches/0.1.8.cci.20240810-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" "cci.20221225": diff --git a/recipes/fastpfor/all/patches/0.1.8.cci.20240810-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch similarity index 66% rename from recipes/fastpfor/all/patches/0.1.8.cci.20240810-0001-fix-cmake.patch rename to recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch index 60a00b4693506..06d233c5d9883 100644 --- a/recipes/fastpfor/all/patches/0.1.8.cci.20240810-0001-fix-cmake.patch +++ b/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch @@ -1,15 +1,15 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 38590f3..40beff4 100644 +index 38590f3..3cd57b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") ++ 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() @@ -31,19 +31,27 @@ index 38590f3..40beff4 100644 find_package(snappy) if(NOT ${snappy_FOUND}) message(STATUS "Snappy was not found. codecssnappy and " -@@ -158,6 +162,7 @@ else() +@@ -158,13 +162,15 @@ 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) +- add_executable(codecssnappy src/codecs.cpp) ++ 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() endif() option(WITH_TEST "Build with Google Test" ON) +@@ -256,4 +262,4 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.0.0) + endif() + configure_file("fastpfor.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/fastpfor.pc" @ONLY) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fastpfor.pc" +- DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +\ No newline at end of file ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") diff --git a/recipes/fastpfor/config.yml b/recipes/fastpfor/config.yml index 5733558e77eb2..3e78b01ec63e1 100644 --- a/recipes/fastpfor/config.yml +++ b/recipes/fastpfor/config.yml @@ -1,5 +1,5 @@ versions: - "0.1.8.cci.20240810": + "0.2.0": folder: all "cci.20221225": folder: all From 765b1369835e17ff98d66e8f5ac1fa28416ab066 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 13 Nov 2024 17:19:44 +0900 Subject: [PATCH 03/12] use mtune in apple-clang --- .../all/patches/0.2.0-0001-fix-cmake.patch | 53 +++++++++++-------- 1 file changed, 32 insertions(+), 21 deletions(-) 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 index 06d233c5d9883..34e716d725449 100644 --- a/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch +++ b/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch @@ -1,19 +1,38 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 38590f3..3cd57b6 100644 +index 38590f3..9295930 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -103,6 +103,10 @@ elseif(WIN32) +@@ -90,7 +90,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") + set (CMAKE_CXX_FLAGS_DEBUG "-Wall -ggdb -std=c++11 -DHAVE_CXX0X -march=native") + set (CMAKE_C_FLAGS_RELEASE "-Wall -Ofast -DNDEBUG -std=c99 -march=native") + set (CMAKE_C_FLAGS_DEBUG "-Wall -ggdb -std=c99 -march=native") +-elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") ++elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + if (CXX_COMPILER_VERSION VERSION_LESS 4.2.1) + message(STATUS "Clang version must be at least 4.2.1!" ) + endif() +@@ -98,11 +98,20 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STR + set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c++11 -DHAVE_CXX0X -march=native") + set (CMAKE_C_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c99 -march=native") + set (CMAKE_C_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c99 -march=native") ++elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") ++ set (CMAKE_CXX_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c++11 -DHAVE_CXX0X -mtune=native") ++ set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c++11 -DHAVE_CXX0X -mtune=native") ++ set (CMAKE_C_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c99 -mtune=native") ++ set (CMAKE_C_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c99 -mtune=native") + elseif(WIN32) + # TODO add support for later versions? 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") ++ 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,7 +133,7 @@ add_library(FastPFOR STATIC +@@ -129,7 +138,7 @@ add_library(FastPFOR STATIC src/streamvbyte.c) set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) @@ -22,7 +41,7 @@ index 38590f3..3cd57b6 100644 # other executables add_executable(gapstats src/gapstats.cpp) add_executable(partitionbylength src/partitionbylength.cpp) -@@ -149,7 +153,7 @@ if( SUPPORT_SSE42 ) +@@ -149,7 +158,7 @@ if( SUPPORT_SSE42 ) add_executable(benchbitpacking src/benchbitpacking.cpp) target_link_libraries(benchbitpacking FastPFOR) endif() @@ -31,27 +50,19 @@ index 38590f3..3cd57b6 100644 find_package(snappy) if(NOT ${snappy_FOUND}) message(STATUS "Snappy was not found. codecssnappy and " -@@ -158,13 +162,15 @@ else() +@@ -158,6 +167,7 @@ else() message(STATUS "Snappy was found. Building additional targets " "codecssnappy and inmemorybenchmarksnappy.") include_directories(${snappy_INCLUDE_DIRS}) -- add_executable(codecssnappy src/codecs.cpp) -+ if(0) -+ add_executable(codecssnappy src/codecs.cpp) ++ 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 +175,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() endif() option(WITH_TEST "Build with Google Test" ON) -@@ -256,4 +262,4 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.0.0) - endif() - configure_file("fastpfor.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/fastpfor.pc" @ONLY) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fastpfor.pc" -- DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") -\ No newline at end of file -+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") From bc83dfffab53837e7225775a92768e598be0437c Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 14 Nov 2024 02:01:55 +0900 Subject: [PATCH 04/12] support M1 Mac and armv8 --- recipes/fastpfor/all/conanfile.py | 26 +++++++--- .../all/patches/0.2.0-0001-fix-cmake.patch | 51 +++++++++++++++---- 2 files changed, 60 insertions(+), 17 deletions(-) diff --git a/recipes/fastpfor/all/conanfile.py b/recipes/fastpfor/all/conanfile.py index 0c16c907ad201..317d1faecba04 100644 --- a/recipes/fastpfor/all/conanfile.py +++ b/recipes/fastpfor/all/conanfile.py @@ -1,8 +1,8 @@ from conan import ConanFile -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 import os required_conan_version = ">=1.53.0" @@ -33,12 +33,12 @@ def config_options(self): 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") + def requirements(self): + if str(self.settings.arch).startswith("armv8"): + 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) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -46,6 +46,15 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["WITH_TEST"] = False + if str(self.settings.arch).startswith("armv8"): + tc.cache_variables["SUPPORT_NEON"] = True + tc.preprocessor_definitions["SIMDE_ENABLE_NATIVE_ALIASES"] = 1 + if is_apple_os(self): + tc.variables["CMAKE_OSX_ARCHITECTURES"] = { + "armv8": "arm64", + }.get(str(self.settings.arch), str(self.settings.arch)) + tc.generate() + tc = CMakeDeps(self) tc.generate() def build(self): @@ -71,6 +80,9 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") + if str(self.settings.arch).startswith("armv8"): + self.cpp_info.defines = ["SIMDE_ENABLE_NATIVE_ALIASES"] + # 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" 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 index 34e716d725449..ace5001020596 100644 --- a/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch +++ b/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch @@ -1,7 +1,16 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 38590f3..9295930 100644 +index 38590f3..cbe7357 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt +@@ -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") @@ -90,7 +90,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") set (CMAKE_CXX_FLAGS_DEBUG "-Wall -ggdb -std=c++11 -DHAVE_CXX0X -march=native") set (CMAKE_C_FLAGS_RELEASE "-Wall -Ofast -DNDEBUG -std=c99 -march=native") @@ -11,15 +20,19 @@ index 38590f3..9295930 100644 if (CXX_COMPILER_VERSION VERSION_LESS 4.2.1) message(STATUS "Clang version must be at least 4.2.1!" ) endif() -@@ -98,11 +98,20 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STR +@@ -98,11 +98,24 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STR set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c++11 -DHAVE_CXX0X -march=native") set (CMAKE_C_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c99 -march=native") set (CMAKE_C_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c99 -march=native") +elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") -+ set (CMAKE_CXX_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c++11 -DHAVE_CXX0X -mtune=native") -+ set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c++11 -DHAVE_CXX0X -mtune=native") -+ set (CMAKE_C_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c99 -mtune=native") -+ set (CMAKE_C_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c99 -mtune=native") ++ set(TUNE_FLAG "-mtune=native") ++ if(CMAKE_OSX_ARCHITECTURES MATCHES "arm64.*") ++ set(TUNE_FLAG "-mtune=apple-m1") ++ endif() ++ set (CMAKE_CXX_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c++11 -DHAVE_CXX0X ${TUNE_FLAG}") ++ set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c++11 -DHAVE_CXX0X ${TUNE_FLAG}") ++ set (CMAKE_C_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c99 ${TUNE_FLAG}") ++ set (CMAKE_C_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c99 ${TUNE_FLAG}") elseif(WIN32) # TODO add support for later versions? if(NOT MSVC12) @@ -32,7 +45,7 @@ index 38590f3..9295930 100644 else () message(FATAL_ERROR "Please, use GCC, Clang, or the Intel compiler!") endif() -@@ -129,7 +138,7 @@ add_library(FastPFOR STATIC +@@ -129,19 +142,19 @@ add_library(FastPFOR STATIC src/streamvbyte.c) set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) @@ -41,7 +54,25 @@ index 38590f3..9295930 100644 # other executables add_executable(gapstats src/gapstats.cpp) add_executable(partitionbylength src/partitionbylength.cpp) -@@ -149,7 +158,7 @@ if( SUPPORT_SSE42 ) + 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 +162,7 @@ if( SUPPORT_SSE42 ) add_executable(benchbitpacking src/benchbitpacking.cpp) target_link_libraries(benchbitpacking FastPFOR) endif() @@ -50,7 +81,7 @@ index 38590f3..9295930 100644 find_package(snappy) if(NOT ${snappy_FOUND}) message(STATUS "Snappy was not found. codecssnappy and " -@@ -158,6 +167,7 @@ else() +@@ -158,6 +171,7 @@ else() message(STATUS "Snappy was found. Building additional targets " "codecssnappy and inmemorybenchmarksnappy.") include_directories(${snappy_INCLUDE_DIRS}) @@ -58,7 +89,7 @@ index 38590f3..9295930 100644 add_executable(codecssnappy src/codecs.cpp) set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) -@@ -165,6 +175,7 @@ else() +@@ -165,6 +179,7 @@ else() add_executable(inmemorybenchmarksnappy src/inmemorybenchmark.cpp) set_target_properties(inmemorybenchmarksnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) target_link_libraries(inmemorybenchmarksnappy FastPFOR ${snappy_LIBRARIES}) From 316e12eee380582ff90c210f1b5148aa1a48b1b6 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 16 Nov 2024 02:15:19 +0900 Subject: [PATCH 05/12] use core-avx2 instead of native --- recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index ace5001020596..231804db7a9ae 100644 --- a/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch +++ b/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch @@ -25,7 +25,7 @@ index 38590f3..cbe7357 100644 set (CMAKE_C_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c99 -march=native") set (CMAKE_C_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c99 -march=native") +elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") -+ set(TUNE_FLAG "-mtune=native") ++ set(TUNE_FLAG "-mtune=core-avx2") + if(CMAKE_OSX_ARCHITECTURES MATCHES "arm64.*") + set(TUNE_FLAG "-mtune=apple-m1") + endif() From 13381d2cf0cd8fde22fe35a9c70f9225ebaa9f00 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 19 Nov 2024 21:22:26 +0900 Subject: [PATCH 06/12] remove cci versions --- recipes/fastpfor/all/conandata.yml | 14 ----- recipes/fastpfor/all/conanfile.py | 6 -- .../patches/cci.20220205-0001-fix-cmake.patch | 63 ------------------- .../patches/cci.20221225-0001-fix-cmake.patch | 62 ------------------ .../all/test_v1_package/CMakeLists.txt | 8 --- .../fastpfor/all/test_v1_package/conanfile.py | 17 ----- recipes/fastpfor/config.yml | 4 -- 7 files changed, 174 deletions(-) delete mode 100644 recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch delete mode 100644 recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch delete mode 100644 recipes/fastpfor/all/test_v1_package/CMakeLists.txt delete mode 100644 recipes/fastpfor/all/test_v1_package/conanfile.py diff --git a/recipes/fastpfor/all/conandata.yml b/recipes/fastpfor/all/conandata.yml index 2590f702e3dd4..13eae394eba76 100644 --- a/recipes/fastpfor/all/conandata.yml +++ b/recipes/fastpfor/all/conandata.yml @@ -2,22 +2,8 @@ sources: "0.2.0": url: "https://github.com/lemire/FastPFor/archive/refs/tags/v0.2.0.tar.gz" sha256: "6722f2cba2edb4c20a49280b1c6b8a999895c4bc1c031584a9b2670c3e54173e" - "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" patches: "0.2.0": - patch_file: "patches/0.2.0-0001-fix-cmake.patch" patch_description: "enable shared build, disable unittest/utility" patch_type: "conan" - "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" - 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 317d1faecba04..7830bec4e5868 100644 --- a/recipes/fastpfor/all/conanfile.py +++ b/recipes/fastpfor/all/conanfile.py @@ -82,9 +82,3 @@ def package_info(self): if str(self.settings.arch).startswith("armv8"): self.cpp_info.defines = ["SIMDE_ENABLE_NATIVE_ALIASES"] - - # 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" 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 75377b188a873..0000000000000 --- a/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch +++ /dev/null @@ -1,63 +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() -@@ -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 28f178297e097..0000000000000 --- a/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch +++ /dev/null @@ -1,62 +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() -@@ -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 3e78b01ec63e1..b370fcee5fe7c 100644 --- a/recipes/fastpfor/config.yml +++ b/recipes/fastpfor/config.yml @@ -1,7 +1,3 @@ versions: "0.2.0": folder: all - "cci.20221225": - folder: all - "cci.20220205": - folder: all From beb4c8fea3327cf641ecfbc7f1a4e4eb81e22e30 Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Tue, 19 Nov 2024 16:08:00 +0100 Subject: [PATCH 07/12] remove `CMAKE_CXX_STANDARD` --- recipes/fastpfor/all/conanfile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes/fastpfor/all/conanfile.py b/recipes/fastpfor/all/conanfile.py index 7830bec4e5868..e09804605c3cb 100644 --- a/recipes/fastpfor/all/conanfile.py +++ b/recipes/fastpfor/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.apple import is_apple_os @@ -40,8 +40,15 @@ def requirements(self): def validate(self): check_min_cppstd(self, 11) + def _patch_sources(self): + # Let Conan set the C++ standard + if self.settings.compiler.cppstd: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD 11)", "") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._patch_sources() def generate(self): tc = CMakeToolchain(self) From 1b91fd99d52f0b07509dcc0fb627f0b19bc74a5e Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Tue, 19 Nov 2024 16:34:25 +0100 Subject: [PATCH 08/12] fix --- recipes/fastpfor/all/conanfile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/recipes/fastpfor/all/conanfile.py b/recipes/fastpfor/all/conanfile.py index e09804605c3cb..b3440ac2f2608 100644 --- a/recipes/fastpfor/all/conanfile.py +++ b/recipes/fastpfor/all/conanfile.py @@ -42,9 +42,8 @@ def validate(self): def _patch_sources(self): # Let Conan set the C++ standard - if self.settings.compiler.cppstd: - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "set(CMAKE_CXX_STANDARD 11)", "") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD 11)", "") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From f0a5ff5ab430dc12169962eb6e1ffd9032524d28 Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Tue, 19 Nov 2024 16:40:46 +0100 Subject: [PATCH 09/12] fix sha --- recipes/fastpfor/all/conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/fastpfor/all/conandata.yml b/recipes/fastpfor/all/conandata.yml index 13eae394eba76..28f460ca23316 100644 --- a/recipes/fastpfor/all/conandata.yml +++ b/recipes/fastpfor/all/conandata.yml @@ -1,7 +1,7 @@ sources: "0.2.0": url: "https://github.com/lemire/FastPFor/archive/refs/tags/v0.2.0.tar.gz" - sha256: "6722f2cba2edb4c20a49280b1c6b8a999895c4bc1c031584a9b2670c3e54173e" + sha256: "d9f0eacf9c3c61866cda23bae35107ca9c5d35fa7b7a96ca9ccc85803d7e753d" patches: "0.2.0": - patch_file: "patches/0.2.0-0001-fix-cmake.patch" From 944d6de2b16e84d7be9ad08b9c250d78c65421ab Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Tue, 19 Nov 2024 16:55:03 +0100 Subject: [PATCH 10/12] pattern fix --- recipes/fastpfor/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/fastpfor/all/conanfile.py b/recipes/fastpfor/all/conanfile.py index b3440ac2f2608..67b78bbf0fcd2 100644 --- a/recipes/fastpfor/all/conanfile.py +++ b/recipes/fastpfor/all/conanfile.py @@ -43,7 +43,7 @@ def validate(self): def _patch_sources(self): # Let Conan set the C++ standard replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "set(CMAKE_CXX_STANDARD 11)", "") + "set (CMAKE_CXX_STANDARD 11)", "") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From 4b617fcedcc0ac0737b2563498d171aefd754b43 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 20 Nov 2024 02:47:07 +0900 Subject: [PATCH 11/12] drop support apple-clang < 15.0 --- recipes/fastpfor/all/conanfile.py | 18 ++++---- .../all/patches/0.2.0-0001-fix-cmake.patch | 44 +++++++------------ 2 files changed, 23 insertions(+), 39 deletions(-) diff --git a/recipes/fastpfor/all/conanfile.py b/recipes/fastpfor/all/conanfile.py index 67b78bbf0fcd2..97d9bb5429b3e 100644 --- a/recipes/fastpfor/all/conanfile.py +++ b/recipes/fastpfor/all/conanfile.py @@ -1,8 +1,10 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file +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, 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" @@ -34,25 +36,22 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if str(self.settings.arch).startswith("armv8"): + if "arm" in str(self.settings.arch): self.requires("simde/0.8.0", transitive_headers=True) def validate(self): check_min_cppstd(self, 11) - - def _patch_sources(self): - # Let Conan set the C++ standard - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "set (CMAKE_CXX_STANDARD 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) - self._patch_sources() + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) tc.variables["WITH_TEST"] = False - if str(self.settings.arch).startswith("armv8"): + if "arm" in str(self.settings.arch): tc.cache_variables["SUPPORT_NEON"] = True tc.preprocessor_definitions["SIMDE_ENABLE_NATIVE_ALIASES"] = 1 if is_apple_os(self): @@ -64,7 +63,6 @@ def generate(self): tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() 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 index 231804db7a9ae..8ba1054fb355a 100644 --- a/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch +++ b/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch @@ -1,7 +1,16 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 38590f3..cbe7357 100644 +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() @@ -11,30 +20,7 @@ index 38590f3..cbe7357 100644 MESSAGE(STATUS "USING SIMDE FOR SIMD OPERATIONS") else () MESSAGE(STATUS "SIMDE and SSE 4.2 support not detected") -@@ -90,7 +90,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") - set (CMAKE_CXX_FLAGS_DEBUG "-Wall -ggdb -std=c++11 -DHAVE_CXX0X -march=native") - set (CMAKE_C_FLAGS_RELEASE "-Wall -Ofast -DNDEBUG -std=c99 -march=native") - set (CMAKE_C_FLAGS_DEBUG "-Wall -ggdb -std=c99 -march=native") --elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") -+elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") - if (CXX_COMPILER_VERSION VERSION_LESS 4.2.1) - message(STATUS "Clang version must be at least 4.2.1!" ) - endif() -@@ -98,11 +98,24 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STR - set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c++11 -DHAVE_CXX0X -march=native") - set (CMAKE_C_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c99 -march=native") - set (CMAKE_C_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c99 -march=native") -+elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") -+ set(TUNE_FLAG "-mtune=core-avx2") -+ if(CMAKE_OSX_ARCHITECTURES MATCHES "arm64.*") -+ set(TUNE_FLAG "-mtune=apple-m1") -+ endif() -+ set (CMAKE_CXX_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c++11 -DHAVE_CXX0X ${TUNE_FLAG}") -+ set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c++11 -DHAVE_CXX0X ${TUNE_FLAG}") -+ set (CMAKE_C_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c99 ${TUNE_FLAG}") -+ set (CMAKE_C_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c99 ${TUNE_FLAG}") - elseif(WIN32) - # TODO add support for later versions? +@@ -103,6 +103,10 @@ elseif(WIN32) if(NOT MSVC12) message(STATUS "On Windows, only MSVC version 12 is supported!") endif() @@ -45,7 +31,7 @@ index 38590f3..cbe7357 100644 else () message(FATAL_ERROR "Please, use GCC, Clang, or the Intel compiler!") endif() -@@ -129,19 +142,19 @@ add_library(FastPFOR STATIC +@@ -129,19 +133,19 @@ add_library(FastPFOR STATIC src/streamvbyte.c) set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) @@ -72,7 +58,7 @@ index 38590f3..cbe7357 100644 add_executable(entropy src/entropy.cpp) target_link_libraries(entropy FastPFOR) -@@ -149,7 +162,7 @@ if( SUPPORT_SSE42 ) +@@ -149,7 +153,7 @@ if( SUPPORT_SSE42 ) add_executable(benchbitpacking src/benchbitpacking.cpp) target_link_libraries(benchbitpacking FastPFOR) endif() @@ -81,7 +67,7 @@ index 38590f3..cbe7357 100644 find_package(snappy) if(NOT ${snappy_FOUND}) message(STATUS "Snappy was not found. codecssnappy and " -@@ -158,6 +171,7 @@ else() +@@ -158,6 +162,7 @@ else() message(STATUS "Snappy was found. Building additional targets " "codecssnappy and inmemorybenchmarksnappy.") include_directories(${snappy_INCLUDE_DIRS}) @@ -89,7 +75,7 @@ index 38590f3..cbe7357 100644 add_executable(codecssnappy src/codecs.cpp) set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) -@@ -165,6 +179,7 @@ else() +@@ -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}) From 8eb031c50e6531d50aa60887a5fb7c9f00efbc3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abril=20Rinc=C3=B3n=20Blanco?= Date: Wed, 20 Nov 2024 12:22:13 +0100 Subject: [PATCH 12/12] Name _has_simde condition --- recipes/fastpfor/all/conanfile.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/recipes/fastpfor/all/conanfile.py b/recipes/fastpfor/all/conanfile.py index 97d9bb5429b3e..3e02d3498b338 100644 --- a/recipes/fastpfor/all/conanfile.py +++ b/recipes/fastpfor/all/conanfile.py @@ -35,8 +35,12 @@ def config_options(self): def layout(self): cmake_layout(self, src_folder="src") + @property + def _has_simde(self): + return "arm" in str(self.settings.arch) + def requirements(self): - if "arm" in str(self.settings.arch): + if self._has_simde: self.requires("simde/0.8.0", transitive_headers=True) def validate(self): @@ -51,13 +55,9 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["WITH_TEST"] = False - if "arm" in str(self.settings.arch): + if self._has_simde: tc.cache_variables["SUPPORT_NEON"] = True tc.preprocessor_definitions["SIMDE_ENABLE_NATIVE_ALIASES"] = 1 - if is_apple_os(self): - tc.variables["CMAKE_OSX_ARCHITECTURES"] = { - "armv8": "arm64", - }.get(str(self.settings.arch), str(self.settings.arch)) tc.generate() tc = CMakeDeps(self) tc.generate() @@ -84,5 +84,5 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - if str(self.settings.arch).startswith("armv8"): + if self._has_simde: self.cpp_info.defines = ["SIMDE_ENABLE_NATIVE_ALIASES"]