From 6ce8921bed17d82e28678fa36d93b7cc132ca53d Mon Sep 17 00:00:00 2001 From: zhupengyang Date: Wed, 6 May 2020 17:22:38 +0800 Subject: [PATCH] fix python whl of armlinux (#3546) (#3547) --- lite/api/python/setup.py.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lite/api/python/setup.py.in b/lite/api/python/setup.py.in index 884266a12d..596369f299 100644 --- a/lite/api/python/setup.py.in +++ b/lite/api/python/setup.py.in @@ -33,11 +33,17 @@ else: PADDLELITE_VERSION = PADDLELITE_TAG # core lib of paddlelite is stored as lite.so -LITE_PATH = '${PADDLE_BINARY_DIR}/inference_lite_lib/python/install/lite' +files = os.listdir('${PADDLE_BINARY_DIR}') +INFERENCE_LITE_LIB_PATH = '' +for file in files: + if file.find('inference_lite_lib') == 0: + INFERENCE_LITE_LIB_PATH = '${PADDLE_BINARY_DIR}/' + file + break +LITE_PATH = INFERENCE_LITE_LIB_PATH + '/python/install/lite' PACKAGE_DATA = {'paddlelite': ['lite.so' if os.name!='nt' else 'lite.pyd']} # put all thirdparty libraries in paddlelite.libs PACKAGE_DATA['paddlelite.libs'] = [] -LIB_PATH = '${PADDLE_BINARY_DIR}/inference_lite_lib/python/install/libs' +LIB_PATH = INFERENCE_LITE_LIB_PATH + '/python/install/libs/' if '${WITH_MKL}' == 'ON': shutil.copy('${MKLML_SHARED_IOMP_LIB}', LIB_PATH) shutil.copy('${MKLML_SHARED_LIB}', LIB_PATH) @@ -49,8 +55,7 @@ if '${WITH_MKL}' == 'ON': PACKAGE_DATA['paddlelite.libs'] += ['msvcr120.dll'] # link lite.so to paddlelite.libs if os.name != 'nt': - COMMAND = "patchelf --set-rpath '$ORIGIN/../libs/' ${PADDLE_BINARY_DIR}\ -/inference_lite_lib/python/install/lite/lite.so" + COMMAND = "patchelf --set-rpath '$ORIGIN/../libs/' " + LITE_PATH + "/lite.so" if os.system(COMMAND) != 0: raise Exception("patch third_party libs failed, command: %s" % COMMAND) -- GitLab