Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Headers in universal2 wheels are not architecture independent #140

Closed
isuruf opened this issue Nov 1, 2021 · 14 comments
Closed

Headers in universal2 wheels are not architecture independent #140

isuruf opened this issue Nov 1, 2021 · 14 comments

Comments

@isuruf
Copy link
Contributor

isuruf commented Nov 1, 2021

Since auto-generated file _numpyconfig.h has NPY_SIZEOF_LONGDOUBLE and NPY_SIZEOF_COMPLEX_LONGDOUBLE generated, it's wrong for x86_64 as the universal2 wheel distributes the arm64 version of it.

Easiest option would be to stop distributing universal2 wheels and only distribute thin wheels.

@isuruf
Copy link
Contributor Author

isuruf commented Nov 1, 2021

We can ignore universal2 wheels also because pip prefers thin wheels over universal2 wheels if the thin wheel exist.

@tylerjereddy
Copy link
Contributor

Ah ok, this would make sense as the source of the problems based on some back and forth with @charris as well

@rgommers
Copy link
Contributor

rgommers commented Nov 1, 2021

Thanks for tracking that one down!

Easiest option would be to stop distributing universal2 wheels and only distribute thin wheels.

That's fine with me. Probably a good thing in the long run; universal2 is a bit pointless, just increases download sizes.

@isuruf
Copy link
Contributor Author

isuruf commented Nov 1, 2021

Or we merge numpy/numpy#20270

@isuruf
Copy link
Contributor Author

isuruf commented Nov 1, 2021

In the meantime we should either upload a thin wheel or yank numpy-1.21.3-cp310-cp310-macosx_10_9_universal2.whl

@charris
Copy link
Contributor

charris commented Nov 1, 2021

@isuruf Do you know if rosetta supports extended precision long doubles? We ran into a problem with cpp where we needed to use typedef long double npy_longdouble, which I am thinking may have been a wrong workaround.

@isuruf
Copy link
Contributor Author

isuruf commented Nov 1, 2021

Yes.

(base) idf2@M1MD ~ % cat asd.cpp         
#include<iostream>
  
int main()
{
    long double eps = 0.5;
    while ((1+eps) != 1)
    {
        eps /=2;
    }
    std::cout << eps*2 << std::endl;
}
(base) idf2@M1MD ~ % clang++ asd.cpp -arch arm64 -arch x86_64
(base) idf2@M1MD ~ % arch -x86_64 ./a.out                    
1.0842e-19
(base) idf2@M1MD ~ % arch -arm64 ./a.out                     
2.22045e-16

@charris
Copy link
Contributor

charris commented Nov 1, 2021

@isuruf I'm happy to do both. Do the thin 3.10 builds work now?

@isuruf
Copy link
Contributor Author

isuruf commented Nov 1, 2021

You'll have to use multi-build/multibuild#438 to get a thin wheel with 3.10

@charris
Copy link
Contributor

charris commented Nov 1, 2021

I've merged #20270. I'll trigger a nightly build so it can be tested.

@charris
Copy link
Contributor

charris commented Nov 2, 2021

@isuruf Is there a problem getting multi-build/multibuild#438 merged?

@isuruf
Copy link
Contributor Author

isuruf commented Nov 2, 2021

Nope. Just needs a review

@EwoutH
Copy link

EwoutH commented Nov 4, 2021

multi-build/multibuild#438 was merged yesterday!

@charris
Copy link
Contributor

charris commented Nov 5, 2021

Both numpy and multibuild have been updated to deal with this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants