From 97f7727d8009b4e5c8771a86b6b63714925000c3 Mon Sep 17 00:00:00 2001 From: Hansong <107070759+kirklandsign@users.noreply.github.com> Date: Wed, 24 Jul 2024 23:44:25 -0700 Subject: [PATCH] Use rpath for pypi artifact (#4411) * Use rpath for pypi artifact * fix path * Update CMakeLists.txt add $ORIGIN as well --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63fdb4782e..6099290944 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -693,6 +693,14 @@ if(EXECUTORCH_BUILD_PYBIND) BUILD_RPATH "@loader_path/../../../torch/lib" INSTALL_RPATH "@loader_path/../../../torch/lib" ) + else() + set_target_properties( + portable_lib + PROPERTIES # Assume that this library will be installed in + # `site-packages/executorch/extension/pybindings`, and that + # the custom_ops_aot_lib should be found with relative path. + BUILD_RPATH "$ORIGIN:$ORIGIN/../../examples/models/llama2/custom_ops" + ) endif() install(TARGETS portable_lib