diff --git a/.circleci/scripts/linux/build.sh b/.circleci/scripts/linux/build.sh index 77342f9dd2..fc7827d0a9 100644 --- a/.circleci/scripts/linux/build.sh +++ b/.circleci/scripts/linux/build.sh @@ -6,7 +6,7 @@ cd mmdeploy MMDEPLOY_DIR=$(pwd) mkdir -p build && cd build cmake .. -DMMDEPLOY_BUILD_SDK=ON -DMMDEPLOY_BUILD_TEST=ON -DMMDEPLOY_BUILD_SDK_PYTHON_API=ON \ - -DMMDEPLOY_BUILD_EXAMPLES=ON -DMMDEPLOY_BUILD_SDK_CXX_API=ON -DMMDEPLOY_BUILD_SDK_CSHARP_API=ON \ + -DMMDEPLOY_BUILD_EXAMPLES=ON -DMMDEPLOY_BUILD_SDK_CSHARP_API=ON \ -DMMDEPLOY_TARGET_DEVICES="$1" -DMMDEPLOY_TARGET_BACKENDS="$2" "${ARGS[@]:2}" make -j$(nproc) && make install diff --git a/.circleci/test.yml b/.circleci/test.yml index 7fe666a34b..12209b062b 100644 --- a/.circleci/test.yml +++ b/.circleci/test.yml @@ -193,7 +193,6 @@ jobs: -DMMDEPLOY_BUILD_TEST=ON ` -DMMDEPLOY_BUILD_SDK_PYTHON_API=ON ` -DMMDEPLOY_BUILD_EXAMPLES=ON ` - -DMMDEPLOY_BUILD_SDK_CXX_API=ON ` -DMMDEPLOY_BUILD_SDK_CSHARP_API=ON ` -DMMDEPLOY_TARGET_BACKENDS="ort" ` -DOpenCV_DIR="$env:OPENCV_PACKAGE_DIR" diff --git a/CMakeLists.txt b/CMakeLists.txt index 839681a7d0..89886b1d7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,6 @@ option(MMDEPLOY_BUILD_SDK "build MMDeploy SDK" OFF) option(MMDEPLOY_BUILD_SDK_MONOLITHIC "build single lib for SDK API" ON) option(MMDEPLOY_BUILD_TEST "build unittests" OFF) option(MMDEPLOY_BUILD_SDK_PYTHON_API "build SDK Python API" OFF) -option(MMDEPLOY_BUILD_SDK_CXX_API "build SDK C++ API" OFF) option(MMDEPLOY_BUILD_SDK_CSHARP_API "build SDK C# API support" OFF) option(MMDEPLOY_BUILD_SDK_JAVA_API "build SDK JAVA API" OFF) option(MMDEPLOY_BUILD_EXAMPLES "build examples" OFF) diff --git a/cmake/MMDeployConfig.cmake.in b/cmake/MMDeployConfig.cmake.in index 23e728f7ab..c1c5f9bd98 100644 --- a/cmake/MMDeployConfig.cmake.in +++ b/cmake/MMDeployConfig.cmake.in @@ -10,7 +10,6 @@ set(MMDEPLOY_TARGET_DEVICES @MMDEPLOY_TARGET_DEVICES@) set(MMDEPLOY_TARGET_BACKENDS @MMDEPLOY_TARGET_BACKENDS@) set(MMDEPLOY_BUILD_TYPE @CMAKE_BUILD_TYPE@) set(MMDEPLOY_BUILD_SHARED @MMDEPLOY_SHARED_LIBS@) -set(MMDEPLOY_BUILD_SDK_CXX_API @MMDEPLOY_BUILD_SDK_CXX_API@) set(MMDEPLOY_BUILD_SDK_MONOLITHIC @MMDEPLOY_BUILD_SDK_MONOLITHIC@) set(MMDEPLOY_VERSION_MAJOR @MMDEPLOY_VERSION_MAJOR@) set(MMDEPLOY_VERSION_MINOR @MMDEPLOY_VERSION_MINOR@) diff --git a/csrc/mmdeploy/apis/CMakeLists.txt b/csrc/mmdeploy/apis/CMakeLists.txt index deb9831fc3..1ab877be90 100644 --- a/csrc/mmdeploy/apis/CMakeLists.txt +++ b/csrc/mmdeploy/apis/CMakeLists.txt @@ -1,10 +1,5 @@ # Copyright (c) OpenMMLab. All rights reserved. -# Python API depends on C++ API -if (MMDEPLOY_BUILD_SDK_PYTHON_API) - set(MMDEPLOY_BUILD_SDK_CXX_API ON) -endif () - add_subdirectory(c) add_subdirectory(cxx) add_subdirectory(java) diff --git a/csrc/mmdeploy/apis/cxx/CMakeLists.txt b/csrc/mmdeploy/apis/cxx/CMakeLists.txt index 7f0a646265..19d56344a6 100644 --- a/csrc/mmdeploy/apis/cxx/CMakeLists.txt +++ b/csrc/mmdeploy/apis/cxx/CMakeLists.txt @@ -3,27 +3,25 @@ cmake_minimum_required(VERSION 3.14) project(mmdeploy_cxx_api) -if (MMDEPLOY_BUILD_SDK_CXX_API) - add_library(${PROJECT_NAME} INTERFACE) - target_include_directories(${PROJECT_NAME} INTERFACE - $ - $) - target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17) - target_link_libraries(${PROJECT_NAME} INTERFACE mmdeploy::core) - set(_tasks ${MMDEPLOY_TASKS} pipeline) - foreach (task ${_tasks}) - target_link_libraries(mmdeploy_${task} INTERFACE ${PROJECT_NAME}) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mmdeploy/${task}.hpp - DESTINATION include/mmdeploy) - endforeach () - if (TARGET mmdeploy) - target_link_libraries(mmdeploy INTERFACE ${PROJECT_NAME}) - endif () - mmdeploy_export(${PROJECT_NAME}) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mmdeploy/common.hpp +add_library(${PROJECT_NAME} INTERFACE) +target_include_directories(${PROJECT_NAME} INTERFACE + $ + $) +target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17) +target_link_libraries(${PROJECT_NAME} INTERFACE mmdeploy::core) +set(_tasks ${MMDEPLOY_TASKS} pipeline) +foreach (task ${_tasks}) + target_link_libraries(mmdeploy_${task} INTERFACE ${PROJECT_NAME}) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mmdeploy/${task}.hpp DESTINATION include/mmdeploy) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/demo/csrc/ DESTINATION example/cpp - FILES_MATCHING - PATTERN "*.cxx" - ) +endforeach () +if (TARGET mmdeploy) + target_link_libraries(mmdeploy INTERFACE ${PROJECT_NAME}) endif () +mmdeploy_export(${PROJECT_NAME}) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mmdeploy/common.hpp + DESTINATION include/mmdeploy) +install(DIRECTORY ${CMAKE_SOURCE_DIR}/demo/csrc/ DESTINATION example/cpp + FILES_MATCHING + PATTERN "*.cxx" + ) diff --git a/csrc/mmdeploy/archive/CMakeLists.txt b/csrc/mmdeploy/archive/CMakeLists.txt index 21bb3ae59d..3f3d1f1104 100644 --- a/csrc/mmdeploy/archive/CMakeLists.txt +++ b/csrc/mmdeploy/archive/CMakeLists.txt @@ -6,10 +6,8 @@ add_library(${PROJECT_NAME} INTERFACE) target_link_libraries(${PROJECT_NAME} INTERFACE mmdeploy::core) add_library(mmdeploy::archive ALIAS mmdeploy_archive) -if (MMDEPLOY_BUILD_SDK_CXX_API) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/csrc/mmdeploy/archive - DESTINATION include/mmdeploy - FILES_MATCHING PATTERN "*.h") - install(FILES ${CMAKE_SOURCE_DIR}/third_party/json/json.hpp - DESTINATION include/mmdeploy/third_party/json) -endif () +install(DIRECTORY ${CMAKE_SOURCE_DIR}/csrc/mmdeploy/archive + DESTINATION include/mmdeploy + FILES_MATCHING PATTERN "*.h") +install(FILES ${CMAKE_SOURCE_DIR}/third_party/json/json.hpp + DESTINATION include/mmdeploy/third_party/json) diff --git a/csrc/mmdeploy/core/CMakeLists.txt b/csrc/mmdeploy/core/CMakeLists.txt index 33d0f76c57..25a12849f9 100644 --- a/csrc/mmdeploy/core/CMakeLists.txt +++ b/csrc/mmdeploy/core/CMakeLists.txt @@ -19,10 +19,9 @@ else () endif () set(SPDLOG_LIB spdlog::spdlog) mmdeploy_export(spdlog) - if (MMDEPLOY_BUILD_SDK_CXX_API) - install(DIRECTORY ${MMDEPLOY_SPDLOG_DIR}/include/spdlog - DESTINATION include/mmdeploy/third_party) - endif () + + install(DIRECTORY ${MMDEPLOY_SPDLOG_DIR}/include/spdlog + DESTINATION include/mmdeploy/third_party) endif () set(SRCS @@ -65,15 +64,13 @@ else () target_compile_definitions(${PROJECT_NAME} PUBLIC -DMMDEPLOY_STATUS_USE_SOURCE_LOCATION=1) endif () -if (MMDEPLOY_BUILD_SDK_CXX_API) - target_include_directories(${PROJECT_NAME} PUBLIC - $ - $ - $) - if (NOT MMDEPLOY_SPDLOG_EXTERNAL) - target_include_directories(spdlog INTERFACE - $) - endif () +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ + $) +if (NOT MMDEPLOY_SPDLOG_EXTERNAL) + target_include_directories(spdlog INTERFACE + $) endif () target_link_libraries(${PROJECT_NAME} PUBLIC ${SPDLOG_LIB}) @@ -85,14 +82,12 @@ endif () add_library(mmdeploy::core ALIAS ${PROJECT_NAME}) -if (MMDEPLOY_BUILD_SDK_CXX_API) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/csrc/mmdeploy/core - DESTINATION include/mmdeploy - FILES_MATCHING PATTERN "*.h") - install(FILES ${CMAKE_SOURCE_DIR}/third_party/outcome/outcome-experimental.hpp - DESTINATION include/mmdeploy/third_party/outcome) +install(DIRECTORY ${CMAKE_SOURCE_DIR}/csrc/mmdeploy/core + DESTINATION include/mmdeploy + FILES_MATCHING PATTERN "*.h") +install(FILES ${CMAKE_SOURCE_DIR}/third_party/outcome/outcome-experimental.hpp + DESTINATION include/mmdeploy/third_party/outcome) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/csrc/mmdeploy/experimental - DESTINATION include/mmdeploy - FILES_MATCHING PATTERN "*.h") -endif () +install(DIRECTORY ${CMAKE_SOURCE_DIR}/csrc/mmdeploy/experimental + DESTINATION include/mmdeploy + FILES_MATCHING PATTERN "*.h") diff --git a/demo/csrc/CMakeLists.txt b/demo/csrc/CMakeLists.txt index 8d25e43597..21c43d773e 100644 --- a/demo/csrc/CMakeLists.txt +++ b/demo/csrc/CMakeLists.txt @@ -42,16 +42,14 @@ add_example(video_recognizer c video_recognition) # TODO: figure out a better way # add_example("" c det_cls) -if (MMDEPLOY_BUILD_SDK_CXX_API) - add_example(classifier cpp classifier) - add_example(detector cpp detector) - add_example(segmentor cpp segmentor) - add_example(restorer cpp restorer) - add_example(text_detector cpp text_ocr) - add_example(text_detector cpp text_det_recog) - add_example(pose_detector cpp pose_detector) - add_example(rotated_detector cpp rotated_detector) - add_example(pose_tracker cpp pose_tracker) - add_example(pose_detector cpp det_pose) - add_example(video_recognizer cpp video_cls) -endif () +add_example(classifier cpp classifier) +add_example(detector cpp detector) +add_example(segmentor cpp segmentor) +add_example(restorer cpp restorer) +add_example(text_detector cpp text_ocr) +add_example(text_detector cpp text_det_recog) +add_example(pose_detector cpp pose_detector) +add_example(rotated_detector cpp rotated_detector) +add_example(pose_tracker cpp pose_tracker) +add_example(pose_detector cpp det_pose) +add_example(video_recognizer cpp video_cls) diff --git a/docs/en/01-how-to-build/cmake_option.md b/docs/en/01-how-to-build/cmake_option.md index 7e036aea54..4c1df728ad 100644 --- a/docs/en/01-how-to-build/cmake_option.md +++ b/docs/en/01-how-to-build/cmake_option.md @@ -43,12 +43,6 @@ OFF Switch to build MMDeploy SDK python package - - MMDEPLOY_BUILD_SDK_CXX_API - {ON, OFF} - OFF - Build C++ SDK API - MMDEPLOY_BUILD_SDK_CSHARP_API @@ -119,9 +113,9 @@
-DInferenceEngine_DIR=${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/share
6. torchscript: TorchScript. Torch_DIR is needed.
-DTorch_DIR=${Torch_DIR}
-Currently, The Model Converter supports torchscript, but SDK doesn't.
7. snpe: qcom snpe. SNPE_ROOT must existed in the environment variable because of C/S mode.
- 8. coreml: CoreML. Torch_DIR is required. Torch_DIR
+ 8. coreml: CoreML. Torch_DIR is required. +
-DTorch_DIR=${Torch_DIR}
9. TVM: TVM. TVM_DIR is required.
-DTVM_DIR=${TVM_DIR}
diff --git a/docs/zh_cn/01-how-to-build/cmake_option.md b/docs/zh_cn/01-how-to-build/cmake_option.md index eae4d8926b..64fc85c4d6 100644 --- a/docs/zh_cn/01-how-to-build/cmake_option.md +++ b/docs/zh_cn/01-how-to-build/cmake_option.md @@ -46,13 +46,6 @@ SDK python package的编译开关 - - MMDEPLOY_BUILD_SDK_CXX_API - {ON, OFF} - OFF - SDK C++ package的编译开关 - - MMDEPLOY_BUILD_SDK_CSHARP_API {ON, OFF} @@ -118,7 +111,7 @@ 3. pplnn: 表示 PPL.NN。需要设置 pplnn_DIR
4. ncnn:表示 ncnn。需要设置 ncnn_DIR
5. openvino: 表示 OpenVINO。需要设置 InferenceEngine_DIR
- 6. torchscript: 表示 TorchScript。目前仅模型转换支持 torchscript 格式,SDK 尚未支持。
+ 6. torchscript: 表示 TorchScript。需要设置Torch_DIR
7. snpe: 表示 qcom snpe。需要环境变量设置 SNPE_ROOT。
8. coreml: 表示 Core ML。目前在进行模型转换时需要设置 Torch_DIR
9. tvm: 表示 TVM。需要设置 TVM_DIR
diff --git a/docs/zh_cn/01-how-to-build/rockchip.md b/docs/zh_cn/01-how-to-build/rockchip.md index 404c765e2b..13d8b10e14 100644 --- a/docs/zh_cn/01-how-to-build/rockchip.md +++ b/docs/zh_cn/01-how-to-build/rockchip.md @@ -256,7 +256,6 @@ mkdir -p build && cd build cmake .. \ -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/arm-linux-gnueabihf.cmake \ -DMMDEPLOY_BUILD_SDK=ON \ --DMMDEPLOY_BUILD_SDK_CXX_API=ON \ -DMMDEPLOY_BUILD_EXAMPLES=ON \ -DMMDEPLOY_TARGET_BACKENDS="rknn" \ -DRKNPU_DEVICE_DIR=${RKNPU_DIR}/rknn/rknn_api/librknn_api \ @@ -303,7 +302,6 @@ export LD_LIBRARY_PATH=$RKNN_TOOL_CHAIN/lib64:$LD_LIBRARY_PATH cmake \ -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/rknpu2-linux-gnu.cmake \ -DMMDEPLOY_BUILD_SDK=ON \ - -DMMDEPLOY_BUILD_SDK_CXX_API=ON \ -DMMDEPLOY_TARGET_BACKENDS="rknn" \ -DMMDEPLOY_BUILD_EXAMPLES=ON \ -DOpenCV_DIR=${OpenCV_AARCH64_INSTALL_DIR}/lib/cmake/opencv4 diff --git a/tools/package_tools/configs/linux_x64.yaml b/tools/package_tools/configs/linux_x64.yaml index f0e3b07310..f16ec644bb 100644 --- a/tools/package_tools/configs/linux_x64.yaml +++ b/tools/package_tools/configs/linux_x64.yaml @@ -3,7 +3,6 @@ global_config: CMAKE_CXX_COMPILER: "g++-7" MMDEPLOY_BUILD_SDK: "ON" MMDEPLOY_BUILD_SDK_MONOLITHIC: "ON" - MMDEPLOY_BUILD_SDK_CXX_API: "ON" MMDEPLOY_BUILD_EXAMPLES: "ON" MMDEPLOY_SHARED_LIBS: "OFF" OpenCV_DIR: "${OpenCV_DIR}" diff --git a/tools/package_tools/configs/windows_x64.yaml b/tools/package_tools/configs/windows_x64.yaml index c104a8c788..3950f18447 100644 --- a/tools/package_tools/configs/windows_x64.yaml +++ b/tools/package_tools/configs/windows_x64.yaml @@ -3,7 +3,6 @@ global_config: cmake_envs: MMDEPLOY_BUILD_SDK: "ON" MMDEPLOY_BUILD_SDK_MONOLITHIC: "ON" - MMDEPLOY_BUILD_SDK_CXX_API: "ON" MMDEPLOY_BUILD_EXAMPLES: "ON" MMDEPLOY_SHARED_LIBS: "OFF" MMDEPLOY_CODEBASES: "all" diff --git a/tools/scripts/ubuntu_cross_build_rknn.sh b/tools/scripts/ubuntu_cross_build_rknn.sh index f3f3f5501f..b9db841776 100644 --- a/tools/scripts/ubuntu_cross_build_rknn.sh +++ b/tools/scripts/ubuntu_cross_build_rknn.sh @@ -99,7 +99,6 @@ build_mmdeploy_with_rknpu() { cmake .. \ -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/arm-linux-gnueabihf.cmake \ -DMMDEPLOY_BUILD_SDK=ON \ - -DMMDEPLOY_BUILD_SDK_CXX_API=ON \ -DMMDEPLOY_BUILD_EXAMPLES=ON \ -DMMDEPLOY_TARGET_BACKENDS="rknn" \ -DRKNPU_DEVICE_DIR="${RKNPU_DIR}"/rknn/rknn_api/librknn_api \ @@ -125,7 +124,6 @@ build_mmdeploy_with_rknpu2() { cmake .. \ -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/rknpu2-linux-gnu.cmake \ -DMMDEPLOY_BUILD_SDK=ON \ - -DMMDEPLOY_BUILD_SDK_CXX_API=ON \ -DMMDEPLOY_BUILD_EXAMPLES=ON \ -DMMDEPLOY_TARGET_BACKENDS="rknn" \ -DRKNPU2_DEVICE_DIR="${RKNPU2_DIR}/runtime/${device_model}" \