Skip to content

Add install from source instructions #104

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

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

mhvk
Copy link
Contributor

@mhvk mhvk commented Feb 27, 2025

I thought I would give the quad dtype a try. It was giving errors (will raise separate issue), so I thought I should perhaps install from source. That doesn't really help, but as it took me a while to figure out how to do it, it seemed a good idea to add instructions to the README. Note that this is super linux-centric, but perhaps better than nothing?

@ngoldbaum
Copy link
Member

Fun, not sure why the test is failing, but it's unrelated.

@SwayamInSync would you mind giving this a look? If not I'll try diving in here a bit tomorrow (and see if I can reproduce @mhvk's crash).

@mhvk
Copy link
Contributor Author

mhvk commented Feb 27, 2025

OK, sounds good. Note that I basically started from the github workflow; great that you had that!

@SwayamInSync
Copy link
Contributor

Fun, not sure why the test is failing, but it's unrelated.

@SwayamInSync would you mind giving this a look? If not I'll try diving in here a bit tomorrow (and see if I can reproduce @mhvk's crash).

Sure, I'll give this a go this weekend, a possible hunch is that Sleef got some updates recently (didn't followed them thoroughly) but that can be a possibility of crash.
Thanks @mhvk we will check and fix it :)

@mhvk
Copy link
Contributor Author

mhvk commented Feb 28, 2025

@SwayamInSync - thanks! As for sleef, after I installed sleef on my machine, I did run the tests and they all passed.

@SwayamInSync
Copy link
Contributor

Quick fix and issue

I see, my suspection seems to be correct, it was indeed version changing issues (and a pretty interesting one)
We build this with the 3.6 version of Sleef and now currently ongoing in 3.8

So I changed the version back to 3.6 in my fork and it passed all the tests

git clone -b 3.6 https://github.com/shibatch/sleef.git

Now fun part:

The issue is in the that test too, the test checks for the nan as

assert (QuadPrecision("nan") != QuadPrecision("nan")) == (QuadPrecision("nan") == QuadPrecision("nan"))

A simplified version would be

(nan != nan) == (nan == nan)

As per IEEE-754 this should evaluate to

(nan != nan)  # True
(nan == nan)  # False

# so overall
True == False

So the previous version (3.6) was IEEE incorrect (passing that test) and which when fixed in 3.8 made the error

so the correct test should be

def test_nan_and_inf():
    # NaN should not equal itself
    assert QuadPrecision("nan") != QuadPrecision("nan")
    
    # Test infinity comparisons
    assert QuadPrecision("inf") > QuadPrecision("1e1000")
    assert QuadPrecision("-inf") < QuadPrecision("-1e1000")

@ngoldbaum another reason we should plan a tlfloat backend :)

@mhvk mhvk force-pushed the install-from-source branch from 5fcc602 to 6e83f1c Compare March 2, 2025 20:09
@mhvk
Copy link
Contributor Author

mhvk commented Mar 2, 2025

I now checked on my laptop and it turns out my installation instructions had some typos and had aftereffects of experimenting with environment variables. I corrected these.

@ngoldbaum
Copy link
Member

Thanks @mhvk, let's fix the failing CI in a separate PR.

@ngoldbaum ngoldbaum merged commit ce8c26b into numpy:main Mar 5, 2025
1 check failed
@mhvk mhvk deleted the install-from-source branch March 5, 2025 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants