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

Build Wheels #106

Closed
jameskermode opened this issue Sep 27, 2022 · 12 comments · Fixed by #117
Closed

Build Wheels #106

jameskermode opened this issue Sep 27, 2022 · 12 comments · Fixed by #117

Comments

@jameskermode
Copy link
Member

I'd like to setup cibuildwheel to build binary wheels using GitHub Actions that we can release on PyPI. This would also help with issues like #57 requesting support on a wider range of platforms. I've had good success doing this with f90wrap and quippy, and matscipy should be simpler as there's no Fortran (although there is C++, so #96 would still be valuable).

@jameskermode
Copy link
Member Author

@pastewka Is C++11 sufficient for everything we use? If not there are tricks to enable C++14 compliant compilers: https://cibuildwheel.readthedocs.io/en/stable/cpp_standards/

@pastewka
Copy link
Collaborator

The C++ parts are very bare bones, C++11 should be sufficient.

@jameskermode
Copy link
Member Author

Done for MacOS and Linux in #107. Will leave this open until tested and as a reminder to add Windows support.

@ilyes319
Copy link

Hey @jameskermode,

Putting a comment here for the windows wheels. I am trying to install matscipy on windows. I think I am using MSVC compiler. When doing pip install matscipy I get the following error:
matscipy_error_pip.txt

Not sure I understand correctly the error. Maybe the wheels does not work with MSVC and I should use GCC.

@jameskermode
Copy link
Member Author

OK thanks. This is the same error I get in GitHub Actions so at least it's consistent.

@jameskermode
Copy link
Member Author

There do seem to be some portability problems with our C++ code to Visual C++. Working on it in the windows-wheels branch, but iteration is a bit slow testing only via CI.

@ilyes319
Copy link

The new windows wheel works great, but when I import matscipy.neighbours I get the following error:

  File "<stdin>", line 1, in <module>
  File "C:\Users\Lilyes\anaconda3\envs\torch_nightly\lib\site-packages\matscipy\neighbours.py", line 35, in <module>
    from . import ffi
  File "C:\Users\Lilyes\anaconda3\envs\torch_nightly\lib\site-packages\matscipy\ffi.py", line 38, in <module>
    from _matscipy import *  # noqa
ModuleNotFoundError: No module named '_matscipy'

@pastewka
Copy link
Collaborator

I think this could be related to moving the location of the extension module @prs513rosewood

@jameskermode
Copy link
Member Author

jameskermode commented Dec 17, 2022

Agreed, it looks related to that change. Can we fix or revert please?

@prs513rosewood
Copy link
Contributor

prs513rosewood commented Dec 19, 2022

@ilyes319 Could you list your site-packages\ and site-packages\matscipy directories? The changes I've made should pick up _matscipy.* installed in either of these locations.

@prs513rosewood
Copy link
Contributor

I investigated a bit more and the true error message is the following:

Traceback (most recent call last):
  File "C:\Users\lucas\AppData\Roaming\Python\Python311\site-packages\matscipy\ffi.py", line 36, in <module>
    from ._matscipy import *  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing _matscipy: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "C:\Users\lucas\AppData\Roaming\Python\Python311\site-packages\matscipy\ffi.py", line 38, in <module>
    from _matscipy import *  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_matscipy'

I looked into the DLL load failed error and the source could be either:

  1. Missing C++ runtime components
  2. The compiled extension dynamically links to GCC libs that are missing, which can happen with Meson

After looking at the dependencies of the compiled extension, it seems the second option is more likely, since it links to libgcc_s_seh-1.dll and libstdc++-6.dll, so the error is unrelated to the location of the _matscipy module.

@prs513rosewood
Copy link
Contributor

@ilyes319 The latest wheels should now work for windows.

@prs513rosewood prs513rosewood linked a pull request Dec 20, 2022 that will close this issue
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 a pull request may close this issue.

4 participants