[Paddle2ONNX] switch paddle2onnx default policy (#1873)

This commit is contained in:
DefTruth
2023-04-26 10:32:18 +08:00
committed by GitHub
parent 597fe57f28
commit ef576ce875
3 changed files with 8 additions and 4 deletions

View File

@@ -77,8 +77,8 @@ option(WITH_TESTING "Whether to compile with unittest." OFF)
option(WITH_CAPI "Whether to compile with c api." OFF)
option(WITH_CSHARPAPI "Whether to compile with c# api" OFF)
# Whether to build fastdeploy with vision/text/... examples, only for testings.
option(BUILD_EXAMPLES "Whether to build fastdeploy with vision examples" OFF)
option(BUILD_PADDLE2ONNX "Whether to build paddle2onnx from sources" OFF)
######################### Paths to user's custom libraries directory #####################
set(CUDA_DIRECTORY "" CACHE PATH "If build tensorrt backend, need to define path of cuda library.")
@@ -425,7 +425,6 @@ if(ENABLE_ENCRYPTION)
endif()
if(ENABLE_PADDLE2ONNX)
set(BUILD_PADDLE2ONNX ON)
add_definitions(-DENABLE_PADDLE2ONNX)
if(BUILD_PADDLE2ONNX)
download_protobuf()

View File

@@ -77,7 +77,12 @@ else()
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64")
set(ONNXRUNTIME_FILENAME "onnxruntime-linux-aarch64-${ONNXRUNTIME_VERSION}.tgz")
else()
set(ONNXRUNTIME_FILENAME "onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz")
# cross-compling while the host is x64 but the target is aarch64.
if ((CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") OR (CMAKE_SYSTEM_PROCESSOR MATCHES "arm"))
set(ONNXRUNTIME_FILENAME "onnxruntime-linux-aarch64-${ONNXRUNTIME_VERSION}.tgz")
else()
set(ONNXRUNTIME_FILENAME "onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz")
endif()
endif()
endif()
endif()

View File

@@ -41,6 +41,6 @@ if (DEFINED TARGET_ABI)
set(OpenCV_DIR ${THIRD_PARTY_PATH}/install/opencv/lib/cmake/opencv4)
else()
message(FATAL_ERROR "When cross-compiling, please set the -DTARGET_ABI to arm64 or armhf.")
endif()
endif()
endif()