-
Notifications
You must be signed in to change notification settings - Fork 698
Rename CMake target 'executorch' to 'prim_ops_lib' for clarity #11786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
3a3c64d
aa3af4f
103c90e
c6643bc
0113189
d162123
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,12 +77,18 @@ find_package(gflags REQUIRED) | |
| # llama_main: test binary to run llama, with tokenizer and sampler integrated | ||
| # | ||
|
|
||
| <<<<<<< HEAD | ||
|
||
| # find `executorch` libraries. CMAKE_PREFIX_PATH would work for host | ||
| # compilation, but CMAKE_FIND_ROOT_PATH appears to be necessary for | ||
| # cross-compiling (e.g., to Android) to work as well. | ||
| list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../..) | ||
| find_package(executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH) | ||
| executorch_target_link_options_shared_lib(executorch) | ||
| ======= | ||
| # find `executorch` libraries Same as for gflags | ||
| set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/ExecuTorch) | ||
| find_package(executorch CONFIG REQUIRED) | ||
| >>>>>>> 4bc106e7a5 (Rename CMake target 'executorch' to 'prim_ops_lib' for clarity) | ||
|
||
|
|
||
| # llama_runner library | ||
| add_subdirectory(runner) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,9 +48,22 @@ foreach(lib ${required_lib_list}) | |
| endif() | ||
| list(APPEND EXECUTORCH_LIBRARIES ${lib}) | ||
| endforeach() | ||
| <<<<<<< HEAD | ||
| ======= | ||
|
|
||
| # If we reach here, ET required libraries are found. | ||
| target_link_libraries(executorch INTERFACE executorch_core) | ||
| target_link_options_shared_lib(prim_ops_lib) | ||
|
|
||
| >>>>>>> 2e09b42180 (Address larryliu0820 review comments: remove duplicate installs, clean up target_link_options_shared_lib, and update CMake as requested) | ||
|
||
| set(EXECUTORCH_FOUND ON) | ||
|
|
||
| include("${CMAKE_CURRENT_LIST_DIR}/ExecuTorchTargets.cmake") | ||
| target_link_libraries(executorch INTERFACE executorch_core) | ||
|
|
||
| # ...existing code... | ||
|
|
||
| # Move target_link_options_shared_lib(prim_ops_lib) to line 177 (after all target_link_libraries for executorch) | ||
| target_link_options_shared_lib(prim_ops_lib) | ||
JawadKhan65 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| set(optional_lib_list | ||
| flatccrt | ||
|
|
@@ -88,7 +101,64 @@ set(optional_lib_list | |
| torchao_kernels_aarch64 | ||
| ) | ||
|
|
||
| foreach(lib ${optional_lib_list}) | ||
| # TODO: investigate use of install(EXPORT) to cleanly handle | ||
| # target_compile_options/target_compile_definitions for everything. | ||
| if(TARGET cpublas) | ||
| set_target_properties( | ||
| cpublas PROPERTIES INTERFACE_LINK_LIBRARIES | ||
| "extension_threadpool;eigen_blas" | ||
| ) | ||
| endif() | ||
| if(TARGET optimized_kernels) | ||
| set_target_properties( | ||
| optimized_kernels PROPERTIES INTERFACE_LINK_LIBRARIES | ||
| "executorch_core;cpublas;extension_threadpool" | ||
| ) | ||
| endif() | ||
|
|
||
| if(TARGET coremldelegate) | ||
| set_target_properties( | ||
| coremldelegate PROPERTIES INTERFACE_LINK_LIBRARIES | ||
| "coreml_inmemoryfs;coreml_util" | ||
| ) | ||
| endif() | ||
|
|
||
| if(TARGET etdump) | ||
| set_target_properties(etdump PROPERTIES INTERFACE_LINK_LIBRARIES "flatccrt;executorch") | ||
| endif() | ||
|
|
||
| if(TARGET optimized_native_cpu_ops_lib) | ||
| if(TARGET optimized_portable_kernels) | ||
| set(_maybe_optimized_portable_kernels_lib optimized_portable_kernels) | ||
| else() | ||
| set(_maybe_optimized_portable_kernels_lib portable_kernels) | ||
| endif() | ||
| set_target_properties( | ||
| optimized_native_cpu_ops_lib | ||
| PROPERTIES INTERFACE_LINK_LIBRARIES | ||
| "optimized_kernels;${_maybe_optimized_portable_kernels_lib}" | ||
| ) | ||
| endif() | ||
| if(TARGET extension_threadpool) | ||
| target_compile_definitions(extension_threadpool INTERFACE ET_USE_THREADPOOL) | ||
| set_target_properties( | ||
| extension_threadpool PROPERTIES INTERFACE_LINK_LIBRARIES | ||
| "cpuinfo;pthreadpool" | ||
| ) | ||
| endif() | ||
|
|
||
| # target_link_options_shared_lib(prim_ops_lib) is now called automatically in executorch-config.cmake | ||
| target_link_options_shared_lib(prim_ops_lib) | ||
|
|
||
| set(shared_lib_list | ||
| # executorch -- size tests fail due to regression if we include this and I'm not sure it's needed. | ||
| optimized_native_cpu_ops_lib | ||
| portable_ops_lib | ||
| quantized_ops_lib | ||
| xnnpack_backend | ||
| vulkan_backend | ||
| quantized_ops_aot_lib) | ||
| foreach(lib ${shared_lib_list}) | ||
| if(TARGET ${lib}) | ||
| list(APPEND EXECUTORCH_LIBRARIES ${lib}) | ||
| else() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.