未验证 提交 b796d8fa 编写于 作者: L Leo Chen 提交者: GitHub

make preloading ligbomp more robust, test=develop (#25527)

add try..catch...
上级 7129f544
......@@ -169,13 +169,13 @@ def run_shell_command(cmd):
if err:
return None
else:
return out.decode('utf-8')
return out.decode('utf-8').strip()
def get_dso_path(core_so, dso_name):
if core_so and dso_name:
return run_shell_command("ldd %s|grep %s|awk '{print $3}'" %
(core_so, dso_name)).strip()
(core_so, dso_name))
else:
return None
......@@ -225,7 +225,11 @@ def less_than_ver(a, b):
# The final solution is to upgrade glibc to > 2.22 on the target system.
if platform.system().lower() == 'linux' and less_than_ver(get_glibc_ver(),
'2.23'):
try:
pre_load('libgomp')
except Exception as e:
# NOTE(zhiqiu): do not abort if failed, since it may success when import core_avx.so
sys.stderr.write('Error: Can not preload libgomp.so')
load_noavx = False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册