Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .ci/scripts/wheel/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ class ModelTest:


def run_tests(model_tests: List[ModelTest]) -> None:
# Test that we can import the portable_lib module - verifies RPATH is correct
print("Testing portable_lib import...")
try:
from executorch.extension.pybindings._portable_lib import _load_for_executorch
print("✓ Successfully imported _load_for_executorch from portable_lib")
except ImportError as e:
print(f"✗ Failed to import portable_lib: {e}")
raise

# Why are we doing this envvar shenanigans? Since we build the testers, which
# uses buck, we cannot run as root. This is a sneaky of getting around that
# test.
Expand Down
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,20 @@ if(EXECUTORCH_BUILD_PYBIND)
target_compile_options(portable_lib PUBLIC ${_pybind_compile_options})
target_link_libraries(portable_lib PRIVATE ${_dep_libs})

# # Set RPATH to find PyTorch libraries relative to the installation location
# # This goes from executorch/extension/pybindings up to site-packages, then to torch/lib
# if(APPLE)
# set_target_properties(portable_lib PROPERTIES
# BUILD_RPATH "@loader_path/../../../torch/lib"
# INSTALL_RPATH "@loader_path/../../../torch/lib"
# )
# else()
# set_target_properties(portable_lib PROPERTIES
# BUILD_RPATH "$ORIGIN/../../../torch/lib"
# INSTALL_RPATH "$ORIGIN/../../../torch/lib"
# )
# endif()

install(TARGETS portable_lib
LIBRARY DESTINATION executorch/extension/pybindings
)
Expand Down
Loading