File tree Expand file tree Collapse file tree 2 files changed +23
-17
lines changed
Expand file tree Collapse file tree 2 files changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -879,22 +879,28 @@ if(EXECUTORCH_BUILD_PYBIND)
879879
880880 # Set RPATH to find PyTorch libraries relative to the installation location
881881 # This goes from executorch/extension/pybindings up to site-packages, then to
882- # torch/lib
883- # if(APPLE)
884- # get_target_property(existing_rpath portable_lib INSTALL_RPATH)
885- # string(FIND "${existing_rpath}" "@loader_path" pos)
886- # if(pos EQUAL -1)
887- # set_target_properties(
888- # portable_lib PROPERTIES BUILD_RPATH "@loader_path/../../../torch/lib"
889- # INSTALL_RPATH "@loader_path/../../../torch/lib"
890- # )
891- # endif()
892- # else()
893- # set_target_properties(
894- # portable_lib PROPERTIES BUILD_RPATH "$ORIGIN/../../../torch/lib"
895- # INSTALL_RPATH "$ORIGIN/../../../torch/lib"
896- # )
897- # endif()
882+ # torch/lib. Don't do this to APPLE, as it will error out on the following
883+ # error:
884+ #
885+ get_target_property (_rpath portable_lib INSTALL_RPATH )
886+ if (NOT _rpath)
887+ if (APPLE )
888+ set_target_properties (
889+ portable_lib PROPERTIES BUILD_RPATH "@loader_path/../../../torch/lib"
890+ INSTALL_RPATH "@loader_path/../../../torch/lib"
891+ )
892+ else ()
893+ set_target_properties (
894+ portable_lib PROPERTIES BUILD_RPATH "$ORIGIN/../../../torch/lib"
895+ INSTALL_RPATH "$ORIGIN/../../../torch/lib"
896+ )
897+ endif ()
898+ else ()
899+ message (
900+ STATUS
901+ "Skipping setting RPATH for portable_lib on Apple platforms, found: ${_rpath} "
902+ )
903+ endif ()
898904
899905 install (
900906 TARGETS portable_lib
Original file line number Diff line number Diff line change 11TORCH_VERSION = "2.10.0"
2- NIGHTLY_VERSION = "dev20251012 "
2+ NIGHTLY_VERSION = "dev20251015 "
You can’t perform that action at this time.
0 commit comments