]> git.pld-linux.org Git - packages/highway.git/commitdiff
- float16 patch to fix x86 build with gcc 12+ and sse2 not enabled auto/th/highway-1.0.6-2
authorJakub Bogusz <qboosh@pld-linux.org>
Mon, 21 Aug 2023 20:02:32 +0000 (22:02 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Mon, 21 Aug 2023 20:02:32 +0000 (22:02 +0200)
- no-avx patch to disable test failing on CPU without AVX
- release 2

highway-float16.patch [new file with mode: 0644]
highway-no-avx.patch [new file with mode: 0644]
highway.spec

diff --git a/highway-float16.patch b/highway-float16.patch
new file mode 100644 (file)
index 0000000..83a8519
--- /dev/null
@@ -0,0 +1,11 @@
+--- highway-1.0.6/hwy/base.h.orig      2023-08-11 15:54:08.000000000 +0200
++++ highway-1.0.6/hwy/base.h   2023-08-21 20:19:20.042867861 +0200
+@@ -381,7 +381,7 @@ using float16_t = __fp16;
+ //    which is missing __extendhfsf2.
+ #elif (                                                                        \
+     (HWY_ARCH_RVV && defined(__riscv_zvfh) && HWY_COMPILER_CLANG) ||           \
+-    (HWY_ARCH_X86 && ((HWY_COMPILER_CLANG >= 1600 && !HWY_COMPILER_CLANGCL) || \
++    (HWY_ARCH_X86 && defined(__sse2__) && ((HWY_COMPILER_CLANG >= 1600 && !HWY_COMPILER_CLANGCL) || \
+                       HWY_COMPILER_GCC_ACTUAL >= 1200)))
+ using float16_t = _Float16;
+ // 3) Otherwise emulate
diff --git a/highway-no-avx.patch b/highway-no-avx.patch
new file mode 100644 (file)
index 0000000..583cb56
--- /dev/null
@@ -0,0 +1,11 @@
+With gcc 13 AVX is used in static initialization in math_test.cc
+--- highway-1.0.6/CMakeLists.txt.orig  2023-08-11 15:54:08.000000000 +0200
++++ highway-1.0.6/CMakeLists.txt       2023-08-21 21:31:34.886441037 +0200
+@@ -564,7 +564,6 @@ list(APPEND HWY_TEST_FILES
+   hwy/contrib/image/image_test.cc
+   # Disabled due to SIGILL in clang7 debug build during gtest discovery phase,
+   # not reproducible locally. Still tested via bazel build.
+-  hwy/contrib/math/math_test.cc
+   hwy/contrib/sort/sort_test.cc
+   hwy/contrib/sort/bench_sort.cc
+   hwy/contrib/unroller/unroller_test.cc
index d517df75ba96e0cb6e39fdd087e1c82fa8699192..dd2b2aa84357f782a4ffe048c95466103228c21c 100644 (file)
@@ -1,24 +1,28 @@
 #
 # Conditional build:
 %bcond_without apidocs         # API documentation
+%bcond_with    sse2            # SSE2 instructions on x86/x32
 %bcond_without tests           # don't build tests
 #
 Summary:       Efficient and performance-portable SIMD
 Summary(pl.UTF-8):     Wydajne i przenoĊ›ne operacje SIMD
 Name:          highway
 Version:       1.0.6
-Release:       1
+Release:       2
 License:       Apache v2.0
 Group:         Libraries
 #Source0Download: https://github.com/google/highway/releases
 Source0:       https://github.com/google/highway/archive/%{version}/%{name}-%{version}.tar.gz
 # Source0-md5: 405abf8d94b618befd44b2cb60a90c0e
+Patch0:                %{name}-float16.patch
+Patch1:                %{name}-no-avx.patch
 URL:           https://github.com/google/highway
 BuildRequires: cmake >= 3.10
 %{?with_tests:BuildRequires:   gtest-devel}
 BuildRequires: libstdc++-devel >= 6:4.7
 BuildRequires: rpm-build >= 4.6
 BuildRequires: rpmbuild(macros) >= 1.742
+%{?with_sse2:Requires: cpuinfo(sse2)}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -83,10 +87,15 @@ Dokumentacja API biblioteki Highway.
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
 
 %build
 install -d build
 cd build
+%if %{with sse2}
+CXXFLAGS="%{rpmcxxflags} -msse2"
+%endif
 %cmake .. \
        %{cmake_on_off tests BUILD_TESTING} \
        -DCMAKE_INSTALL_INCLUDEDIR=include \
This page took 0.174952 seconds and 4 git commands to generate.