[cmake] update paddle inference osx lib (#1859)

* [cmake] update paddle inference osx lib

* Update __init__.py

* Update __init__.py

* Update paddle_inference.cmake

* Update __init__.py
This commit is contained in:
DefTruth
2023-04-24 14:13:15 +08:00
committed by GitHub
parent 652024d2f6
commit 6e5f5f6802
2 changed files with 14 additions and 4 deletions

View File

@@ -99,12 +99,13 @@ else()
elseif(APPLE) elseif(APPLE)
if(CURRENT_OSX_ARCH MATCHES "arm64") if(CURRENT_OSX_ARCH MATCHES "arm64")
message(FATAL_ERROR "Paddle Backend doesn't support Mac OSX with Arm64 now.") message(FATAL_ERROR "Paddle Backend doesn't support Mac OSX with Arm64 now.")
set(PADDLEINFERENCE_FILE "paddle_inference-osx-arm64-openblas-0.0.0.660f781b77.tgz")
else() else()
# TODO(qiuyanjun): Should remove this old paddle inference lib # TODO(qiuyanjun): Should remove this old paddle inference lib
set(PADDLEINFERENCE_FILE "paddle_inference-osx-x86_64-2.4-dev3.tgz") # set(PADDLEINFERENCE_FILE "paddle_inference-osx-x86_64-2.4-dev3.tgz")
# TODO(qiuyanjun): Should use the commit id to tag the version set(PADDLEINFERENCE_FILE "paddle_inference-osx-x86_64-openblas-0.0.0.660f781b77.tgz")
set(PADDLEINFERENCE_VERSION "2.4-dev3")
endif() endif()
set(PADDLEINFERENCE_VERSION "0.0.0.660f781b77")
else() else()
# Linux with x86 CPU/Arm CPU/GPU/IPU ... # Linux with x86 CPU/Arm CPU/GPU/IPU ...
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64") if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64")

View File

@@ -46,7 +46,16 @@ if os.name != "nt" and os.path.exists(trt_directory):
# This solution will be removed it when the confilct of paddle and # This solution will be removed it when the confilct of paddle and
# fastdeploy is fixed. # fastdeploy is fixed.
try: try:
import paddle # import paddle
import platform
sys_platform = platform.platform().lower()
# windows: no conflict between fastdeploy and paddle.
# linux: must import paddle first to solve the conflict.
# macos: still can not solve the conflict between fastdeploy and paddle,
# due to the global flags redefined in paddle/paddle_inference so.
# we got the error (ERROR: flag 'xxx' was defined more than once).
if "linux" in sys_platform:
import paddle
except: except:
pass pass