Numpy: Numpy tests fail on musl/AlpineLinux

Created on 27 Jan 2016  ·  5Comments  ·  Source: numpy/numpy

On AlpineLinux, which is a mil based Linux distributive, some of numpy's test fail. The log is attached.
log.txt

There are two types of issues - one for various missed overflow/underflow exceptions, the second one is for incorrect results from musl's trigonometric functions.

The first one can be fixed by including fenv.h header in musl builds, AFAIU this can be done in numpy/numpy/core/src/npymath/ieee754.c.src and numpy/core/include/numpy/ufuncobject.h by replacing __GLIBC__ with __GNUC__

The second group can be fixed by disabling the trigonometric functions in numpy/numpy/core/src/private/npy_config.h not only for glibc, but also for musl. An issue here is that musl doesn't provide any macro like the __GLIBC__ to detect it.

So the question, is numpy interested in such a patch? Could you please share your opinions what is best way to implement it?

Otherwise the patch can be implement in corresponding package for AlpineLinux

Most helpful comment

Yep, still no numpy for alpine users (which is increasingly popular as a docker base). It's made life miserable for our python users. Would love to see a patch.

All 5 comments

Yep, still no numpy for alpine users (which is increasingly popular as a docker base). It's made life miserable for our python users. Would love to see a patch.

What library does AlpineLinux use? It must be something pretty close to glibc if the same trig functions fail.

OK, it's musl. Is the really no macro to identify the presence of musl? One problem is other libc implementations combined with the gnuc compiler, so we can't just use __GNUC__.

Another case where trying to have an explicit list of all bad libm versions
bites us :-/ If someone is feeling particularly inspired, an fully
comprehensive solution would be to tackle #7173.
On Mar 18, 2016 6:13 PM, "Charles Harris" [email protected] wrote:

OK, it's musl. Is the really no macro to identify the presence of musl?
One problem is other libc implementations combined with the gnuc compiler,
so we can't just use GNUC.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/numpy/numpy/issues/7128#issuecomment-198597654

Duplicate of #12095, closing this since the other has more information

Was this page helpful?
0 / 5 - 0 ratings