Skip to content

Commit 89704d9

Browse files
authored
Merge pull request #12000 from luotao1/mklml_rpath
check return value of patchelf in setup.py.in
2 parents d3a4848 + bc16b22 commit 89704d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/setup.py.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ if '${WITH_MKLDNN}' == 'ON':
130130
# The reason is that all thirdparty libraries in the same directory,
131131
# thus, libmkldnn.so.0 will find libmklml_intel.so and libiomp5.so.
132132
command = "patchelf --set-rpath '$ORIGIN/' ${MKLDNN_SHARED_LIB}"
133-
os.system(command)
133+
if os.system(command) != 0:
134+
raise Exception("patchelf --set-rpath for libmkldnn.so.0 fails")
134135
package_data['paddle.libs']+=['libmkldnn.so.0']
135136
shutil.copy('${MKLDNN_SHARED_LIB}', libs_path)
136137
# remove unused paddle/libs/__init__.py
@@ -142,7 +143,8 @@ package_dir['paddle.libs']=libs_path
142143
# core.so is in paddle.fluid, thus paddle/fluid/../libs will pointer to above libraries.
143144
# This operation will fix https://github.com/PaddlePaddle/Paddle/issues/3213
144145
command = "patchelf --set-rpath '$ORIGIN/../libs/' ${PADDLE_BINARY_DIR}/python/paddle/fluid/core.so"
145-
os.system(command)
146+
if os.system(command) != 0:
147+
raise Exception("patchelf --set-rpath for core.so fails")
146148

147149
setup(name='${PACKAGE_NAME}',
148150
version='${PADDLE_VERSION}',

0 commit comments

Comments
 (0)