diff --git a/build/cmake_deps.toml b/build/cmake_deps.toml index 4811563269c..b1ed81b6a7e 100644 --- a/build/cmake_deps.toml +++ b/build/cmake_deps.toml @@ -58,6 +58,21 @@ deps = [ "executorch_core", ] +# HACK: prevent reduce_util from also showing up in custom_ops. The +# actual medium-term fix is to stop using Buck to drive our CMake +# builds. +[targets.reduce_util] +buck_targets = [ + "//kernels/portable/cpu/util:reduce_util", +] +filters = [ + ".cpp$", +] +deps = [ + "executorch", + "executorch_core", +] + [targets.optimized_kernels] buck_targets = [ "//kernels/optimized:generated_lib", @@ -414,6 +429,7 @@ deps = [ "optimized_kernels", "extension_parallel", "extension_threadpool", + "reduce_util", "xnnpack_backend", ] diff --git a/build/executorch-config.cmake b/build/executorch-config.cmake index 2c459b66ac8..e2cff7da6b5 100644 --- a/build/executorch-config.cmake +++ b/build/executorch-config.cmake @@ -65,6 +65,7 @@ set(lib_list neuron_backend qnn_executorch_backend portable_ops_lib + custom_ops extension_module extension_module_static extension_parallel diff --git a/examples/models/llama/CMakeLists.txt b/examples/models/llama/CMakeLists.txt index 5f49581ea25..67cf2f446a3 100644 --- a/examples/models/llama/CMakeLists.txt +++ b/examples/models/llama/CMakeLists.txt @@ -15,7 +15,7 @@ # ~~~ # It should also be cmake-lint clean. # -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) # 3.24 is required for WHOLE_ARCHIVE project(llama_runner) # Duplicating options as root CMakeLists.txt @@ -84,14 +84,6 @@ if(CMAKE_TOOLCHAIN_IOS OR ANDROID) target_link_options_shared_lib(executorch) endif() -# custom ops library -if(EXECUTORCH_BUILD_KERNELS_CUSTOM) - add_subdirectory( - ${CMAKE_CURRENT_SOURCE_DIR}/../../../extension/llm/custom_ops - ${CMAKE_CURRENT_BINARY_DIR}/../../../extension/llm/custom_ops - ) -endif() - # llama_runner library add_subdirectory(runner) @@ -119,8 +111,7 @@ target_link_options_shared_lib(quantized_ops_lib) list(APPEND link_libraries quantized_kernels quantized_ops_lib) if(EXECUTORCH_BUILD_KERNELS_CUSTOM) - target_link_options_shared_lib(custom_ops) - list(APPEND link_libraries custom_ops) + list(APPEND link_libraries $) endif() if(EXECUTORCH_BUILD_TORCHAO) diff --git a/examples/models/llava/CMakeLists.txt b/examples/models/llava/CMakeLists.txt index ecd00809fdb..f7fa4bacc04 100644 --- a/examples/models/llava/CMakeLists.txt +++ b/examples/models/llava/CMakeLists.txt @@ -93,14 +93,6 @@ if(CMAKE_TOOLCHAIN_IOS OR ANDROID) target_link_options_shared_lib(executorch) endif() -# custom ops library -if(EXECUTORCH_BUILD_KERNELS_CUSTOM) - add_subdirectory( - ${EXECUTORCH_ROOT}/extension/llm/custom_ops - ${CMAKE_CURRENT_BINARY_DIR}/../../../extension/llm/custom_ops - ) -endif() - # llava_runner library add_subdirectory(runner) @@ -132,7 +124,6 @@ target_link_options_shared_lib(quantized_ops_lib) list(APPEND link_libraries quantized_kernels quantized_ops_lib) if(EXECUTORCH_BUILD_KERNELS_CUSTOM) - target_link_options_shared_lib(custom_ops) list(APPEND link_libraries custom_ops) endif() diff --git a/extension/android/CMakeLists.txt b/extension/android/CMakeLists.txt index 70f21f2751c..322d944bb38 100644 --- a/extension/android/CMakeLists.txt +++ b/extension/android/CMakeLists.txt @@ -4,7 +4,7 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) # 3.24 is required for WHOLE_ARCHIVE project(executorch_jni) @@ -115,12 +115,7 @@ if(TARGET vulkan_backend) endif() if(EXECUTORCH_BUILD_KERNELS_CUSTOM) - add_subdirectory( - ${EXECUTORCH_ROOT}/extension/llm/custom_ops - ${CMAKE_CURRENT_BINARY_DIR}/../../extension/llm/custom_ops - ) - list(APPEND link_libraries custom_ops) - target_link_options_shared_lib(custom_ops) + list(APPEND link_libraries $) endif() if(TARGET pthreadpool)