Skip to content

Commit

Permalink
Fix wheel build and smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklandsign committed Jul 25, 2024
1 parent 77c905d commit 86eaab8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,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/../../examplesmodels/llama2/custom_ops"
)
endif()

install(TARGETS portable_lib
Expand Down
1 change: 1 addition & 0 deletions build/packaging/post_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@

set -eux

rm -rf pip-out/
echo "This script is run after building ExecuTorch binaries"
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,15 @@ def get_ext_modules() -> List[Extension]:
"executorch/examples/models/llama2/custom_ops",
)
)
ext_modules.append(
# Install the prebuilt library for quantized ops required by custom ops.
BuiltFile(
"kernels/quantized/libquantized_ops_aot_lib.*",
# Pushing the quantized ops to the same directory as the custom ops
# so that we don't need additional rpath for custom_ops.
"executorch/examples/models/llama2/custom_ops",
)
)

# Note that setuptools uses the presence of ext_modules as the main signal
# that a wheel is platform-specific. If we install any platform-specific
Expand Down

0 comments on commit 86eaab8

Please sign in to comment.