From 8104d17ba54a903b9905f072e2e5e44ba8480205 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 5 Mar 2025 11:17:41 -0500 Subject: [PATCH 1/6] Use %{x86_64}/%{arm64} instead of x86_64/aarch64, for generality --- sleef.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sleef.spec b/sleef.spec index e3da8d1..319c434 100644 --- a/sleef.spec +++ b/sleef.spec @@ -50,7 +50,7 @@ BuildRequires: pkgconfig(fftw3) # See https://sleef.org/additional.xhtml#gnuabi. The gnuabi version of the # library only applies to these architectures. -%global gnuabi_arches %{ix86} x86_64 aarch64 +%global gnuabi_arches %{ix86} %{x86_64} %{arm64} # See https://github.com/shibatch/sleef/pull/283. %if %{with static} %global inline_enabled 1 @@ -202,7 +202,7 @@ developing applications that use sleef-quad. %check skips='^($.' -%ifarch aarch64 +%ifarch %{arm64} # Some tests are specifically for SVE code. We can only run these tests on # builder hardware that has the SVE extensions, which are not part of the # aarch64 baseline. From a18465077def557bb50af64aec7d3ff75e5412ba Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 16 Apr 2025 15:29:09 -0400 Subject: [PATCH 2/6] Update to 3.9.0 (close RHBZ#2355181) --- .gitignore | 1 + sleef.spec | 76 +++++++++++++++++++++++++++++++++++++++++++++++++----- sources | 2 +- 3 files changed, 72 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index ae7c8f0..707f265 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /sleef-3.6.1-filtered.tar.zst /sleef-3.7-filtered.tar.zst /sleef-3.8-filtered.tar.zst +/sleef-3.9.0-filtered.tar.zst diff --git a/sleef.spec b/sleef.spec index 319c434..8c5ca5f 100644 --- a/sleef.spec +++ b/sleef.spec @@ -6,9 +6,12 @@ # this feature disabled until someone asks for it. %bcond static 0 +# Adds a BuildRequires on tlfloat and enables more tests +%bcond tlfloat 1 + Name: sleef -Version: 3.8.0 -%global tag 3.8 +Version: 3.9.0 +%global tag %{version} %global so_version 3 Release: %autorelease Summary: Vectorized math library @@ -36,8 +39,38 @@ Source1: get_source.sh # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} +# On aarch64, since 3.9.0, we cannot link at least bin/tester3svenofma when LTO +# is enabled, due to confusion about SVE. +# +# /builddir/build/BUILD/sleef-3.9.0-build/sleef-3.9.0/src/common/testerutil.c: +# In function ‘memrand.constprop’: +# /builddir/build/BUILD/sleef-3.9.0-build/sleef-3.9.0/src/common/testerutil.c:101:6: +# error: this operation requires the SVE ISA extension +# 101 | void memrand(void *p, int size) { +# | ^ +# /builddir/build/BUILD/sleef-3.9.0-build/sleef-3.9.0/src/common/testerutil.c:101:6: +# note: you can enable SVE using the command-line option ‘-march’, or by +# using the ‘target’ attribute or pragma +# /builddir/build/BUILD/sleef-3.9.0-build/sleef-3.9.0/src/common/testerutil.c:101: +# confused by earlier errors, bailing out +# +# This might be an upstream bug, but it is hard to understand. Upstream +# provides their own LTO option, SLEEF_ENABLE_LTO, but for does not support it +# in combination with shared libraries. +# +# - We could still build the library with LTO and not test it +# (-DSLEEF_BUILD_TESTS:BOOL=FALSE) on aarch64. +# - It’s not clear how we could disable LTO *only for the tests*. +# - We choose to disable LTO entirely on aarch64, because we really want to run +# the tests. We hope that the performance impact is not significant. It +# currently does not seem necessary to disable LTO on other architectures. +%ifarch %{arm64} +%global _lto_cflags %{nil} +%endif + BuildRequires: cmake >= 3.4.3 BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: ninja-build # For tests only: BuildRequires: pkgconfig(mpfr) @@ -47,6 +80,9 @@ BuildRequires: pkgconfig(libcrypto) %if %{with dft} BuildRequires: pkgconfig(fftw3) %endif +%if %{with tlfloat} +BuildRequires: pkgconfig(tlfloat) +%endif # See https://sleef.org/additional.xhtml#gnuabi. The gnuabi version of the # library only applies to these architectures. @@ -173,6 +209,7 @@ developing applications that use sleef-quad. # -GNinja: This used to be required for parallel builds; it is still faster. # # -DENFORCE_TESTER3: The build should fail if we cannot build all tests. +# -DENFORCE_TESTER4: Likewise, except that tester4 requires tlfloat. # # -DBUILD_INLINE_HEADERS: Do not build the “inline” headers. This would provide # an arch-specific collection of sleefinline_*.h headers in _includedir, as @@ -181,14 +218,27 @@ developing applications that use sleef-quad. # and would thus also be treated as a static library in the Fedora # guidelines) should be omitted unless something in Fedora absolutely # requires them. +# +# -DSLEEFDFT_ENABLE_STREAM: The author writes, “The recommended value for +# SLEEFDFT_ENABLE_STREAM depends on the architecture, and it is only +# recommended to be turned on on x86_64.” +# https://github.com/shibatch/sleef/discussions/654#discussioncomment-12860550 %cmake \ -GNinja \ -DSLEEF_BUILD_DFT:BOOL=%{?with_dft:TRUE}%{?!with_dft:FALSE} \ + -DSLEEF_ENFORCE_DFT:BOOL=%{?with_dft:TRUE}%{?!with_dft:FALSE} \ +%ifarch %{x86_64} + -DSLEEFDFT_ENABLE_STREAM:BOOL=TRUE \ +%else + -DSLEEFDFT_ENABLE_STREAM:BOOL=FALSE \ +%endif -DSLEEF_BUILD_GNUABI_LIBS:BOOL=%{?gnuabi_enabled:TRUE}%{?!gnuabi_enabled:FALSE} \ -DSLEEF_BUILD_INLINE_HEADERS:BOOL=%{?inline_enabled:TRUE}%{?!inline_enabled:FALSE} \ -DSLEEF_BUILD_QUAD:BOOL=%{?with_quad:TRUE}%{?!with_quad:FALSE} \ - -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ - -DSLEEF_ENFORCE_TESTER3:BOOL=TRUE + -DSLEEF_BUILD_SHARED_LIBS:BOOL=TRUE \ + -DSLEEF_ENFORCE_TESTER3:BOOL=TRUE \ + -DSLEEF_ENFORCE_TESTER4:BOOL=%{?with_tlfloat:TRUE}%{?!with_tlfloat:FALSE} \ + -DSLEEF_ENABLE_TLFLOAT:BOOL=%{?with_tlfloat:TRUE}%{?!with_tlfloat:FALSE} %build @@ -200,17 +250,31 @@ developing applications that use sleef-quad. %check +# Logging CPU features is helpful for debugging, especially in COPR builds +# where the builder hardware information is not necessarily logged separately. +echo '==== Build host CPU features ====' +cat /proc/cpuinfo + skips='^($.' %ifarch %{arm64} # Some tests are specifically for SVE code. We can only run these tests on # builder hardware that has the SVE extensions, which are not part of the # aarch64 baseline. -if ! grep -E '[Ff]lags.*\bsve\b' /proc/cpuinfo >/dev/null +if ! grep -E '[Ff](lags|eatures).*\bsve\b' /proc/cpuinfo >/dev/null then skips="${skips}|gnuabi_compatibility_SVE(_masked)?|qiutsve" fi %endif +%ifarch %{power64} +# Some tests are specifically for VSX3 code. We can only run these tests on +# builder hardware that has the VSX3 extensions (POWER 9 or later), which are +# not part of the ppc64le baseline (POWER 8). +if grep -E -i '\bPOWER8\b' /proc/cpuinfo >/dev/null +then + skips="${skips}|.*vsx3(nofma)?" +fi +%endif skips="${skips})$" @@ -239,7 +303,7 @@ skips="${skips})$" %files doc %license LICENSE.txt %doc CHANGELOG.md -%doc README.md +%doc README.adoc %doc docs/ diff --git a/sources b/sources index 573d70b..a0b715a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sleef-3.8-filtered.tar.zst) = 51942a633efb4e5b452530c3a34ac6983d7b77c7cf8f17dc0cd46934585ed6ae2745fce81438e0757aeb464be3b1677ab34d1421d7601a46069f490881cc9d89 +SHA512 (sleef-3.9.0-filtered.tar.zst) = 4c55c310795569debed8c771cf0251a126e8291515bf562e6ac4b611dafe6df5fd0024d129dbeaf2c6bce39112bb8a826acabd762beebdd17de86259394b5933 From a3aef29bbe8a111fa845cd58bf85ca9f64c734b5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 10 May 2025 22:33:05 -0400 Subject: [PATCH 3/6] Update .rpmlintrc file for current rpmlint --- sleef.rpmlintrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sleef.rpmlintrc b/sleef.rpmlintrc index 16b8bfd..7a1f9b5 100644 --- a/sleef.rpmlintrc +++ b/sleef.rpmlintrc @@ -1,9 +1,12 @@ # These are not real spelling errors... -addFilter(r" spelling-error \('[Vv]ectorized', ") addFilter(r"sleef-gnuabi\..*: spelling-error \('(lib(sleefgnuabi|mvec)|glibc)', ") # All of the documentation is in the -doc subpackage. addFilter(r" no-documentation") # This Source cannot be a URL because we must filter out certain files. -addFilter(r" invalid-url Source[0-9]+: sleef-.*-filtered\.tar\.xz") +addFilter(r" invalid-url Source[0-9]+: sleef-.*-filtered\.tar\.zst") # Bogus; it is a perfectly fine zstandard file. -addFilter(r" inconsistent-file-extension sleef-.*-filtered\.tar\.xz") +addFilter(r" inconsistent-file-extension sleef-.*-filtered\.tar\.zst") +# We are not sure why some files from docs/ are duplicated in docs/src/. The +# files are small compared to the documentation overall, so it does not seem +# worth too much investigation, and hardlinking them would be a little tedious. +addFilter(r" files-duplicate /.*/docs/src/") From 7acb0cb61f8890f5c872297165c0b47f90b0ab8f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 10 May 2025 22:34:26 -0400 Subject: [PATCH 4/6] Remove an unwanted hidden file from the docs --- sleef.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sleef.spec b/sleef.spec index 8c5ca5f..ae87511 100644 --- a/sleef.spec +++ b/sleef.spec @@ -203,6 +203,8 @@ developing applications that use sleef-quad. %prep %autosetup -n sleef-%{tag} -p1 +# Remove an unwanted hidden file from the docs +find docs/ -type f -name .nojekyll -print -delete %conf From 629c1eb702ab2c9981b55676418cf98f37b996cd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 18:24:31 +0000 Subject: [PATCH 5/6] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 0baa1447f407b153426b76b8c9de36f124008952 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 11 Jan 2026 00:01:53 +0000 Subject: [PATCH 6/6] Skip a test that fails on x86_64 with GCC 16 --- sleef.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sleef.spec b/sleef.spec index ae87511..ea7b1d4 100644 --- a/sleef.spec +++ b/sleef.spec @@ -278,6 +278,18 @@ then fi %endif +%ifarch %{x86_64} +%if %{undefined fc43} && %{undefined fc42} && %{undefined el10} +# At least one test within this executable fails since GCC 16 landed in Fedora +# 44. It’s not very easy to tell exactly what is going wrong, and upstream is +# not likely to be interested since (as determined by bisection) the failure +# was resolved upstream by the removal of no-FMA helpers in +# https://github.com/shibatch/sleef/pull/685. Let’s just skip this while we +# await the next upstream release. +skips="${skips}|tester4ypurec_scalar" +%endif +%endif + skips="${skips})$" %ctest --exclude-regex "${skips}" --extra-verbose