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

Fails to build some windows-only code with CIBW 2.9 and CPython 3.11 #1229

Closed
neutrinoceros opened this issue Aug 13, 2022 · 2 comments
Closed

Comments

@neutrinoceros
Copy link

Description

Trying to upgrade to CIBW 2.9.0 to build CPython 3.11 wheels for yt at yt-project/yt#4076

I found that the following line in a C header file doesn't compile

#define isnormal(x) ((_fpclass(x) == _FPCLASS_NN) || (_fpclass(x) == _FPCLASS_PN))

and I get the following error

    D:\a\yt\yt\yt\utilities\lib\platform_dep_math.hpp(11): error C3861: '_fpclass': identifier not found
    D:\a\yt\yt\yt\utilities\lib\platform_dep_math.hpp(11): error C2065: '_FPCLASS_NN': undeclared identifier
    D:\a\yt\yt\yt\utilities\lib\platform_dep_math.hpp(11): error C2065: '_FPCLASS_PN': undeclared identifier

for context, these identifiers are documented as Windows-only:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fpclass-fpclassf?view=msvc-170
and so is the code block where they appear in yt (https://github.com/yt-project/yt/blob/616ec74942ce08ce14426d7b6a4c7ce65b1974b1/yt/utilities/lib/platform_dep.h#L7)

I'm not sure the problem is with CIBW or something else in the supply chain, but I find it suspicious that it compiles fine within the same widows image for all other CPython versions we use it for.

Build log

https://github.com/yt-project/yt/runs/7818103108?check_suite_focus=true

CI config

https://github.com/neutrinoceros/yt/blob/cp311_wheels/.github/workflows/wheels.yaml

@henryiii
Copy link
Contributor

Maybe the <float.h> header is no longer leaked by CPython 3.11? Have you tried either a normal test build (via something like python-version: “3.11-dev” in GHA) or a local build?

@neutrinoceros
Copy link
Author

Maybe the <float.h> header is no longer leaked by CPython 3.11?

Indeed that's precisely what's happening. I just checked that explicitly including this header fixed the build.
So, clearly nothing wrong with CIBW here, I'll close this.

Thank you so much @henryiii !

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

No branches or pull requests

2 participants