Bug 266784

Summary: math/sleef: Update to latest upstream commit
Product: Ports & Packages Reporter: Daniel Engberg <diizzy>
Component: Individual Port(s)Assignee: Johannes M Dieterich <jmd>
Status: Closed FIXED    
Severity: Affects Only Me CC: fuz, jmd
Priority: --- Flags: jmd: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch for sleef none

Description Daniel Engberg freebsd_committer freebsd_triage 2022-10-03 09:49:36 UTC
Created attachment 237036 [details]
Patch for sleef

This updates sleef to latest upstream commit 85440a5e87dae36ca1b891de14bc83b441ae7c43 which fixes a bunch of things including AVX2 detection.
DFT library is new disabled by default because it has issues looking at https://github.com/shibatch/sleef/issues (we might want to enable this anyway)
There are also some issues with unit tests and/or library itself
https://github.com/shibatch/sleef/issues/439

Upstream development status:
https://github.com/shibatch/sleef/issues/442

Compile and runtime tested on FreeBSD 13.1-STABLE (amd64) with PR 266772
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2022-10-03 11:30:24 UTC
Please consider following the -gYYYYmmdd versioning convention (e.g. 3.5.1-g20221003) for ports derived from interim git commits.  The convention you used collides if the port decides to release a 3.5.1.1 for some reason.

Build succeeds with Poudriere on armv7 arm64 i386 amd64 FreeBSD 13.1.
Test suite passes on armv7 i386 amd64 FreeBSD 13.1.

amd64 i386 tests were done on a Skylake box (AVX2 but no AVX-512).

AArch64 test suite fails with clang compiler crash in SVE code:

/usr/bin/cc -DENABLE_ALIAS=1 -DENABLE_SVE=1 -I/wrkdirs/usr/ports/math/sleef/work/sleef-3.5.1-62-g85440a5/src/common -I/wrkdirs/usr/ports/math/sleef/work/sleef-3.5.1-62-g85440a5/src/arch -I/wrkdirs/usr/ports/math/sleef/work/.build/include -I/wrkdirs/usr/ports/math/sleef/work/sleef-3.5.1-62-g85440a5/src/libm -I/wrkdirs/usr/ports/math/sleef/work/.build/src/libm/include -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -Wall -Wno-unused-function -Wno-attributes -Wno-unused-result -ffp-contract=off -fno-math-errno -fno-trapping-math -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -march=armv8-a+sve -std=gnu99 -MD -MT src/libm-tester/CMakeFiles/gnuabi_compatibility_SVE.dir/gnuabi_compatibility.c.o -MF src/libm-tester/CMakeFiles/gnuabi_compatibility_SVE.dir/gnuabi_compatibility.c.o.d -o src/libm-tester/CMakeFiles/gnuabi_compatibility_SVE.dir/gnuabi_compatibility.c.o -c /wrkdirs/usr/ports/math/sleef/work/sleef-3.5.1-62-g85440a5/src/libm-tester/gnuabi_compatibility.c
fatal error: error in backend: Invalid size request on a scalable vector.

Will see if I can report this error upstream.

However, if the sole dependent port math/heyoka builds fine, this should not be a problem.  Am currently checking that (will take a while for the dependencies to build).
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2022-10-04 08:14:39 UTC
Dependent port math/heyoka builds fine on AArch64 FreeBSD 13.1.
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2022-10-04 08:14:39 UTC
Dependent port math/heyoka builds fine on AArch64 FreeBSD 13.1.
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2023-01-07 00:06:17 UTC
Please fix PORTVERSION to follow the -gYYYYmmdd convention, then the patch is ready to be committed.
Comment 5 Robert Clausecker freebsd_committer freebsd_triage 2023-02-10 12:36:10 UTC
For some reason this PR was not autodetected to belong to the math/sleef port.  Fixed that now.
Comment 6 Johannes M Dieterich freebsd_committer freebsd_triage 2023-02-15 04:43:29 UTC
LGTM
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2023-04-01 15:34:41 UTC
Any progress on this one?
Comment 8 Johannes M Dieterich freebsd_committer freebsd_triage 2023-04-12 01:13:00 UTC
As stated before - LGTM and maintainer approval bit set. Since submitter diizzy@ has a bit, he can commit the patch.
Comment 9 Daniel Engberg freebsd_committer freebsd_triage 2023-04-12 01:38:28 UTC
I'll commit this later today
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-04-12 08:46:26 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=515a9b9c7025c01f1782f3834df88a75fbebbc93

commit 515a9b9c7025c01f1782f3834df88a75fbebbc93
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-04-12 08:14:46 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-04-12 08:44:43 +0000

    math/sleef: Update to latest upstream commit (2021-04-05)

    This updates sleef to latest upstream commit
    85440a5e87dae36ca1b891de14bc83b441ae7c43 which fixes a bunch of things
    including AVX2 detection. DFT library is now disabled by default because
    it has issues indicated by issue reports in upstream repo. There are
    also some issues with unit tests and/or library itself which may
    results in bugs however unit tests works fine on 13.2-RELEASE amd64
    at least. Import patch from Debian to fix build of unit tests

    References:
    https://github.com/shibatch/sleef/issues/439
    https://salsa.debian.org/science-team/sleef/-/blob/master/debian/patches/disable-duplicate-mpfr-funcs.patch

    PR:             266784
    Reviewed by:    jmd (maintainer)

 math/sleef/Makefile                                |  9 +++--
 math/sleef/distinfo                                |  6 ++--
 .../patch-src_libm-tester_iutsimdmain.c (gone)     | 21 -----------
 .../patch-src_libm-tester_tester2simdsp.c (gone)   | 11 ------
 .../sleef/files/patch-src_libm-tester_testerutil.c | 42 +++++++++++++++++-----
 .../files/patch-src_libm-tester_testerutil.h (new) | 10 ++++++
 math/sleef/pkg-plist                               | 15 ++++----
 7 files changed, 59 insertions(+), 55 deletions(-)
Comment 11 Daniel Engberg freebsd_committer freebsd_triage 2023-04-12 08:47:51 UTC
Thanks!