Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: 7e54ea15361ae63acb8324538ea4982e95d6f07a
- Loading branch information