Trouble understanding how scikit_build_core and CMake should interact
I have issues having scikit_build_core working properly with CMake. To sum up the context I want to use scikit_build_core:
- I have C++ based packages that must work on their own, that are cross compiled for embedded platforms and contains binaries.
- I want those C++ packages to be usable in Python using pybind11. Sometimes those C++ packages have pure python module dedicated to add custom python features to the binded package.
That's pretty much it. I managed in the past to have scikit_build_core working but that's important to note that I was compiling statically. Now I try to make it work with dynamic linkage and this is where I have trouble. I made an example repo that implements how I think scikit_build_core works in my use case ➡️ https://github.com/strattist/skbuild_poc
My issue is that I end up with this wheel layout:
<details>
<summary>Wheel layout after unzipping</summary>
<pre><code>
├── example
│ ├── _example.cpython-312-x86_64-linux-gnu.so
│ └── __init__.py
├── example-0.0.1.dist-info
│ ├── METADATA
│ ├── RECORD
│ └── WHEEL
├── include
│ └── lib
│ └── src.h
└── lib
└── libexample.so
</code></pre>
</details>
It contains:
- The CMake install targets i.e. `libexample.so` that is the base C++ library and it's public include, the `_example.cpython-etc.so` that comes from pybind11
- An additional `__init__.py` that is here to show how I plan to use the bindings, adding Python code to it
My issue is that each time I want to repair my wheel with `auditwheel` I always have the issue `Cannot repair wheel, because required library "libexample.so" could not be located`
To reproduce (with uv):
```
$ uv venv --python 3.12
$ source .venv/bin/activate
$ uv sync --all-extras --no-install-project
$ uv build --wheel
$ auditwheel repair dist/example-0.0.1-cp312-cp312-linux_x86_64.whl
```
While I have an auditwheel error, I still opened my issue here as I think I haven't fully understood how I should use scikit_build_core with dynamic linkage. I tried setting up the RPATH with the same results. Maybe there is an example showing what I would like to do?
4 条评论