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

Instructions for cmake builds on windows #287

Closed
louisabraham opened this issue Mar 4, 2020 · 3 comments
Closed

Instructions for cmake builds on windows #287

louisabraham opened this issue Mar 4, 2020 · 3 comments

Comments

@louisabraham
Copy link

louisabraham commented Mar 4, 2020

I'm compiling a C library (https://github.com/y-256/libdivsufsort) on multiple windows platforms.

With the exact same build code (available here), I tried to load it in two different versions of Python, on two different builds using ctypes.
The cp36-win_amd64 fails but the cp36-win32 works.

The error when loading the dll in Python is OSError: [WinError 193] %1 is not a valid Win32 application

I could fix this by specifying the cmake option -A x64 on win_amd64.

I thought it might be useful to document cmake builds on Windows.

@YannickJadoul
Copy link
Member

I'm a bit in doubt whether this is this really cibuildwheel-related? In the end it's really the standard, straightfoward way of configuring a CMake build on Windows, and it can be found in other projects using it (e.g., https://stackoverflow.com/a/28370892 and https://github.com/pybind/pybind11/blob/4f72ef846fe8453596230ac285eeaa0ce3278bb4/.appveyor.yml#L60).

So the main question here is: do we want our docs to only contain cibuildwheel-related stuff and some really tricky/exceptional matters related to cross-platform stuff (such as C++11/14/17 on manynlinux images). Or do we want to compile (or over time collect) a comprehensive guide on building Python wheels on different platforms? @joerick?

@joerick
Copy link
Contributor

joerick commented Jul 11, 2020

If somebody wanted to contribute a cibuildwheel + Cmake guide, that would be awesome, and we could include that. But it's not clear how we'd incorporate stuff like the above into our current structure. Hopefully Google will help people find their way to this issue if they have the same problem!

@Freed-Wu
Copy link

I also met

OSError: [WinError 193] %1 is not a valid Win32 application

In my case, pytest will dlopen a *.dll, while cibuildwheel is in a 64 bit process, and *.dll is a 32 bit dll. test-skip = "*-win32" works for me. https://stackoverflow.com/questions/57187566/python-ctypes-loading-dll-throws-oserror-winerror-193-1-is-not-a-valid-win/73530090#73530090

For windows-arm64, it will be skipped automatically:

Warning: While arm64 wheels can be built on other platforms, they cannot be tested. An arm64 runner is required. To silence this warning, set CIBW_TEST_SKIP: "*-win_arm64".

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

4 participants