shibatch / sleef

SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT
https://sleef.org
Boost Software License 1.0
635 stars 129 forks source link

Tests fail to compile with mpfr 4.2.0 #470

Closed musicinmybrain closed 11 months ago

musicinmybrain commented 11 months ago

Since mpfr 4.2.0 (changelog link), the tests fail to compile:

In file included from /builddir/build/BUILD/sleef-3.5.1/src/libm-tester/tester2simddp.c:23:
/builddir/build/BUILD/sleef-3.5.1/src/libm-tester/testerutil.h:93:6: error: conflicting types for ‘mpfr_sinpi’; have ‘
void(__mpfr_struct *, __mpfr_struct *, mpfr_rnd_t)’
   93 | void mpfr_sinpi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd);
      |      ^~~~~~~~~~
In file included from /builddir/build/BUILD/sleef-3.5.1/src/libm-tester/tester2simddp.c:9:
/usr/include/mpfr.h:752:21: note: previous declaration of ‘mpfr_sinpi’ with type ‘int(__mpfr_struct *, const __mpfr_st
ruct *, mpfr_rnd_t)’
  752 | __MPFR_DECLSPEC int mpfr_sinpi (mpfr_ptr, mpfr_srcptr, mpfr_rnd_t);
      |                     ^~~~~~~~~~
/builddir/build/BUILD/sleef-3.5.1/src/libm-tester/testerutil.h:94:6: error: conflicting types for ‘mpfr_cospi’; have ‘
void(__mpfr_struct *, __mpfr_struct *, mpfr_rnd_t)’
   94 | void mpfr_cospi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd);
      |      ^~~~~~~~~~
/usr/include/mpfr.h:753:21: note: previous declaration of ‘mpfr_cospi’ with type ‘int(__mpfr_struct *, const __mpfr_st
ruct *, mpfr_rnd_t)’
  753 | __MPFR_DECLSPEC int mpfr_cospi (mpfr_ptr, mpfr_srcptr, mpfr_rnd_t);
      |                     ^~~~~~~~~~

MPFR upstream added mpfr_sinpi and mpfr_cospi to the API in 4.2.0, and the prototypes conflict with those in src/libm-tester/testerutil.h.

I’ll try to work up a PR to fix this by using the upstream versions of these functions when available.

musicinmybrain commented 11 months ago

The NEWS file is more useful than the ChangeLog in this case, I think.

musicinmybrain commented 11 months ago

I somehow missed that this is already reported as #458.