Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLD: fix math func feature checks, fix FreeBSD build, add CI job #24876

Merged
merged 4 commits into from
Oct 7, 2023

Conversation

rgommers
Copy link
Member

@rgommers rgommers commented Oct 7, 2023

Should fix the build on FreeBSD and other OSes that are not C99-compliant.

Closes gh-24873

@rgommers rgommers added component: build 09 - Backport-Candidate PRs tagged should be backported Meson Items related to the introduction of Meson as the new build system for NumPy labels Oct 7, 2023
@rgommers rgommers marked this pull request as draft October 7, 2023 11:39
@github-actions github-actions bot added the 36 - Build Build related PR label Oct 7, 2023
@rgommers rgommers force-pushed the fix-math-featurechecks branch 5 times, most recently from 9fbbf0a to 2595fdf Compare October 7, 2023 16:01
@rgommers
Copy link
Member Author

rgommers commented Oct 7, 2023

I like that it gets billed per second, this should remain very reasonably priced:

image

@rgommers rgommers force-pushed the fix-math-featurechecks branch 10 times, most recently from f29a810 to e049fbf Compare October 7, 2023 17:18
@rgommers
Copy link
Member Author

rgommers commented Oct 7, 2023

That fixed the missing symbol issue, now 8 new failures:

FAILED ../.venv/lib/python3.9/site-packages/numpy/core/tests/test_multiarray.py::test_npymath_complex[clongdouble-inf-inf-npy_cabs-absolute] - RuntimeWarning: invalid value encountered in absolute
FAILED ../.venv/lib/python3.9/site-packages/numpy/core/tests/test_multiarray.py::test_npymath_complex[clongdouble-inf--inf-npy_cabs-absolute] - RuntimeWarning: invalid value encountered in absolute
FAILED ../.venv/lib/python3.9/site-packages/numpy/core/tests/test_multiarray.py::test_npymath_complex[clongdouble--inf-inf-npy_cabs-absolute] - RuntimeWarning: invalid value encountered in absolute
FAILED ../.venv/lib/python3.9/site-packages/numpy/core/tests/test_multiarray.py::test_npymath_complex[clongdouble--inf--inf-npy_cabs-absolute] - RuntimeWarning: invalid value encountered in absolute
FAILED ../.venv/lib/python3.9/site-packages/numpy/core/tests/test_numeric.py::TestFloatExceptions::test_floating_exceptions[g] - AssertionError: Type <class 'numpy.longdouble'> did not raise fpe error 'overflow'.
FAILED ../.venv/lib/python3.9/site-packages/numpy/core/tests/test_numeric.py::TestFloatExceptions::test_floating_exceptions[G] - AssertionError: Type <class 'numpy.clongdouble'> raised wrong fpe error 'invalid value encountered in power'.
FAILED ../.venv/lib/python3.9/site-packages/numpy/core/tests/test_umath.py::TestSpecialFloats::test_cosh - AssertionError: FloatingPointError not raised by cosh
FAILED ../.venv/lib/python3.9/site-packages/numpy/core/tests/test_umath_complex.py::TestSpecialComplexAVX::test_array[complex64--1] - RuntimeWarning: invalid value encountered in absolute
= 8 failed, 41302 passed, 1793 skipped, 1304 deselected, 34 xfailed, 4 xpassed in 242.27s (0:04:02) =

Full output:

=================================== FAILURES ===================================
_________ test_npymath_complex[clongdouble-inf-inf-npy_cabs-absolute] __________
fun = <built-in function npy_cabs>, npfun = <ufunc 'absolute'>, x = inf, y = inf
test_dtype = <class 'numpy.clongdouble'>
    @pytest.mark.parametrize(
        ["fun", "npfun"],
        [
            (_multiarray_tests.npy_cabs, np.absolute),
            (_multiarray_tests.npy_carg, np.angle)
        ]
    )
    @pytest.mark.parametrize("x", [1, np.inf, -np.inf, np.nan])
    @pytest.mark.parametrize("y", [1, np.inf, -np.inf, np.nan])
    @pytest.mark.parametrize("test_dtype", np.complexfloating.__subclasses__())
    def test_npymath_complex(fun, npfun, x, y, test_dtype):
        # Smoketest npymath functions
        z = test_dtype(complex(x, y))
        got = fun(z)
>       expected = npfun(z)
E       RuntimeWarning: invalid value encountered in absolute
fun        = <built-in function npy_cabs>
got        = array(inf)
npfun      = <ufunc 'absolute'>
test_dtype = <class 'numpy.clongdouble'>
x          = inf
y          = inf
z          = np.clongdouble('inf+infj')
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_multiarray.py:9710: RuntimeWarning
_________ test_npymath_complex[clongdouble-inf--inf-npy_cabs-absolute] _________
fun = <built-in function npy_cabs>, npfun = <ufunc 'absolute'>, x = -inf
y = inf, test_dtype = <class 'numpy.clongdouble'>
    @pytest.mark.parametrize(
        ["fun", "npfun"],
        [
            (_multiarray_tests.npy_cabs, np.absolute),
            (_multiarray_tests.npy_carg, np.angle)
        ]
    )
    @pytest.mark.parametrize("x", [1, np.inf, -np.inf, np.nan])
    @pytest.mark.parametrize("y", [1, np.inf, -np.inf, np.nan])
    @pytest.mark.parametrize("test_dtype", np.complexfloating.__subclasses__())
    def test_npymath_complex(fun, npfun, x, y, test_dtype):
        # Smoketest npymath functions
        z = test_dtype(complex(x, y))
        got = fun(z)
>       expected = npfun(z)
E       RuntimeWarning: invalid value encountered in absolute
fun        = <built-in function npy_cabs>
got        = array(inf)
npfun      = <ufunc 'absolute'>
test_dtype = <class 'numpy.clongdouble'>
x          = -inf
y          = inf
z          = np.clongdouble('-inf+infj')
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_multiarray.py:9710: RuntimeWarning
_________ test_npymath_complex[clongdouble--inf-inf-npy_cabs-absolute] _________
fun = <built-in function npy_cabs>, npfun = <ufunc 'absolute'>, x = inf
y = -inf, test_dtype = <class 'numpy.clongdouble'>
    @pytest.mark.parametrize(
        ["fun", "npfun"],
        [
            (_multiarray_tests.npy_cabs, np.absolute),
            (_multiarray_tests.npy_carg, np.angle)
        ]
    )
    @pytest.mark.parametrize("x", [1, np.inf, -np.inf, np.nan])
    @pytest.mark.parametrize("y", [1, np.inf, -np.inf, np.nan])
    @pytest.mark.parametrize("test_dtype", np.complexfloating.__subclasses__())
    def test_npymath_complex(fun, npfun, x, y, test_dtype):
        # Smoketest npymath functions
        z = test_dtype(complex(x, y))
        got = fun(z)
>       expected = npfun(z)
E       RuntimeWarning: invalid value encountered in absolute
fun        = <built-in function npy_cabs>
got        = array(inf)
npfun      = <ufunc 'absolute'>
test_dtype = <class 'numpy.clongdouble'>
x          = inf
y          = -inf
z          = np.clongdouble('inf-infj')
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_multiarray.py:9710: RuntimeWarning
________ test_npymath_complex[clongdouble--inf--inf-npy_cabs-absolute] _________
fun = <built-in function npy_cabs>, npfun = <ufunc 'absolute'>, x = -inf
y = -inf, test_dtype = <class 'numpy.clongdouble'>
    @pytest.mark.parametrize(
        ["fun", "npfun"],
        [
            (_multiarray_tests.npy_cabs, np.absolute),
            (_multiarray_tests.npy_carg, np.angle)
        ]
    )
    @pytest.mark.parametrize("x", [1, np.inf, -np.inf, np.nan])
    @pytest.mark.parametrize("y", [1, np.inf, -np.inf, np.nan])
    @pytest.mark.parametrize("test_dtype", np.complexfloating.__subclasses__())
    def test_npymath_complex(fun, npfun, x, y, test_dtype):
        # Smoketest npymath functions
        z = test_dtype(complex(x, y))
        got = fun(z)
>       expected = npfun(z)
E       RuntimeWarning: invalid value encountered in absolute
fun        = <built-in function npy_cabs>
got        = array(inf)
npfun      = <ufunc 'absolute'>
test_dtype = <class 'numpy.clongdouble'>
x          = -inf
y          = -inf
z          = np.clongdouble('-inf-infj')
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_multiarray.py:9710: RuntimeWarning
_______________ TestFloatExceptions.test_floating_exceptions[g] ________________
self = <numpy.core.tests.test_numeric.TestFloatExceptions object at 0x91c3fbac0>
typecode = 'g'
    @pytest.mark.skipif(IS_WASM, reason="no wasm fp exception support")
    @pytest.mark.parametrize("typecode", np.typecodes["AllFloat"])
    def test_floating_exceptions(self, typecode):
        # Test basic arithmetic function errors
        with np.errstate(all='raise'):
            ftype = obj2sctype(typecode)
            if np.dtype(ftype).kind == 'f':
                # Get some extreme values for the type
                fi = np.finfo(ftype)
                ft_tiny = fi._machar.tiny
                ft_max = fi.max
                ft_eps = fi.eps
                underflow = 'underflow'
                divbyzero = 'divide by zero'
            else:
                # 'c', complex, corresponding real dtype
                rtype = type(ftype(0).real)
                fi = np.finfo(rtype)
                ft_tiny = ftype(fi._machar.tiny)
                ft_max = ftype(fi.max)
                ft_eps = ftype(fi.eps)
                # The complex types raise different exceptions
                underflow = ''
                divbyzero = ''
            overflow = 'overflow'
            invalid = 'invalid'
    
            # The value of tiny for double double is NaN, so we need to
            # pass the assert
            if not np.isnan(ft_tiny):
                self.assert_raises_fpe(underflow,
                                    lambda a, b: a/b, ft_tiny, ft_max)
                self.assert_raises_fpe(underflow,
                                    lambda a, b: a*b, ft_tiny, ft_tiny)
            self.assert_raises_fpe(overflow,
                                   lambda a, b: a*b, ft_max, ftype(2))
            self.assert_raises_fpe(overflow,
                                   lambda a, b: a/b, ft_max, ftype(0.5))
            self.assert_raises_fpe(overflow,
                                   lambda a, b: a+b, ft_max, ft_max*ft_eps)
            self.assert_raises_fpe(overflow,
                                   lambda a, b: a-b, -ft_max, ft_max*ft_eps)
>           self.assert_raises_fpe(overflow,
                                   np.power, ftype(2), ftype(2**fi.nexp))
divbyzero  = 'divide by zero'
fi         = finfo(resolution=1e-18, min=-1.189731495357231765e+4932, max=1.189731495357231765e+4932, dtype=float128)
ft_eps     = np.longdouble('1.084202172485504434e-19')
ft_max     = np.longdouble('1.189731495357231765e+4932')
ft_tiny    = array(3.36210314e-4932, dtype=float128)
ftype      = <class 'numpy.longdouble'>
invalid    = 'invalid'
overflow   = 'overflow'
self       = <numpy.core.tests.test_numeric.TestFloatExceptions object at 0x91c3fbac0>
typecode   = 'g'
underflow  = 'underflow'
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_numeric.py:958: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <numpy.core.tests.test_numeric.TestFloatExceptions object at 0x91c3fbac0>
fpeerr = 'overflow', flop = <ufunc 'power'>, x = np.longdouble('2.0')
y = np.longdouble('32768.0')
    def assert_raises_fpe(self, fpeerr, flop, x, y):
        ftype = type(x)
        try:
            flop(x, y)
>           assert_(False,
                    "Type %s did not raise fpe error '%s'." % (ftype, fpeerr))
E                   AssertionError: Type <class 'numpy.longdouble'> did not raise fpe error 'overflow'.
flop       = <ufunc 'power'>
fpeerr     = 'overflow'
ftype      = <class 'numpy.longdouble'>
self       = <numpy.core.tests.test_numeric.TestFloatExceptions object at 0x91c3fbac0>
x          = np.longdouble('2.0')
y          = np.longdouble('32768.0')
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_numeric.py:897: AssertionError
_______________ TestFloatExceptions.test_floating_exceptions[G] ________________
self = <numpy.core.tests.test_numeric.TestFloatExceptions object at 0x91c3fcca0>
fpeerr = 'overflow', flop = <ufunc 'power'>, x = np.clongdouble('2+0j')
y = np.clongdouble('32768+0j')
    def assert_raises_fpe(self, fpeerr, flop, x, y):
        ftype = type(x)
        try:
>           flop(x, y)
E           FloatingPointError: invalid value encountered in power
flop       = <ufunc 'power'>
fpeerr     = 'overflow'
ftype      = <class 'numpy.clongdouble'>
self       = <numpy.core.tests.test_numeric.TestFloatExceptions object at 0x91c3fcca0>
x          = np.clongdouble('2+0j')
y          = np.clongdouble('32768+0j')
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_numeric.py:896: FloatingPointError
During handling of the above exception, another exception occurred:
self = <numpy.core.tests.test_numeric.TestFloatExceptions object at 0x91c3fcca0>
typecode = 'G'
    @pytest.mark.skipif(IS_WASM, reason="no wasm fp exception support")
    @pytest.mark.parametrize("typecode", np.typecodes["AllFloat"])
    def test_floating_exceptions(self, typecode):
        # Test basic arithmetic function errors
        with np.errstate(all='raise'):
            ftype = obj2sctype(typecode)
            if np.dtype(ftype).kind == 'f':
                # Get some extreme values for the type
                fi = np.finfo(ftype)
                ft_tiny = fi._machar.tiny
                ft_max = fi.max
                ft_eps = fi.eps
                underflow = 'underflow'
                divbyzero = 'divide by zero'
            else:
                # 'c', complex, corresponding real dtype
                rtype = type(ftype(0).real)
                fi = np.finfo(rtype)
                ft_tiny = ftype(fi._machar.tiny)
                ft_max = ftype(fi.max)
                ft_eps = ftype(fi.eps)
                # The complex types raise different exceptions
                underflow = ''
                divbyzero = ''
            overflow = 'overflow'
            invalid = 'invalid'
    
            # The value of tiny for double double is NaN, so we need to
            # pass the assert
            if not np.isnan(ft_tiny):
                self.assert_raises_fpe(underflow,
                                    lambda a, b: a/b, ft_tiny, ft_max)
                self.assert_raises_fpe(underflow,
                                    lambda a, b: a*b, ft_tiny, ft_tiny)
            self.assert_raises_fpe(overflow,
                                   lambda a, b: a*b, ft_max, ftype(2))
            self.assert_raises_fpe(overflow,
                                   lambda a, b: a/b, ft_max, ftype(0.5))
            self.assert_raises_fpe(overflow,
                                   lambda a, b: a+b, ft_max, ft_max*ft_eps)
            self.assert_raises_fpe(overflow,
                                   lambda a, b: a-b, -ft_max, ft_max*ft_eps)
>           self.assert_raises_fpe(overflow,
                                   np.power, ftype(2), ftype(2**fi.nexp))
divbyzero  = ''
fi         = finfo(resolution=1e-18, min=-1.189731495357231765e+4932, max=1.189731495357231765e+4932, dtype=float128)
ft_eps     = np.clongdouble('1.084202172485504434e-19+0j')
ft_max     = np.clongdouble('1.189731495357231765e+4932+0j')
ft_tiny    = np.clongdouble('3.3621031431120935063e-4932+0j')
ftype      = <class 'numpy.clongdouble'>
invalid    = 'invalid'
overflow   = 'overflow'
rtype      = <class 'numpy.longdouble'>
self       = <numpy.core.tests.test_numeric.TestFloatExceptions object at 0x91c3fcca0>
typecode   = 'G'
underflow  = ''
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_numeric.py:958: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <numpy.core.tests.test_numeric.TestFloatExceptions object at 0x91c3fcca0>
fpeerr = 'overflow', flop = <ufunc 'power'>, x = np.clongdouble('2+0j')
y = np.clongdouble('32768+0j')
    def assert_raises_fpe(self, fpeerr, flop, x, y):
        ftype = type(x)
        try:
            flop(x, y)
            assert_(False,
                    "Type %s did not raise fpe error '%s'." % (ftype, fpeerr))
        except FloatingPointError as exc:
>           assert_(str(exc).find(fpeerr) >= 0,
                    "Type %s raised wrong fpe error '%s'." % (ftype, exc))
E           AssertionError: Type <class 'numpy.clongdouble'> raised wrong fpe error 'invalid value encountered in power'.
flop       = <ufunc 'power'>
fpeerr     = 'overflow'
ftype      = <class 'numpy.clongdouble'>
self       = <numpy.core.tests.test_numeric.TestFloatExceptions object at 0x91c3fcca0>
x          = np.clongdouble('2+0j')
y          = np.clongdouble('32768+0j')
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_numeric.py:900: AssertionError
_________________________ TestSpecialFloats.test_cosh __________________________
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x96b945430>
    @pytest.mark.skipif(IS_WASM, reason="fp errors don't work in wasm")
    def test_cosh(self):
        in_ = [np.nan, -np.nan, np.inf, -np.inf]
        out = [np.nan, np.nan, np.inf, np.inf]
        for dt in ['e', 'f', 'd']:
            in_arr = np.array(in_, dtype=dt)
            out_arr = np.array(out, dtype=dt)
            assert_equal(np.cosh(in_arr), out_arr)
    
        with np.errstate(over='raise'):
            assert_raises(FloatingPointError, np.cosh,
                          np.array(12.0, dtype='e'))
>           assert_raises(FloatingPointError, np.cosh,
                          np.array(120.0, dtype='f'))
dt         = 'd'
in_        = [nan, nan, inf, -inf]
in_arr     = array([ nan,  nan,  inf, -inf])
out        = [nan, nan, inf, inf]
out_arr    = array([nan, nan, inf, inf])
self       = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x96b945430>
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_umath.py:1659: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.9/unittest/case.py:739: in assertRaises
    return context.handle('assertRaises', args, kwargs)
        args       = (<ufunc 'cosh'>, array(120., dtype=float32))
        context    = None
        expected_exception = <class 'FloatingPointError'>
        kwargs     = {}
        self       = <numpy.testing._private.utils._Dummy testMethod=nop>
/usr/local/lib/python3.9/unittest/case.py:201: in handle
    callable_obj(*args, **kwargs)
        args       = [array(120., dtype=float32)]
        callable_obj = <ufunc 'cosh'>
        kwargs     = {}
        name       = 'assertRaises'
        self       = None
/usr/local/lib/python3.9/unittest/case.py:223: in __exit__
    self._raiseFailure("{} not raised by {}".format(exc_name,
        exc_name   = 'FloatingPointError'
        exc_type   = None
        exc_value  = None
        self       = <unittest.case._AssertRaisesContext object at 0xc05679670>
        tb         = None
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <unittest.case._AssertRaisesContext object at 0xc05679670>
standardMsg = 'FloatingPointError not raised by cosh'
    def _raiseFailure(self, standardMsg):
        msg = self.test_case._formatMessage(self.msg, standardMsg)
>       raise self.test_case.failureException(msg)
E       AssertionError: FloatingPointError not raised by cosh
msg        = 'FloatingPointError not raised by cosh'
self       = <unittest.case._AssertRaisesContext object at 0xc05679670>
standardMsg = 'FloatingPointError not raised by cosh'
/usr/local/lib/python3.9/unittest/case.py:163: AssertionError
________________ TestSpecialComplexAVX.test_array[complex64--1] ________________
self = <numpy.core.tests.test_umath_complex.TestSpecialComplexAVX object at 0x97a6a3610>
stride = -1, astype = <class 'numpy.complex64'>
    @pytest.mark.parametrize("stride", [-4,-2,-1,1,2,4])
    @pytest.mark.parametrize("astype", [np.complex64, np.complex128])
    def test_array(self, stride, astype):
        arr = np.array([complex(np.nan , np.nan),
                        complex(np.nan , np.inf),
                        complex(np.inf , np.nan),
                        complex(np.inf , np.inf),
                        complex(0.     , np.inf),
                        complex(np.inf , 0.),
                        complex(0.     , 0.),
                        complex(0.     , np.nan),
                        complex(np.nan , 0.)], dtype=astype)
        abs_true = np.array([np.nan, np.inf, np.inf, np.inf, np.inf, np.inf, 0., np.nan, np.nan], dtype=arr.real.dtype)
        sq_true = np.array([complex(np.nan,  np.nan),
                            complex(np.nan,  np.nan),
                            complex(np.nan,  np.nan),
                            complex(np.nan,  np.inf),
                            complex(-np.inf, np.nan),
                            complex(np.inf,  np.nan),
                            complex(0.,     0.),
                            complex(np.nan, np.nan),
                            complex(np.nan, np.nan)], dtype=astype)
>       assert_equal(np.abs(arr[::stride]), abs_true[::stride])
E       RuntimeWarning: invalid value encountered in absolute
abs_true   = array([nan, inf, inf, inf, inf, inf,  0., nan, nan], dtype=float32)
arr        = array([nan+nanj, nan+infj, inf+nanj, inf+infj,  0.+infj, inf +0.j,
        0. +0.j,  0.+nanj, nan +0.j], dtype=complex64)
astype     = <class 'numpy.complex64'>
self       = <numpy.core.tests.test_umath_complex.TestSpecialComplexAVX object at 0x97a6a3610>
sq_true    = array([ nan+nanj,  nan+nanj,  nan+nanj,  nan+infj, -inf+nanj,  inf+nanj,
         0. +0.j,  nan+nanj,  nan+nanj], dtype=complex64)
stride     = -1
../.venv/lib/python3.9/site-packages/numpy/core/tests/test_umath_complex.py:579: RuntimeWarning

EDIT: those also show up on NetBSD (see gh-23379) and armel (see gh-20635)

Should fix the build on FreeBSD and other OSes that are not
C99-compliant.

Closes numpygh-24873
This was a regression in the 1.24.x branch, after a lot of churn
in this file. In 1.22.x/1.23.x, the conditional is the same as in
this fix.
@rgommers rgommers changed the title BLD: fix incorrect feature checks for mandatory math functions BLD: fix math func feature checks, fix FreeBSD build, add CI job Oct 7, 2023
@rgommers rgommers marked this pull request as ready for review October 7, 2023 18:38
@charris charris merged commit 040ed2d into numpy:main Oct 7, 2023
51 checks passed
@charris
Copy link
Member

charris commented Oct 7, 2023

Thanks Ralf.

charris pushed a commit to charris/numpy that referenced this pull request Oct 7, 2023
…py#24876)

* BLD: fix incorrect feature checks for mandatory math functions

Should fix the build on FreeBSD and other OSes that are not
C99-compliant.

Closes numpygh-24873

* CI: add a FreeBSD job on Cirrus CI

* BUG: define `_npy_scaled_cexpl` when ccoshl/csinhl are missing

This was a regression in the 1.24.x branch, after a lot of churn
in this file. In 1.22.x/1.23.x, the conditional is the same as in
this fix.

* TST: avoid failures for FPE errors/warnings in `abs` on BSDs
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Oct 7, 2023
@rgommers rgommers deleted the fix-math-featurechecks branch October 7, 2023 20:21
@rgommers rgommers added this to the 2.0.0 release milestone Oct 7, 2023
charris added a commit that referenced this pull request Oct 7, 2023
) (#24879)

* BLD: fix incorrect feature checks for mandatory math functions

Should fix the build on FreeBSD and other OSes that are not
C99-compliant.

Closes gh-24873

* CI: add a FreeBSD job on Cirrus CI

* BUG: define `_npy_scaled_cexpl` when ccoshl/csinhl are missing

This was a regression in the 1.24.x branch, after a lot of churn
in this file. In 1.22.x/1.23.x, the conditional is the same as in
this fix.

* TST: avoid failures for FPE errors/warnings in `abs` on BSDs

Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
charris added a commit to charris/numpy that referenced this pull request Nov 11, 2023
…py#24876) (numpy#24879)

* BLD: fix incorrect feature checks for mandatory math functions

Should fix the build on FreeBSD and other OSes that are not
C99-compliant.

Closes numpygh-24873

* CI: add a FreeBSD job on Cirrus CI

* BUG: define `_npy_scaled_cexpl` when ccoshl/csinhl are missing

This was a regression in the 1.24.x branch, after a lot of churn
in this file. In 1.22.x/1.23.x, the conditional is the same as in
this fix.

* TST: avoid failures for FPE errors/warnings in `abs` on BSDs

Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
36 - Build Build related PR component: build Meson Items related to the introduction of Meson as the new build system for NumPy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numpy 1.26.0 doesn't work on freebsd
2 participants