From ab5fc1f1f2c8565970494ff4f70aeab33b4cd0c2 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 18 Mar 2024 11:28:41 -0400 Subject: [PATCH 01/23] Work around a GCC optimization bug --- sleef.spec | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sleef.spec b/sleef.spec index 5a69c1d..b296c46 100644 --- a/sleef.spec +++ b/sleef.spec @@ -198,6 +198,14 @@ rm -vrf src/gencoef %build +# Workaround for optimization bug present in GCC 12-14. See: +# Certain tests fail on gcc 12.0.0 pre-release +# https://github.com/shibatch/sleef/issues/439 +# and the fix +# match.pd: Only merge truncation with conversion for -fno-signed-zeros +# https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=7dd3b2b09cbeb6712ec680a0445cb0ad41070423 +# This can be removed when the packaged GCC contains the fix. +export CXXFLAGS="${CXXFLAGS} -ftrapping-math" # -GNinja: Upstream prominently states that parallel build is only supported # with the Ninja generator for cmake, not with the make one. See # https://sleef.org/compile.xhtml. @@ -228,17 +236,6 @@ rm -vrf src/gencoef %check skips='^($.' -# https://github.com/shibatch/sleef/issues/439 -%ifarch x86_64 %{arm64} ppc64le s390x -skips="${skips}|iuty?purecfma_scalar" -%endif -%ifarch %{arm64} ppc64le s390x -skips="${skips}|iuty?purec_scalar" -%endif -%ifarch s390x -skips="${skips}|iuty?zvector2(nofma)?" -%endif - %if %{with dft} # The DFT library has known test failures # (https://github.com/shibatch/sleef/issues/214). From 086cdb790b7877e28befcb4b13abd6deea3fb259 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 18 Mar 2024 12:54:24 -0400 Subject: [PATCH 02/23] Revert "Work around a GCC optimization bug" This reverts commit ab5fc1f1f2c8565970494ff4f70aeab33b4cd0c2. --- sleef.spec | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sleef.spec b/sleef.spec index b296c46..5a69c1d 100644 --- a/sleef.spec +++ b/sleef.spec @@ -198,14 +198,6 @@ rm -vrf src/gencoef %build -# Workaround for optimization bug present in GCC 12-14. See: -# Certain tests fail on gcc 12.0.0 pre-release -# https://github.com/shibatch/sleef/issues/439 -# and the fix -# match.pd: Only merge truncation with conversion for -fno-signed-zeros -# https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=7dd3b2b09cbeb6712ec680a0445cb0ad41070423 -# This can be removed when the packaged GCC contains the fix. -export CXXFLAGS="${CXXFLAGS} -ftrapping-math" # -GNinja: Upstream prominently states that parallel build is only supported # with the Ninja generator for cmake, not with the make one. See # https://sleef.org/compile.xhtml. @@ -236,6 +228,17 @@ export CXXFLAGS="${CXXFLAGS} -ftrapping-math" %check skips='^($.' +# https://github.com/shibatch/sleef/issues/439 +%ifarch x86_64 %{arm64} ppc64le s390x +skips="${skips}|iuty?purecfma_scalar" +%endif +%ifarch %{arm64} ppc64le s390x +skips="${skips}|iuty?purec_scalar" +%endif +%ifarch s390x +skips="${skips}|iuty?zvector2(nofma)?" +%endif + %if %{with dft} # The DFT library has known test failures # (https://github.com/shibatch/sleef/issues/214). From 2fbeac2c718ea572114cd26f6678aca6f503d46a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 18 Mar 2024 13:00:53 -0400 Subject: [PATCH 03/23] Stop skipping tests; optimization bug fixed in GCC --- sleef.spec | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sleef.spec b/sleef.spec index 5a69c1d..03b0f10 100644 --- a/sleef.spec +++ b/sleef.spec @@ -228,17 +228,6 @@ rm -vrf src/gencoef %check skips='^($.' -# https://github.com/shibatch/sleef/issues/439 -%ifarch x86_64 %{arm64} ppc64le s390x -skips="${skips}|iuty?purecfma_scalar" -%endif -%ifarch %{arm64} ppc64le s390x -skips="${skips}|iuty?purec_scalar" -%endif -%ifarch s390x -skips="${skips}|iuty?zvector2(nofma)?" -%endif - %if %{with dft} # The DFT library has known test failures # (https://github.com/shibatch/sleef/issues/214). From ac0b91f82c85de11b5f27a3f033a84ba39528e8c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 18 Mar 2024 13:00:53 -0400 Subject: [PATCH 04/23] Stop skipping tests; optimization bug fixed in GCC --- sleef.spec | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sleef.spec b/sleef.spec index 5a69c1d..03b0f10 100644 --- a/sleef.spec +++ b/sleef.spec @@ -228,17 +228,6 @@ rm -vrf src/gencoef %check skips='^($.' -# https://github.com/shibatch/sleef/issues/439 -%ifarch x86_64 %{arm64} ppc64le s390x -skips="${skips}|iuty?purecfma_scalar" -%endif -%ifarch %{arm64} ppc64le s390x -skips="${skips}|iuty?purec_scalar" -%endif -%ifarch s390x -skips="${skips}|iuty?zvector2(nofma)?" -%endif - %if %{with dft} # The DFT library has known test failures # (https://github.com/shibatch/sleef/issues/214). From a8d844f4bd94acb5f76dc3f87a88b986352ad573 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 18 Mar 2024 20:20:48 -0400 Subject: [PATCH 05/23] Update the rpmlintrc file [skip changelog] --- sleef.rpmlintrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sleef.rpmlintrc b/sleef.rpmlintrc index 0e0dc24..4f93bb6 100644 --- a/sleef.rpmlintrc +++ b/sleef.rpmlintrc @@ -1,2 +1,7 @@ # These are not real spelling errors... -addFilter(r'spelling-error .*(\(en_US\)| en_US) ([Vv]ectorized) ') +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") From 573b6b432cf3afde383d0c09080842ca0feda272 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 5 Apr 2024 12:23:27 -0400 Subject: [PATCH 06/23] Improve reproducibility of the filtered source archive --- get_source.sh | 16 +++++++++++++++- sources | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/get_source.sh b/get_source.sh index d17508c..023d94e 100755 --- a/get_source.sh +++ b/get_source.sh @@ -40,13 +40,27 @@ trap "rm -rvf '${XDIR}'" INT TERM EXIT cd "${XDIR}" curl -L -O "${SOURCE0}" tar -xzvf "${TARNAME}" +MTIME="$(stat -c '%Y' "${TARDIR}")" rm -rvf "${TARDIR}/src/gencoef/" if grep -ErinI 'Attribution 4\.0' . then echo 'ERROR: did not properly remove problematic content' 1>&2 exit 1 fi -tar -cv "${TARDIR}/" | xz -9e > "${NEWTAR}" +# https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html +# We reset all mtimes to that of the top-level extracted directory; since git +# archives don’t have meaningful per-file mtimes, nothing useful is lost. +TZ=UTC LC_ALL=C tar \ + --create --verbose \ + --sort=name \ + --format=posix \ + --numeric-owner --owner=0 --group=0 \ + --mode=go+u,go-w \ + --pax-option='delete=atime,delete=ctime' \ + --clamp-mtime --mtime="@${MTIME}" \ + "${TARDIR}/" | + xz -9e > "${NEWTAR}" +touch -d @"${MTIME}" "${NEWTAR}" cd "${SAVEDIR}" mv -v "${XDIR}/${NEWTAR}" . diff --git a/sources b/sources index 7a04a36..141cbdc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sleef-3.5.1-filtered.tar.xz) = a40e9292bc7164ad0b9a4a718fbe78cccb04a19a4b824d34d7991fd75656be9f9336a5f226b0004e88e01c1c8592b420e789e63a88ff3810a68cf08d6617c1bf +SHA512 (sleef-3.5.1-filtered.tar.xz) = 58b0125ce15fe058efca8ef30657900d156fcbf54bf813eec2cb4d131831807559c5daa949e21fbafe784a2c6cecd7624012eb65c3eb968f2888f8a050f303c8 From d72444481c3eca4ca638580dcd713cfc1407e9c2 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 5 Apr 2024 12:27:48 -0400 Subject: [PATCH 07/23] Use zstd instead of xz for filtered source archive compression This is based on the relative health of the upstream projects. --- .gitignore | 1 + get_source.sh | 6 +++--- sleef.rpmlintrc | 2 ++ sleef.spec | 2 +- sources | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f71c7c7..68437c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /3.5.1.tar.gz /sleef-3.5.1.tar.gz /sleef-3.5.1-filtered.tar.xz +/sleef-3.5.1-filtered.tar.zst diff --git a/get_source.sh b/get_source.sh index 023d94e..650292e 100755 --- a/get_source.sh +++ b/get_source.sh @@ -11,7 +11,7 @@ Usage: $1 VERSION Generate a source archive for sleef with src/gencoef/ removed, since the code therein is licensed CC-BY-4.0, but this license is not approved for code in -Fedora. The result will be named sleef-\${VERSION}-filtered.tar.xz and will be +Fedora. The result will be named sleef-\${VERSION}-filtered.tar.zst and will be written into the current working directory. EOF } @@ -31,7 +31,7 @@ VERSION="${1}" SOURCE0="${FORGEURL}/archive/${VERSION}/sleef-${VERSION}.tar.gz" TARNAME="$(basename "${SOURCE0}")" TARDIR="$(basename "${SOURCE0}" '.tar.gz')" -NEWTAR="${TARDIR}-filtered.tar.xz" +NEWTAR="${TARDIR}-filtered.tar.zst" SAVEDIR="${PWD}" XDIR="$(mktemp -d)" @@ -59,7 +59,7 @@ TZ=UTC LC_ALL=C tar \ --pax-option='delete=atime,delete=ctime' \ --clamp-mtime --mtime="@${MTIME}" \ "${TARDIR}/" | - xz -9e > "${NEWTAR}" + zstdmt --ultra -22 > "${NEWTAR}" touch -d @"${MTIME}" "${NEWTAR}" cd "${SAVEDIR}" diff --git a/sleef.rpmlintrc b/sleef.rpmlintrc index 4f93bb6..16b8bfd 100644 --- a/sleef.rpmlintrc +++ b/sleef.rpmlintrc @@ -5,3 +5,5 @@ addFilter(r"sleef-gnuabi\..*: spelling-error \('(lib(sleefgnuabi|mvec)|glibc)', 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") +# Bogus; it is a perfectly fine zstandard file. +addFilter(r" inconsistent-file-extension sleef-.*-filtered\.tar\.xz") diff --git a/sleef.spec b/sleef.spec index 03b0f10..9986c97 100644 --- a/sleef.spec +++ b/sleef.spec @@ -39,7 +39,7 @@ URL: https://sleef.org # See the comment above License for why this is necessary. The archive is # produced by using the script in Source1: # ./get_source.sh ${VERSION} -Source0: sleef-%{version}-filtered.tar.xz +Source0: sleef-%{version}-filtered.tar.zst Source1: get_source.sh # Do not define our own mpfr_sinpi/mpfr_cospi for mpfr 4.2.0 and later diff --git a/sources b/sources index 141cbdc..821fcb4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sleef-3.5.1-filtered.tar.xz) = 58b0125ce15fe058efca8ef30657900d156fcbf54bf813eec2cb4d131831807559c5daa949e21fbafe784a2c6cecd7624012eb65c3eb968f2888f8a050f303c8 +SHA512 (sleef-3.5.1-filtered.tar.zst) = 70b3c066904d99ebce62b103ae6ca39313631fa0e84f1d82264a5f1c3c9ec00ad4a838d892d04475231a3a7768bc381f3a5d55efe83058577c500d13a5737d47 From 213765a3a8f8dbbad34240142653844f652d5df3 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 15 Feb 2024 10:00:14 -0500 Subject: [PATCH 08/23] Update to 3.6.1 (close RHBZ#2264430) - Build and package the quad-precision and DFT libraries --- .gitignore | 2 ++ 471.patch | 48 -------------------------------- 535.patch | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ sleef.spec | 73 ++++++++++++++++--------------------------------- sources | 2 +- 5 files changed, 107 insertions(+), 98 deletions(-) delete mode 100644 471.patch create mode 100644 535.patch diff --git a/.gitignore b/.gitignore index 68437c9..9439615 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /sleef-3.5.1.tar.gz /sleef-3.5.1-filtered.tar.xz /sleef-3.5.1-filtered.tar.zst +/sleef-3.6-filtered.tar.zst +/sleef-3.6.1-filtered.tar.zst diff --git a/471.patch b/471.patch deleted file mode 100644 index 4849399..0000000 --- a/471.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 1f27275c72c31451d8f458a4ddec01609830bc5f Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Wed, 4 Oct 2023 16:28:49 -0400 -Subject: [PATCH] Do not define our own mpfr_sinpi/mpfr_cospi for mpfr 4.2.0 - and later - -These two functions were added to the MPFR API. - -Fixes #458. ---- - src/libm-tester/testerutil.c | 2 ++ - src/libm-tester/testerutil.h | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/src/libm-tester/testerutil.c b/src/libm-tester/testerutil.c -index 8e8b8936..688642ca 100644 ---- a/src/libm-tester/testerutil.c -+++ b/src/libm-tester/testerutil.c -@@ -289,6 +289,7 @@ double countULP2sp(float d, mpfr_t c0) { - - // - -+#if MPFR_VERSION < MPFR_VERSION_NUM(4, 2, 0) - void mpfr_sinpi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd) { - mpfr_t frpi, frd; - mpfr_inits(frpi, frd, NULL); -@@ -314,6 +315,7 @@ void mpfr_cospi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd) { - - mpfr_clears(frpi, frd, NULL); - } -+#endif - - void mpfr_lgamma_nosign(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd) { - int s; -diff --git a/src/libm-tester/testerutil.h b/src/libm-tester/testerutil.h -index 7f371414..313bf7b2 100644 ---- a/src/libm-tester/testerutil.h -+++ b/src/libm-tester/testerutil.h -@@ -90,7 +90,9 @@ int cmpDenormsp(float x, mpfr_t fry); - double countULPsp(float d, mpfr_t c); - double countULP2sp(float d, mpfr_t c); - -+#if MPFR_VERSION < MPFR_VERSION_NUM(4, 2, 0) - void mpfr_sinpi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd); - void mpfr_cospi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd); -+#endif - void mpfr_lgamma_nosign(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd); - #endif diff --git a/535.patch b/535.patch new file mode 100644 index 0000000..4d7ded2 --- /dev/null +++ b/535.patch @@ -0,0 +1,80 @@ +From c170f75efaadf3feaf3a10a54da85093fdbd27b2 Mon Sep 17 00:00:00 2001 +From: Yichao Yu +Date: Tue, 19 Mar 2024 12:37:59 -0400 +Subject: [PATCH] Fix installation of shared library symlink + +This fixes the regression from 29391ccd9d513132fc802a198f8b801fb273cb59. + +The dummy target that was removed in 29391ccd9d513132fc802a198f8b801fb273cb59 +was responsible for installing the unversioned symlink for the shared libraries. +The only part of this that was causing issue appears to be the dummy destination +that was only added as an workaround for old cmake version (pre 3.14-ish). +With the cmake version requirement bumped to 3.18 this should not be an issue anymore, +and we could also use the new NAMELINK_COMPONENT option to avoid using two install +statements. + +This also fixes a bug from eb3d97785cb4f6f6f4c0ffd6570ca6c73ccac2ec causing +the libsleefgnuabi library to be missing the symlink... +--- + src/dft/CMakeLists.txt | 2 +- + src/libm/CMakeLists.txt | 6 +++--- + src/quad/CMakeLists.txt | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/dft/CMakeLists.txt b/src/dft/CMakeLists.txt +index acc65b82..abbeceac 100644 +--- a/src/dft/CMakeLists.txt ++++ b/src/dft/CMakeLists.txt +@@ -413,7 +413,7 @@ install( + LIBRARY # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Runtime +- NAMELINK_SKIP ++ NAMELINK_COMPONENT sleef_Development + ARCHIVE # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development +diff --git a/src/libm/CMakeLists.txt b/src/libm/CMakeLists.txt +index 9d347238..5cab91a7 100644 +--- a/src/libm/CMakeLists.txt ++++ b/src/libm/CMakeLists.txt +@@ -996,7 +996,7 @@ if(SLEEF_BUILD_SCALAR_LIB) + LIBRARY # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Runtime +- NAMELINK_SKIP ++ NAMELINK_COMPONENT sleef_Development + ARCHIVE # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development +@@ -1019,7 +1019,7 @@ install( + LIBRARY # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Runtime +- NAMELINK_SKIP ++ NAMELINK_COMPONENT sleef_Development + ARCHIVE # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development +@@ -1043,7 +1043,7 @@ if(ENABLE_GNUABI) + LIBRARY # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Runtime +- NAMELINK_SKIP ++ NAMELINK_COMPONENT sleef_Development + ARCHIVE # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development +diff --git a/src/quad/CMakeLists.txt b/src/quad/CMakeLists.txt +index 7afcd029..4d9700d5 100644 +--- a/src/quad/CMakeLists.txt ++++ b/src/quad/CMakeLists.txt +@@ -492,7 +492,7 @@ install( + LIBRARY # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Runtime +- NAMELINK_SKIP ++ NAMELINK_COMPONENT sleef_Development + ARCHIVE # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development diff --git a/sleef.spec b/sleef.spec index 9986c97..237a9b3 100644 --- a/sleef.spec +++ b/sleef.spec @@ -2,22 +2,17 @@ # Fedora at -O2, and is not well-supported upstream. Additionally, it uses # illegal instructions on ARM and s390x, at least on the Fedora build machines. # See https://github.com/shibatch/sleef/issues/214. -%bcond dft 0 -# We would like to ship the quad-precision library, but since it is still -# considered experimental, it may have breaking ABI or API changes without an -# soversion bump, which is a no-no in Fedora. Rather than contorting ourselves -# to accommodate this, we disable it until it stabilizes or some dependent -# package appears. -%bcond quad 0 +%bcond dft 1 +# As of Sleef 3.6, the quad-precision library is no longer marked experimental. +%bcond quad 1 # Similarly, Fedora packages should not ship static libraries unless absolutely -# required. Some software, like pytorch, really does rely on the inline headers -# and accompanying static support library for exceptional performance -# requirements, but no such software exists in Fedora at the moment. We will -# leave this feature disabled until someone asks for it. +# required. Some software may really rely on the inline headers and +# accompanying static support library for exceptional performance requirements, +# but we will leave this feature disabled until someone asks for it. %bcond static 0 Name: sleef -Version: 3.5.1 +Version: 3.6.1 %global so_version 3 Release: %autorelease Summary: Vectorized math library @@ -42,22 +37,6 @@ URL: https://sleef.org Source0: sleef-%{version}-filtered.tar.zst Source1: get_source.sh -# Do not define our own mpfr_sinpi/mpfr_cospi for mpfr 4.2.0 and later -# https://github.com/shibatch/sleef/pull/471 -# -# This is similar to: -# -# mpfr-4.2 add mpfr_cospi and mpfr_sinpi -# https://github.com/shibatch/sleef/pull/462 -# -# ...but maintains backwards-compatibility with mpfr version before 4.2.0. -# -# Fixes: -# -# Compilation fails (conflicting types) if mpfr-devel 4.2.0 is provided -# https://github.com/shibatch/sleef/issues/458 -Patch: https://github.com/shibatch/sleef/pull/471.patch - # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} @@ -192,15 +171,10 @@ developing applications that use sleef-quad. %prep %autosetup -p1 -# The gencoef tool sources are licensed CC-BY-4.0, which is allowed for content -# but not for code. Remove them to prove that they are not used in the build. -rm -vrf src/gencoef %build -# -GNinja: Upstream prominently states that parallel build is only supported -# with the Ninja generator for cmake, not with the make one. See -# https://sleef.org/compile.xhtml. +# -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. # @@ -213,11 +187,12 @@ rm -vrf src/gencoef # requires them. %cmake \ -GNinja \ - -DENFORCE_TESTER3:BOOL=TRUE \ - -DBUILD_INLINE_HEADERS:BOOL=%{?inline_enabled:TRUE}%{?!inline_enabled:FALSE} \ - -DBUILD_GNUABI_LIBS:BOOL=%{?gnuabi_enabled:TRUE}%{?!gnuabi_enabled:FALSE} \ - -DBUILD_DFT:BOOL=%{?with_dft:TRUE}%{?!with_dft:FALSE} \ - -DBUILD_QUAD:BOOL=%{?with_quad:TRUE}%{?!with_quad:FALSE} + -DSLEEF_BUILD_DFT:BOOL=%{?with_dft:TRUE}%{?!with_dft:FALSE} \ + -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 %cmake_build @@ -228,15 +203,14 @@ rm -vrf src/gencoef %check skips='^($.' -%if %{with dft} -# The DFT library has known test failures -# (https://github.com/shibatch/sleef/issues/214). -skips="${skips}|fftwtest2d[ds]p_(4_4|8_8|10_10|5_15)" -%ifarch aarch64 s390x -# Plus, it uses illegal instructions: -skips="${skips}|naivetest[ds]p_([2345]|10)" -skips="${skips}|fftwtest(1d[ds]p_1[26]|2d[ds]p_2_2)" -%endif +%ifarch aarch64 +# 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 +then + skips="${skips}|gnuabi_compatibility_SVE(_masked)?|qiutsve" +fi %endif skips="${skips})$" @@ -253,6 +227,7 @@ skips="${skips})$" %{_includedir}/sleef.h %{_libdir}/libsleef.so %{_libdir}/pkgconfig/sleef.pc +%{_libdir}/cmake/sleef/ %if 0%{?inline_enabled} @@ -267,7 +242,7 @@ skips="${skips})$" %doc CHANGELOG.md %doc CONTRIBUTORS.md %doc README.md -%doc doc/html/ +%doc docs/ %ifarch %{gnuabi_arches} diff --git a/sources b/sources index 821fcb4..31f2aa2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sleef-3.5.1-filtered.tar.zst) = 70b3c066904d99ebce62b103ae6ca39313631fa0e84f1d82264a5f1c3c9ec00ad4a838d892d04475231a3a7768bc381f3a5d55efe83058577c500d13a5737d47 +SHA512 (sleef-3.6.1-filtered.tar.zst) = afb6da16ee5574f56a047d6765e45296f1faa8a3ad3fbffc4bd9aab77d83889eea62b965d87d5e4fce4c8032e4fb205c399634bb2233a61a762ad1aeb7109edb From 264beb0b0d1846254283be322337a6c3a5c98948 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 05:48:58 +0000 Subject: [PATCH 09/23] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From dc2fe28f52e32aa7bc93a3fa81616f14e16db7d0 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 17 Sep 2024 15:10:30 -0400 Subject: [PATCH 10/23] Update to 3.7.0 --- .gitignore | 1 + sleef.spec | 10 +++++----- sources | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 9439615..77ddfd4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /sleef-3.5.1-filtered.tar.zst /sleef-3.6-filtered.tar.zst /sleef-3.6.1-filtered.tar.zst +/sleef-3.7-filtered.tar.zst diff --git a/sleef.spec b/sleef.spec index 237a9b3..ac3e0d1 100644 --- a/sleef.spec +++ b/sleef.spec @@ -12,7 +12,8 @@ %bcond static 0 Name: sleef -Version: 3.6.1 +Version: 3.7.0 +%global tag 3.7 %global so_version 3 Release: %autorelease Summary: Vectorized math library @@ -30,11 +31,11 @@ Summary: Vectorized math library License: BSL-1.0 URL: https://sleef.org # This is a filtered version of: -# https://github.com/shibatch/sleef/archive/%%{version}/sleef-%%{version}.tar.gz +# https://github.com/shibatch/sleef/archive/%%{tag}/sleef-%%{tag}.tar.gz # See the comment above License for why this is necessary. The archive is # produced by using the script in Source1: # ./get_source.sh ${VERSION} -Source0: sleef-%{version}-filtered.tar.zst +Source0: sleef-%{tag}-filtered.tar.zst Source1: get_source.sh # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval @@ -170,7 +171,7 @@ developing applications that use sleef-quad. %prep -%autosetup -p1 +%autosetup -n sleef-%{tag} -p1 %build @@ -240,7 +241,6 @@ skips="${skips})$" %files doc %license LICENSE.txt %doc CHANGELOG.md -%doc CONTRIBUTORS.md %doc README.md %doc docs/ diff --git a/sources b/sources index 31f2aa2..7758098 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sleef-3.6.1-filtered.tar.zst) = afb6da16ee5574f56a047d6765e45296f1faa8a3ad3fbffc4bd9aab77d83889eea62b965d87d5e4fce4c8032e4fb205c399634bb2233a61a762ad1aeb7109edb +SHA512 (sleef-3.7-filtered.tar.zst) = 857e8cccd4a90cb351291f6d9243971c94b7344a66ca70113fc12e609e2c9ab22757225cde2105f31d342c2524509f7bc52042a38f1c040980fc8a2cf10bc86c From e598b61967227925af2d47761f50d0c46f64854f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 3 Nov 2024 06:31:32 -0500 Subject: [PATCH 11/23] Invoke %cmake in %conf rather than in %build --- sleef.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sleef.spec b/sleef.spec index ac3e0d1..bed7e9a 100644 --- a/sleef.spec +++ b/sleef.spec @@ -174,7 +174,7 @@ developing applications that use sleef-quad. %autosetup -n sleef-%{tag} -p1 -%build +%conf # -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. @@ -194,6 +194,9 @@ developing applications that use sleef-quad. -DSLEEF_BUILD_QUAD:BOOL=%{?with_quad:TRUE}%{?!with_quad:FALSE} \ -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ -DSLEEF_ENFORCE_TESTER3:BOOL=TRUE + + +%build %cmake_build From a108f4022cd633e8dc5f647334ea17e1963c86f9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 10:56:29 +0000 Subject: [PATCH 12/23] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 971a02351eaa2778ceb42358d481624e2d8cfdc2 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 21 Jan 2025 15:47:24 -0500 Subject: [PATCH 13/23] Remove an unused patch file [skip changelog] --- 535.patch | 80 ------------------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 535.patch diff --git a/535.patch b/535.patch deleted file mode 100644 index 4d7ded2..0000000 --- a/535.patch +++ /dev/null @@ -1,80 +0,0 @@ -From c170f75efaadf3feaf3a10a54da85093fdbd27b2 Mon Sep 17 00:00:00 2001 -From: Yichao Yu -Date: Tue, 19 Mar 2024 12:37:59 -0400 -Subject: [PATCH] Fix installation of shared library symlink - -This fixes the regression from 29391ccd9d513132fc802a198f8b801fb273cb59. - -The dummy target that was removed in 29391ccd9d513132fc802a198f8b801fb273cb59 -was responsible for installing the unversioned symlink for the shared libraries. -The only part of this that was causing issue appears to be the dummy destination -that was only added as an workaround for old cmake version (pre 3.14-ish). -With the cmake version requirement bumped to 3.18 this should not be an issue anymore, -and we could also use the new NAMELINK_COMPONENT option to avoid using two install -statements. - -This also fixes a bug from eb3d97785cb4f6f6f4c0ffd6570ca6c73ccac2ec causing -the libsleefgnuabi library to be missing the symlink... ---- - src/dft/CMakeLists.txt | 2 +- - src/libm/CMakeLists.txt | 6 +++--- - src/quad/CMakeLists.txt | 2 +- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/dft/CMakeLists.txt b/src/dft/CMakeLists.txt -index acc65b82..abbeceac 100644 ---- a/src/dft/CMakeLists.txt -+++ b/src/dft/CMakeLists.txt -@@ -413,7 +413,7 @@ install( - LIBRARY # - DESTINATION "${CMAKE_INSTALL_LIBDIR}" - COMPONENT sleef_Runtime -- NAMELINK_SKIP -+ NAMELINK_COMPONENT sleef_Development - ARCHIVE # - DESTINATION "${CMAKE_INSTALL_LIBDIR}" - COMPONENT sleef_Development -diff --git a/src/libm/CMakeLists.txt b/src/libm/CMakeLists.txt -index 9d347238..5cab91a7 100644 ---- a/src/libm/CMakeLists.txt -+++ b/src/libm/CMakeLists.txt -@@ -996,7 +996,7 @@ if(SLEEF_BUILD_SCALAR_LIB) - LIBRARY # - DESTINATION "${CMAKE_INSTALL_LIBDIR}" - COMPONENT sleef_Runtime -- NAMELINK_SKIP -+ NAMELINK_COMPONENT sleef_Development - ARCHIVE # - DESTINATION "${CMAKE_INSTALL_LIBDIR}" - COMPONENT sleef_Development -@@ -1019,7 +1019,7 @@ install( - LIBRARY # - DESTINATION "${CMAKE_INSTALL_LIBDIR}" - COMPONENT sleef_Runtime -- NAMELINK_SKIP -+ NAMELINK_COMPONENT sleef_Development - ARCHIVE # - DESTINATION "${CMAKE_INSTALL_LIBDIR}" - COMPONENT sleef_Development -@@ -1043,7 +1043,7 @@ if(ENABLE_GNUABI) - LIBRARY # - DESTINATION "${CMAKE_INSTALL_LIBDIR}" - COMPONENT sleef_Runtime -- NAMELINK_SKIP -+ NAMELINK_COMPONENT sleef_Development - ARCHIVE # - DESTINATION "${CMAKE_INSTALL_LIBDIR}" - COMPONENT sleef_Development -diff --git a/src/quad/CMakeLists.txt b/src/quad/CMakeLists.txt -index 7afcd029..4d9700d5 100644 ---- a/src/quad/CMakeLists.txt -+++ b/src/quad/CMakeLists.txt -@@ -492,7 +492,7 @@ install( - LIBRARY # - DESTINATION "${CMAKE_INSTALL_LIBDIR}" - COMPONENT sleef_Runtime -- NAMELINK_SKIP -+ NAMELINK_COMPONENT sleef_Development - ARCHIVE # - DESTINATION "${CMAKE_INSTALL_LIBDIR}" - COMPONENT sleef_Development From b55669a1bf85cb6e0b1c5bf5427ac5b2f7b553da Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 21 Jan 2025 17:27:46 -0500 Subject: [PATCH 14/23] Work around removal of some PowerPC intrinsics in GCC 15 --- 612.patch | 32 ++++++++++++++++++++++++++++++++ sleef.spec | 9 +++++++++ 2 files changed, 41 insertions(+) create mode 100644 612.patch diff --git a/612.patch b/612.patch new file mode 100644 index 0000000..11887d1 --- /dev/null +++ b/612.patch @@ -0,0 +1,32 @@ +From f2caac3a7e91d3a43837332e00d2a22a3880a923 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Tue, 21 Jan 2025 15:46:23 -0500 +Subject: [PATCH] Work around removal of some PowerPC intrinsics in GCC 15 + +Fixes #611. +--- + src/arch/helperpower_128.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/arch/helperpower_128.h b/src/arch/helperpower_128.h +index 7aa71147..7d315d22 100644 +--- a/src/arch/helperpower_128.h ++++ b/src/arch/helperpower_128.h +@@ -371,7 +371,7 @@ static INLINE vdouble vcast_vd_vi(vint vi) + { + vdouble ret; + vint swap = vec_mergeh(vi, vi); +-#if defined(__clang__) || __GNUC__ >= 7 ++#if defined(__clang__) || (__GNUC__ >= 7 && __GNUC__ < 15) + ret = __builtin_vsx_xvcvsxwdp(swap); + #else + __asm__ __volatile__("xvcvsxwdp %x0,%x1" : "=wa" (ret) : "wa" (swap)); +@@ -406,7 +406,7 @@ static INLINE vint2 vtruncate_vi2_vf(vfloat vf) + static INLINE vint vtruncate_vi_vd(vdouble vd) + { + vint ret; +-#if defined(__clang__) || __GNUC__ >= 7 ++#if defined(__clang__) || (__GNUC__ >= 7 && __GNUC__ < 15) + ret = __builtin_vsx_xvcvdpsxws(vd); + #else + __asm__ __volatile__("xvcvdpsxws %x0,%x1" : "=wa" (ret) : "wa" (vd)); diff --git a/sleef.spec b/sleef.spec index bed7e9a..55392a4 100644 --- a/sleef.spec +++ b/sleef.spec @@ -38,6 +38,15 @@ URL: https://sleef.org Source0: sleef-%{tag}-filtered.tar.zst Source1: get_source.sh +# Work around removal of some PowerPC intrinsics in GCC 15 +# https://github.com/shibatch/sleef/pull/612 +# +# Fixes: +# +# Fails to build with GCC 15 on ppc64le due to removed intrinsics +# https://github.com/shibatch/sleef/issues/611 +Patch: https://github.com/shibatch/sleef/pull/612.patch + # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} From 359b98e9d14654bf35e9d1e13b1509bcbcdbecd6 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 28 Jan 2025 11:33:08 -0500 Subject: [PATCH 15/23] Tidy up some obsolete or unnecessary spe-file comments [skip changelog] --- sleef.spec | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sleef.spec b/sleef.spec index 55392a4..91b25ca 100644 --- a/sleef.spec +++ b/sleef.spec @@ -1,14 +1,9 @@ -# We do not ship the DFT library since it has undiagnosed test failures on -# Fedora at -O2, and is not well-supported upstream. Additionally, it uses -# illegal instructions on ARM and s390x, at least on the Fedora build machines. -# See https://github.com/shibatch/sleef/issues/214. %bcond dft 1 -# As of Sleef 3.6, the quad-precision library is no longer marked experimental. %bcond quad 1 -# Similarly, Fedora packages should not ship static libraries unless absolutely -# required. Some software may really rely on the inline headers and -# accompanying static support library for exceptional performance requirements, -# but we will leave this feature disabled until someone asks for it. +# Fedora packages should not ship static libraries unless absolutely required. +# Some software may really rely on the inline headers and accompanying static +# support library for exceptional performance requirements, but we will leave +# this feature disabled until someone asks for it. %bcond static 0 Name: sleef From 5459e31650e9e864068b45615b654b2e460b5a2e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 28 Jan 2025 11:34:15 -0500 Subject: [PATCH 16/23] In get_source.sh, be quieter about unimportant things [skip changelog] --- get_source.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/get_source.sh b/get_source.sh index 650292e..3745066 100755 --- a/get_source.sh +++ b/get_source.sh @@ -35,11 +35,11 @@ NEWTAR="${TARDIR}-filtered.tar.zst" SAVEDIR="${PWD}" XDIR="$(mktemp -d)" -trap "rm -rvf '${XDIR}'" INT TERM EXIT +trap "rm -rf '${XDIR}'" INT TERM EXIT cd "${XDIR}" curl -L -O "${SOURCE0}" -tar -xzvf "${TARNAME}" +tar -xzf "${TARNAME}" MTIME="$(stat -c '%Y' "${TARDIR}")" rm -rvf "${TARDIR}/src/gencoef/" if grep -ErinI 'Attribution 4\.0' . @@ -51,7 +51,7 @@ fi # We reset all mtimes to that of the top-level extracted directory; since git # archives don’t have meaningful per-file mtimes, nothing useful is lost. TZ=UTC LC_ALL=C tar \ - --create --verbose \ + --create \ --sort=name \ --format=posix \ --numeric-owner --owner=0 --group=0 \ From 1c1d6b8be1de34f4d7e30fc18587e78920681c73 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 28 Jan 2025 11:35:58 -0500 Subject: [PATCH 17/23] Update to 3.8.0 (close RHBZ#2342573) --- .gitignore | 1 + 612.patch | 32 -------------------------------- sleef.spec | 13 ++----------- sources | 2 +- 4 files changed, 4 insertions(+), 44 deletions(-) delete mode 100644 612.patch diff --git a/.gitignore b/.gitignore index 77ddfd4..ae7c8f0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /sleef-3.6-filtered.tar.zst /sleef-3.6.1-filtered.tar.zst /sleef-3.7-filtered.tar.zst +/sleef-3.8-filtered.tar.zst diff --git a/612.patch b/612.patch deleted file mode 100644 index 11887d1..0000000 --- a/612.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f2caac3a7e91d3a43837332e00d2a22a3880a923 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Tue, 21 Jan 2025 15:46:23 -0500 -Subject: [PATCH] Work around removal of some PowerPC intrinsics in GCC 15 - -Fixes #611. ---- - src/arch/helperpower_128.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/arch/helperpower_128.h b/src/arch/helperpower_128.h -index 7aa71147..7d315d22 100644 ---- a/src/arch/helperpower_128.h -+++ b/src/arch/helperpower_128.h -@@ -371,7 +371,7 @@ static INLINE vdouble vcast_vd_vi(vint vi) - { - vdouble ret; - vint swap = vec_mergeh(vi, vi); --#if defined(__clang__) || __GNUC__ >= 7 -+#if defined(__clang__) || (__GNUC__ >= 7 && __GNUC__ < 15) - ret = __builtin_vsx_xvcvsxwdp(swap); - #else - __asm__ __volatile__("xvcvsxwdp %x0,%x1" : "=wa" (ret) : "wa" (swap)); -@@ -406,7 +406,7 @@ static INLINE vint2 vtruncate_vi2_vf(vfloat vf) - static INLINE vint vtruncate_vi_vd(vdouble vd) - { - vint ret; --#if defined(__clang__) || __GNUC__ >= 7 -+#if defined(__clang__) || (__GNUC__ >= 7 && __GNUC__ < 15) - ret = __builtin_vsx_xvcvdpsxws(vd); - #else - __asm__ __volatile__("xvcvdpsxws %x0,%x1" : "=wa" (ret) : "wa" (vd)); diff --git a/sleef.spec b/sleef.spec index 91b25ca..e3da8d1 100644 --- a/sleef.spec +++ b/sleef.spec @@ -7,8 +7,8 @@ %bcond static 0 Name: sleef -Version: 3.7.0 -%global tag 3.7 +Version: 3.8.0 +%global tag 3.8 %global so_version 3 Release: %autorelease Summary: Vectorized math library @@ -33,15 +33,6 @@ URL: https://sleef.org Source0: sleef-%{tag}-filtered.tar.zst Source1: get_source.sh -# Work around removal of some PowerPC intrinsics in GCC 15 -# https://github.com/shibatch/sleef/pull/612 -# -# Fixes: -# -# Fails to build with GCC 15 on ppc64le due to removed intrinsics -# https://github.com/shibatch/sleef/issues/611 -Patch: https://github.com/shibatch/sleef/pull/612.patch - # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} diff --git a/sources b/sources index 7758098..573d70b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sleef-3.7-filtered.tar.zst) = 857e8cccd4a90cb351291f6d9243971c94b7344a66ca70113fc12e609e2c9ab22757225cde2105f31d342c2524509f7bc52042a38f1c040980fc8a2cf10bc86c +SHA512 (sleef-3.8-filtered.tar.zst) = 51942a633efb4e5b452530c3a34ac6983d7b77c7cf8f17dc0cd46934585ed6ae2745fce81438e0757aeb464be3b1677ab34d1421d7601a46069f490881cc9d89 From 8104d17ba54a903b9905f072e2e5e44ba8480205 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 5 Mar 2025 11:17:41 -0500 Subject: [PATCH 18/23] 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 19/23] 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 20/23] 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 21/23] 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 22/23] 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 23/23] 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