Commit b3932c0
Add back extension suffix for portable lib shared object in pip wheel (#6363)
Summary:
Initially our portable lib prebuilt library is named as:
```
_portable_lib.cpython-310-x86_64-linux-gnu.so
```
Where it includes an `EXT_SUFFIX` `cpython-310-x86_64-linux-gnu` consists of architecture and build OS information.
This is enforced by `setuptools` following PEP 3149 and there's no good way to change this behavior.
#5961 was an attempt to rename the .so filename at **packaging** stage to `_portable_lib.so`, so that it is easier to be found by `find_package()` macro in CMake.
However #5961 is breaking the other prebuilt libraries such as `libcustom_ops_aot_lib.so` which depends on the original `_portable_lib.cpython-310-x86_64-linux-gnu.so` name in its RPATH.
This PR is a fix that reverts #5961 and restore the full name during packaging, but try to match the `EXT_SUFFIX` in CMake to be able to find the .so file.
Pull Request resolved: #6363
Test Plan:
```bash
EXECUTORCH_BUILD_PYBIND=ON python setup.py bdist_wheel # build wheel including _portable_lib.*.so
pip install dist/executorch-0.5.0a0+7510f8c-cp310-cp310-linux_x86_64.whl
python -c "from executorch.extension.llm.custom_ops import sdpa_with_kv_cache"
# Run torchao script to make sure find_package() works
push ao/torchao/experimental
bash build_torchao_ops.sh executorch
```
Does not throw `_portable_lib.cpython-310-x86_64-linux-gnu.so` not found error.
Reviewed By: kirklandsign
Differential Revision: D64635137
Pulled By: larryliu0820
fbshipit-source-id: 7e54ea15361ae63acb8324538ea4982e95d6f07a1 parent 4d7b294 commit b3932c0
2 files changed
+34
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
27 | 59 | | |
28 | 60 | | |
29 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | 690 | | |
695 | 691 | | |
696 | 692 | | |
| |||
0 commit comments