From 8c6de4e58864956838cbd8c28b1538b98f16cb1f Mon Sep 17 00:00:00 2001 From: Nick Smith Date: Tue, 13 Sep 2022 09:40:56 -0500 Subject: [PATCH 1/4] Try alternative xxhash implementation Hopefully it can compile on non-x86 arch --- .gitmodules | 2 +- CMakeLists.txt | 2 +- src/correction.cc | 5 +++-- xxhash | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index c1bb64c7..76f6d66b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,4 +12,4 @@ url = https://github.com/imneme/pcg-cpp.git [submodule "xxhash"] path = xxhash - url = https://github.com/RedSpah/xxhash_cpp.git + url = https://github.com/Cyan4973/xxHash.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 0be16725..679eb6c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ target_include_directories(correctionlib PRIVATE $ $ - $ + $ $ ) target_compile_features(correctionlib PUBLIC cxx_std_17) diff --git a/src/correction.cc b/src/correction.cc index b710aab8..692cd79e 100644 --- a/src/correction.cc +++ b/src/correction.cc @@ -7,7 +7,8 @@ #include #include #include "correction.h" -#include "xxhash.hpp" +#define XXH_INLINE_ALL 1 +#include "xxhash.h" #include "pcg_random.hpp" #if __has_include() #include @@ -288,7 +289,7 @@ double HashPRNG::evaluate(const std::vector& values) const { } else { throw std::logic_error("I should not have ever seen a string"); } } - gen.seed(xxh::xxhash<64>((const void*) seedData, nbytes)); + gen.seed(XXH64((const void*) seedData, nbytes, 0ul)); switch (dist_) { case Distribution::stdflat: return std::uniform_real_distribution<>()(gen); diff --git a/xxhash b/xxhash index 62469667..35b0373c 160000 --- a/xxhash +++ b/xxhash @@ -1 +1 @@ -Subproject commit 62469667b46703e42529358f80a06e58a506d26f +Subproject commit 35b0373c697b5f160d3db26b1cbb45a0d5ba788c From c5d7e8865b3add4b25b3ec58e57c8ad3f39cc33d Mon Sep 17 00:00:00 2001 From: Nick Smith Date: Tue, 13 Sep 2022 10:04:54 -0500 Subject: [PATCH 2/4] Pin formatting CI python version To work around https://github.com/python/mypy/issues/13627 --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 305eba0f..c1e183f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,8 @@ jobs: with: submodules: recursive - uses: actions/setup-python@v3 + with: + python-version: 3.10.6 - uses: pre-commit/action@v3.0.0 with: extra_args: --hook-stage manual --all-files From a2e7c4ba52fed999bbb9d23822a749515bd19d39 Mon Sep 17 00:00:00 2001 From: Nick Smith Date: Tue, 13 Sep 2022 11:20:17 -0500 Subject: [PATCH 3/4] Revert adding pypy to builds --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c5ea73cf..3f7cf402 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ build-backend = "setuptools.build_meta" write_to = "src/correctionlib/version.py" [tool.cibuildwheel] -skip = ["cp311-*"] +skip = ["pp*-*", "cp311-*"] test-extras = "test" test-command = "python -m pytest {package}/tests" # update skip when numpy wheels become available From 81db581983516810a093c15d76194edbab89f3c1 Mon Sep 17 00:00:00 2001 From: Nick Smith Date: Tue, 13 Sep 2022 12:28:16 -0500 Subject: [PATCH 4/4] Add includes in makefile as well --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b334f8a3..f91594d0 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ else PYLDFLAG=-Wl,-rpath,'$$ORIGIN/lib' endif OSXFLAG=$(shell uname|grep -q Darwin && echo "-undefined dynamic_lookup") -CFLAGS=--std=c++17 -O3 -Wall -fPIC -Irapidjson/include -Ipybind11/include -Icpp-peglib $(PYINC) -Iinclude +CFLAGS=--std=c++17 -O3 -Wall -fPIC -Irapidjson/include -Ipybind11/include -Icpp-peglib -Ixxhash -Ipcg-cpp/include $(PYINC) -Iinclude PREFIX ?= correctionlib STRVER=$(shell git describe --tags) MAJOR=$(shell git describe --tags|sed -n "s/v\([0-9]\+\)\..*/\1/p")