-
Notifications
You must be signed in to change notification settings - Fork 308
fix detection of math library in numpy build #3520
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
fix detection of math library in numpy build #3520
Conversation
Co-authored-by: Jan André Reuter <[email protected]>
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded |
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 10 out of 10 (6 easyconfigs in total) |
boegel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
@boegelbot please test @ jsc-zen3 |
|
@boegel: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de PR test command '
Test results coming soon (I hope)... Details- notification for comment with ID 2516576397 processed Message to humans: this is just bookkeeping information for me, |
|
Test report by @boegelbot Overview of tested easyconfigs (in order)
Build succeeded for 3 out of 3 (3 easyconfigs in total) |
boegel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
(created using
eb --new-pr)NumPy detects the required math by trying to link a minimal code containing a call to
log(0.).The first try is without any libraries, which works with
gcc -fno-math-errno(our optimization default)because the call gets removed due to not having any effect. So it concludes that
-lmis not required.This then fails to detect availability of functions such as
acoshwhich do not get removed in the sameway and so less exact replacements are used instead which e.g. fail the tests on PPC.
$MATHLIB=mmakes it try-lmfirst and is supported until the Meson backend is used in 1.26+.The test code used is:
The issue can be reproduced by putting it in a file
test.cand running:On PPC I see test failures in e.g. SciPy-bundle-2023.02-gfbf-2022b.eb & SciPy-bundle-2023.07-gfbf-2023a.eb
FAILED core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[complex256] - AssertionError: (120, 1.78095631306534887655740488957533e-10, 5.2863423150802063925011506713427e-21, 'arcsinh')However the issue is not limited to PPC although the fallback functions seem to be "good enough" on x86.
A minimal example I made: https://godbolt.org/z/zGYcW45qE and one that it fails to detect
casinhwithout-lm