Show libxgboost.so path in build info. (#7893)
This commit is contained in:
parent
9fa7ed1743
commit
c8f9d4b6e6
@ -156,6 +156,7 @@ def _load_lib() -> ctypes.CDLL:
|
|||||||
os.environ['PATH'] = os.pathsep.join(
|
os.environ['PATH'] = os.pathsep.join(
|
||||||
pathBackup + [os.path.dirname(lib_path)])
|
pathBackup + [os.path.dirname(lib_path)])
|
||||||
lib = ctypes.cdll.LoadLibrary(lib_path)
|
lib = ctypes.cdll.LoadLibrary(lib_path)
|
||||||
|
setattr(lib, "path", os.path.normpath(lib_path))
|
||||||
lib_success = True
|
lib_success = True
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
os_error_list.append(str(e))
|
os_error_list.append(str(e))
|
||||||
@ -233,6 +234,7 @@ def build_info() -> dict:
|
|||||||
_check_call(_LIB.XGBuildInfo(ctypes.byref(j_info)))
|
_check_call(_LIB.XGBuildInfo(ctypes.byref(j_info)))
|
||||||
assert j_info.value is not None
|
assert j_info.value is not None
|
||||||
res = json.loads(j_info.value.decode()) # pylint: disable=no-member
|
res = json.loads(j_info.value.decode()) # pylint: disable=no-member
|
||||||
|
res["libxgboost"] = _LIB.path
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user