-
I am trying to create windows wheels for a python project that includes a shared library which in turn depends on a compiled boost library. The library is only used through
I am guessing there is a way to do this since it is mentioned in the documentation for example that users can manually invoke delvewheel and in a few discussion threads I found, but I could not figure out how to do it. Any help will be much appreciated. I should mention that I tried adding to pyproject.toml:
But that did not seem to disable the above error. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
This should be possible indeed. If all you're doing is building a shared library and want to install it inside your package, you can use the The Boost library is different, since that's external.
The error is about the internal library, so unrelated to If you run into more trouble, please feel free to point us at your source code. |
Beta Was this translation helpful? Give feedback.
-
That clarifies things a lot, though still not sure how to get it to work. The
Since Eigen is header only, the resulting library does not need any @rpath to be fixed, but I guess mesonpy doesn't know that. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much. That worked beautifully. It would make sense by default to not install libraries which have nothing that needs to be included in the package, but I suspect removing install by default would run afoul of some of the intended uses of wrapdb. In any case the solution is rather clean in the end. |
Beta Was this translation helpful? Give feedback.
-
I'm running into this same issue, but actually need to install the subproject library into my Python package. The subproject I am using is nanoarrow from the wrapdb, whose configuration has an I read through the discussion but I'm not sure what to do since I do need to bundle nanoarrow into my library (a static lib would also be an option): The default meson configuration for a windows run on cibuildwheel yielded: NotImplementedError: Bundling libraries in wheel is not supported on win32 Though macOS and ubuntu were fine. I tried using static linkage in my meson configuration via: nanoarrow_dep = dependency('nanoarrow', default_options: ['default_library=static']) which in turn yielded this error from meson-python (all platforms failed): meson-python: error: Could not map installation path to an equivalent wheel directory: '{libdir_static}\\libnanoarrow.a' After seeing issue #525 I tried reverting back to shared linkage while pinning meson-python 0.13.2 but ran into the same issue as the OP: NotImplementedError: Bundling libraries in wheel is not supported on win32 I tried adding a delvewheel call to the shared linkage + version pin: [tool.cibuildwheel.windows]
before-build = "pip install delvewheel"
repair-wheel-command = "delvewheel repair --add-path {libdir} -w {dest_dir} {wheel}" But during the repair phase I get: FileNotFoundError: Unable to find library: libnanoarrow.dll Is there something simple I am overlooking here? Unfortunately I don't have access to a PC so have been trying this all from GHA; I'm assuming the delvewheel approach is the closest? If it helps this is a PR showing a lot of the things I've walked through |
Beta Was this translation helpful? Give feedback.
meson-python
assumes that anything installed in{libdir}
is a shared library. If you are using Eigen as a dependency, you need to make sure that it is not installed as part of the Python wheel: it does not make sense to distribute a Python wheel containing an headers only library. I think that most likely themeson.build
for Eigen in wrapdb should not install the headers in the first place, but that is another issue. You can pass the--skip-subprojects=eigen
option tomeson install
addingto
pyproject.toml
.