From cc33afc80ccda4e993ba0f0f4cdb36cc9d65b712 Mon Sep 17 00:00:00 2001 From: Tarun Karuturi Date: Wed, 24 Apr 2024 12:52:03 -0700 Subject: [PATCH] Fix sdk_example_runner.sh (#3298) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/3298 Reviewed By: Olivia-liu Differential Revision: D56509749 Pulled By: tarun292 fbshipit-source-id: 36b56e7cc039144105d64431697a16a793029af8 (cherry picked from commit aa3e73620816d2e6e5a424a5ab8c8c15679b4ae0) --- examples/sdk/CMakeLists.txt | 21 +++++++-------------- examples/sdk/test_sdk_example_runner.sh | 3 +-- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/examples/sdk/CMakeLists.txt b/examples/sdk/CMakeLists.txt index d7ca7679e3..ec65bef8f5 100644 --- a/examples/sdk/CMakeLists.txt +++ b/examples/sdk/CMakeLists.txt @@ -38,6 +38,9 @@ set(_common_include_directories ${EXECUTORCH_ROOT}/..) # Find prebuilt libraries. executorch package should contain # portable_ops_lib, etdump, bundled_program. find_package(executorch CONFIG REQUIRED) +target_link_options_shared_lib(executorch) +target_link_options_shared_lib(portable_ops_lib) + target_include_directories(executorch INTERFACE ${_common_include_directories}) find_package( @@ -48,18 +51,6 @@ add_executable(sdk_example_runner sdk_example_runner/sdk_example_runner.cpp) target_compile_options(executorch INTERFACE -DET_EVENT_TRACER_ENABLED) -# portable_ops_lib -gen_selected_ops("" "" "ON") -# Expect gen_selected_ops output file to be selected_operators.yaml -generate_bindings_for_kernels( - FUNCTIONS_YAML ${EXECUTORCH_ROOT}/kernels/portable/functions.yaml -) -gen_operators_lib( - "portable_ops_lib" - KERNEL_LIBS portable_kernels - DEPS executorch) - -target_compile_options(portable_ops_lib INTERFACE -DET_EVENT_TRACER_ENABLED) target_include_directories( etdump INTERFACE @@ -72,6 +63,8 @@ target_link_libraries( gflags etdump extension_data_loader - flatcc bundled_program - portable_ops_lib) + flatccrt + portable_ops_lib + portable_kernels +) diff --git a/examples/sdk/test_sdk_example_runner.sh b/examples/sdk/test_sdk_example_runner.sh index 2f1044f42c..5185def655 100644 --- a/examples/sdk/test_sdk_example_runner.sh +++ b/examples/sdk/test_sdk_example_runner.sh @@ -18,8 +18,7 @@ cmake_install_executorch_sdk_lib() { echo "Installing libexecutorch.a, libportable_kernels.a, libetdump.a, libbundled_program.a" rm -rf cmake-out - retry cmake -DBUCK2="$BUCK" \ - -DCMAKE_INSTALL_PREFIX=cmake-out \ + retry cmake -DCMAKE_INSTALL_PREFIX=cmake-out \ -DCMAKE_BUILD_TYPE=Release \ -DEXECUTORCH_BUILD_SDK=ON \ -DEXECUTORCH_ENABLE_EVENT_TRACER=ON \