Skip to content

Commit 905b88c

Browse files
GregoryComerfacebook-github-bot
authored andcommitted
Rename executorch_no_prim_ops to executorch_core (#5740)
Summary: Minor CMake target cleanup for beta. Pull Request resolved: #5740 Reviewed By: shoumikhin Differential Revision: D63576097 Pulled By: GregoryComer fbshipit-source-id: b10f9f15cfcae3bce769d07cd014e8064d735dbd
1 parent fe0e676 commit 905b88c

File tree

23 files changed

+81
-77
lines changed

23 files changed

+81
-77
lines changed

CMakeLists.txt

+21-17
Original file line numberDiff line numberDiff line change
@@ -458,22 +458,22 @@ endif()
458458
add_subdirectory(schema)
459459

460460
#
461-
# executorch_no_prim_ops: Minimal runtime library
461+
# executorch_core: Minimal runtime library
462462
#
463463
# The bare-minimum runtime library, supporting the Program and Method
464464
# interfaces. Does not contain any operators, including primitive ops. Does not
465465
# contain any backends.
466466
#
467467

468468
# Remove any PAL-definition files from the sources.
469-
list(FILTER _executorch_no_prim_ops__srcs EXCLUDE REGEX
469+
list(FILTER _executorch_core__srcs EXCLUDE REGEX
470470
"runtime/platform/default/[^/]*.cpp$"
471471
)
472472

473473
# Add the source file that maps to the requested default PAL implementation.
474474
if(EXECUTORCH_PAL_DEFAULT MATCHES "^(posix|minimal)$")
475475
message(STATUS "executorch: Using PAL default '${EXECUTORCH_PAL_DEFAULT}'")
476-
list(APPEND _executorch_no_prim_ops__srcs
476+
list(APPEND _executorch_core__srcs
477477
"runtime/platform/default/${EXECUTORCH_PAL_DEFAULT}.cpp"
478478
)
479479
else()
@@ -483,45 +483,49 @@ else()
483483
)
484484
endif()
485485

486-
add_library(executorch_no_prim_ops ${_executorch_no_prim_ops__srcs})
487-
target_link_libraries(executorch_no_prim_ops PRIVATE program_schema)
486+
add_library(executorch_core ${_executorch_core__srcs})
487+
488+
# Legacy name alias.
489+
add_library(executorch_no_prim_ops ALIAS executorch_core)
490+
491+
target_link_libraries(executorch_core PRIVATE program_schema)
488492
if(EXECUTORCH_USE_DL)
489493
# Check if dl exists for this toolchain and only then link it.
490494
find_library(DL_LIBRARY_EXISTS NAMES dl)
491495
# Check if the library was found
492496
if(DL_LIBRARY_EXISTS)
493-
target_link_libraries(executorch_no_prim_ops PRIVATE dl) # For dladdr()
497+
target_link_libraries(executorch_core PRIVATE dl) # For dladdr()
494498
endif()
495499
endif()
496500
target_include_directories(
497-
executorch_no_prim_ops PUBLIC ${_common_include_directories}
501+
executorch_core PUBLIC ${_common_include_directories}
498502
)
499-
target_compile_options(executorch_no_prim_ops PUBLIC ${_common_compile_options})
503+
target_compile_options(executorch_core PUBLIC ${_common_compile_options})
500504
if(MAX_KERNEL_NUM)
501505
target_compile_definitions(
502-
executorch_no_prim_ops PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM}
506+
executorch_core PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM}
503507
)
504508
endif()
505509

506510
if(EXECUTORCH_BUILD_PYBIND AND APPLE)
507511
# shared version
508512
add_library(
509-
executorch_no_prim_ops_shared SHARED ${_executorch_no_prim_ops__srcs}
513+
executorch_core_shared SHARED ${_executorch_core__srcs}
510514
)
511-
target_link_libraries(executorch_no_prim_ops_shared PRIVATE program_schema)
515+
target_link_libraries(executorch_core_shared PRIVATE program_schema)
512516
if(DL_LIBRARY_EXISTS)
513517
# For dladdr()
514-
target_link_libraries(executorch_no_prim_ops_shared PRIVATE dl)
518+
target_link_libraries(executorch_core_shared PRIVATE dl)
515519
endif()
516520
target_include_directories(
517-
executorch_no_prim_ops_shared PUBLIC ${_common_include_directories}
521+
executorch_core_shared PUBLIC ${_common_include_directories}
518522
)
519523
target_compile_options(
520-
executorch_no_prim_ops_shared PUBLIC ${_common_compile_options}
524+
executorch_core_shared PUBLIC ${_common_compile_options}
521525
)
522526
if(MAX_KERNEL_NUM)
523527
target_compile_definitions(
524-
executorch_no_prim_ops_shared PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM}
528+
executorch_core_shared PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM}
525529
)
526530
endif()
527531
endif()
@@ -534,7 +538,7 @@ endif()
534538
# any backends.
535539
#
536540
add_library(executorch ${_executorch__srcs})
537-
target_link_libraries(executorch PRIVATE executorch_no_prim_ops)
541+
target_link_libraries(executorch PRIVATE executorch_core)
538542
target_include_directories(executorch PUBLIC ${_common_include_directories})
539543
target_compile_options(executorch PUBLIC ${_common_compile_options})
540544
target_link_options_shared_lib(executorch)
@@ -570,7 +574,7 @@ endif()
570574
# Install `executorch` library as well as `executorch-config.cmake` under
571575
# ${CMAKE_INSTALL_PREFIX}/
572576
install(
573-
TARGETS executorch executorch_no_prim_ops
577+
TARGETS executorch executorch_core
574578
DESTINATION lib
575579
INCLUDES
576580
DESTINATION ${_common_include_directories}

backends/apple/coreml/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ target_include_directories(
134134
coremldelegate PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util
135135
)
136136
target_include_directories(coremldelegate PRIVATE ${EXECUTORCH_ROOT}/..)
137-
target_link_libraries(coremldelegate PRIVATE executorch_no_prim_ops)
137+
target_link_libraries(coremldelegate PRIVATE executorch_core)
138138

139139
if(EXECUTORCH_BUILD_DEVTOOLS)
140140
target_sources(coremldelegate PRIVATE ${SDK_SOURCES} ${PROTOBUF_SOURCES})
@@ -159,7 +159,7 @@ find_library(SQLITE_LIBRARY sqlite3)
159159

160160
target_link_libraries(
161161
coremldelegate
162-
PRIVATE executorch_no_prim_ops ${ACCELERATE_FRAMEWORK} ${COREML_FRAMEWORK}
162+
PRIVATE executorch_core ${ACCELERATE_FRAMEWORK} ${COREML_FRAMEWORK}
163163
${FOUNDATION_FRAMEWORK} ${SQLITE_LIBRARY}
164164
)
165165

@@ -176,7 +176,7 @@ target_compile_options(coremldelegate PRIVATE "-fno-exceptions")
176176

177177
if(EXECUTORCH_BUILD_DEVTOOLS)
178178
target_compile_options(
179-
executorch_no_prim_ops PUBLIC -DET_EVENT_TRACER_ENABLED
179+
executorch_core PUBLIC -DET_EVENT_TRACER_ENABLED
180180
)
181181
target_compile_options(coremldelegate PRIVATE "-frtti")
182182
target_compile_options(libprotobuf-lite PRIVATE "-frtti")

backends/apple/coreml/runtime/workspace/executorchcoreml.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
C9E7D7962AB3F9BF00CCAE5D /* KeyValueStoreTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9E7D78E2AB3F9BF00CCAE5D /* KeyValueStoreTests.mm */; };
106106
C9E7D7A22AB3FBB200CCAE5D /* CoreMLBackendDelegateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9E7D7A12AB3FBB200CCAE5D /* CoreMLBackendDelegateTests.mm */; };
107107
C9EC7E1B2BC73B3200A6B166 /* MultiArrayTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9EC7E1A2BC73B3200A6B166 /* MultiArrayTests.mm */; };
108-
F24817E52BC655E100E80D98 /* libexecutorch_no_prim_ops.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F24817E42BC655E100E80D98 /* libexecutorch_no_prim_ops.a */; };
108+
F24817E52BC655E100E80D98 /* libexecutorch_core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F24817E42BC655E100E80D98 /* libexecutorch_core.a */; };
109109
/* End PBXBuildFile section */
110110

111111
/* Begin PBXCopyFilesBuildPhase section */
@@ -310,7 +310,7 @@
310310
C9EA3FE52B73EF6300B7D7BD /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
311311
C9EC7E092BC662A300A6B166 /* objc_array_util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = objc_array_util.h; path = ../util/objc_array_util.h; sourceTree = "<group>"; };
312312
C9EC7E1A2BC73B3200A6B166 /* MultiArrayTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = MultiArrayTests.mm; path = ../test/MultiArrayTests.mm; sourceTree = "<group>"; };
313-
F24817E42BC655E100E80D98 /* libexecutorch_no_prim_ops.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexecutorch_no_prim_ops.a; path = ../libraries/libexecutorch_no_prim_ops.a; sourceTree = "<group>"; };
313+
F24817E42BC655E100E80D98 /* libexecutorch_core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexecutorch_core.a; path = ../libraries/libexecutorch_core.a; sourceTree = "<group>"; };
314314
/* End PBXFileReference section */
315315

316316
/* Begin PBXFrameworksBuildPhase section */
@@ -319,7 +319,7 @@
319319
buildActionMask = 2147483647;
320320
files = (
321321
C94D510F2ABDF87500AF47FD /* Accelerate.framework in Frameworks */,
322-
F24817E52BC655E100E80D98 /* libexecutorch_no_prim_ops.a in Frameworks */,
322+
F24817E52BC655E100E80D98 /* libexecutorch_core.a in Frameworks */,
323323
C94D510E2ABDF86800AF47FD /* libsqlite3.tbd in Frameworks */,
324324
C94D50D92ABD7B2400AF47FD /* CoreML.framework in Frameworks */,
325325
C99883862B95AD7D000953A3 /* libprotobuf-lite.a in Frameworks */,
@@ -540,7 +540,7 @@
540540
C96560942AABFDCE005F8126 /* libsqlite3.tbd */,
541541
C96560922AABF992005F8126 /* CoreML.framework */,
542542
C96560902AABF982005F8126 /* Accelerate.framework */,
543-
F24817E42BC655E100E80D98 /* libexecutorch_no_prim_ops.a */,
543+
F24817E42BC655E100E80D98 /* libexecutorch_core.a */,
544544
C965608D2AABF72A005F8126 /* libexecutorch.a */,
545545
);
546546
name = "Recovered References";

backends/apple/coreml/scripts/build_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ cmake --build "$CMAKE_PROTOBUF_BUILD_DIR_PATH" -j9 -t libprotobuf-lite
5959
echo "ExecuTorch: Copying libraries"
6060
mkdir "$LIBRARIES_DIR_PATH"
6161
cp -f "$CMAKE_EXECUTORCH_BUILD_DIR_PATH/libexecutorch.a" "$LIBRARIES_DIR_PATH"
62-
cp -f "$CMAKE_EXECUTORCH_BUILD_DIR_PATH/libexecutorch_no_prim_ops.a" "$LIBRARIES_DIR_PATH"
62+
cp -f "$CMAKE_EXECUTORCH_BUILD_DIR_PATH/libexecutorch_core.a" "$LIBRARIES_DIR_PATH"
6363
cp -f "$CMAKE_PROTOBUF_BUILD_DIR_PATH/libprotobuf-lite.a" "$LIBRARIES_DIR_PATH"
6464

6565
#Copy ExecuTorch headers

backends/apple/mps/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ target_link_libraries(
7575
mpsdelegate
7676
PRIVATE bundled_program
7777
mps_schema
78-
executorch_no_prim_ops
78+
executorch_core
7979
${FOUNDATION_FRAMEWORK}
8080
${METAL_FRAMEWORK}
8181
${MPS_FRAMEWORK}

backends/mediatek/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/include)
2727
add_library(neuron_backend SHARED)
2828
target_link_libraries(neuron_backend
2929
PRIVATE
30-
executorch_no_prim_ops
30+
executorch_core
3131
portable_ops_lib
3232
android
3333
log

backends/qualcomm/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ target_link_libraries(
181181
)
182182
target_link_libraries(
183183
qnn_executorch_backend PRIVATE qnn_executorch_header qnn_schema qnn_manager
184-
executorch_no_prim_ops qcir_utils extension_tensor
184+
executorch_core qcir_utils extension_tensor
185185
)
186186
set_target_properties(
187187
qnn_executorch_backend PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'"

backends/xnnpack/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ include(cmake/Dependencies.cmake)
9393
list(TRANSFORM _xnnpack_backend__srcs PREPEND "${EXECUTORCH_ROOT}/")
9494
add_library(xnnpack_backend STATIC ${_xnnpack_backend__srcs})
9595
target_link_libraries(
96-
xnnpack_backend PRIVATE ${xnnpack_third_party} executorch_no_prim_ops
96+
xnnpack_backend PRIVATE ${xnnpack_third_party} executorch_core
9797
xnnpack_schema
9898
)
9999

build/Codegen.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function(gen_custom_ops_aot_lib)
154154
if(TARGET portable_lib)
155155
target_link_libraries(${GEN_LIB_NAME} PRIVATE portable_lib)
156156
else()
157-
target_link_libraries(${GEN_LIB_NAME} PRIVATE executorch_no_prim_ops)
157+
target_link_libraries(${GEN_LIB_NAME} PRIVATE executorch_core)
158158
endif()
159159
endfunction()
160160

build/build_apple_frameworks.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ PLATFORM_TARGET=("17.0" "17.0" "10.15")
2929

3030
FRAMEWORK_EXECUTORCH="executorch:\
3131
libexecutorch.a,\
32-
libexecutorch_no_prim_ops.a,\
32+
libexecutorch_core.a,\
3333
libextension_apple.a,\
3434
libextension_data_loader.a,\
3535
libextension_module.a,\

0 commit comments

Comments
 (0)