From c8f9d4b6e66bb45f2472773586d7ba8b453f5b23 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Fri, 13 May 2022 18:08:56 +0800 Subject: [PATCH] Show libxgboost.so path in build info. (#7893) --- python-package/xgboost/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index 0a84feb96..a94c9d767 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -156,6 +156,7 @@ def _load_lib() -> ctypes.CDLL: os.environ['PATH'] = os.pathsep.join( pathBackup + [os.path.dirname(lib_path)]) lib = ctypes.cdll.LoadLibrary(lib_path) + setattr(lib, "path", os.path.normpath(lib_path)) lib_success = True except OSError as e: os_error_list.append(str(e)) @@ -233,6 +234,7 @@ def build_info() -> dict: _check_call(_LIB.XGBuildInfo(ctypes.byref(j_info))) assert j_info.value is not None res = json.loads(j_info.value.decode()) # pylint: disable=no-member + res["libxgboost"] = _LIB.path return res