-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 2.0.3 #132
Release 2.0.3 #132
Changes from 22 commits
5e56170
d3a4e7d
db22c6d
c08fa24
9aac38e
54002ca
4e87a9c
f4a3fd8
fd527a0
5231c77
edfa0a0
b22e7fe
1fde14d
5bb90d7
2119d42
73df4d7
2e1bd05
f4b5ff8
7e58b72
f333e39
18b91f1
41ce4b0
666b193
77ec806
b485d49
aa7dcbd
8662cf0
f6e6f51
26f4a64
b13a492
1d0feb7
e6898fd
217f95a
475df3e
2cb581d
c34adcd
e136765
b701569
7df7e4c
5b4a06b
da913e7
48d5896
990c1d0
7a1d17f
33f3848
2c413b2
228755e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
From 2cdc7f71d586cbb15322b81c17b98cf99cc98bbe Mon Sep 17 00:00:00 2001 | ||
From: Hyunsu Cho <chohyu01@cs.washington.edu> | ||
Date: Thu, 19 Oct 2023 18:35:01 -0700 | ||
Subject: [PATCH] Fix libpath logic for Windows | ||
|
||
--- | ||
python-package/packager/nativelib.py | 32 +++++++++++++++++++--------- | ||
python-package/xgboost/libpath.py | 19 ++++++++--------- | ||
2 files changed, 31 insertions(+), 20 deletions(-) | ||
|
||
diff --git a/python-package/packager/nativelib.py b/python-package/packager/nativelib.py | ||
index ff38fa11..164bd09e 100644 | ||
--- a/python-package/packager/nativelib.py | ||
+++ b/python-package/packager/nativelib.py | ||
@@ -132,16 +132,28 @@ def locate_or_build_libxgboost( | ||
|
||
if build_config.use_system_libxgboost: | ||
# Find libxgboost from system prefix | ||
- sys_base_prefix = pathlib.Path(sys.base_prefix).absolute().resolve() | ||
- libxgboost_sys = sys_base_prefix / "lib" / _lib_name() | ||
- if not libxgboost_sys.exists(): | ||
- raise RuntimeError( | ||
- f"use_system_libxgboost was specified but {_lib_name()} is " | ||
- f"not found in {libxgboost_sys.parent}" | ||
- ) | ||
- | ||
- logger.info("Using system XGBoost: %s", str(libxgboost_sys)) | ||
- return libxgboost_sys | ||
+ sys_prefix = pathlib.Path(sys.prefix) | ||
+ sys_prefix_candidates = [ | ||
+ sys_prefix / "lib", | ||
+ # Paths possibly used on Windows | ||
+ sys_prefix / "bin", | ||
+ sys_prefix / "Library", | ||
+ sys_prefix / "Library" / "bin", | ||
+ sys_prefix / "Library" / "lib", | ||
+ ] | ||
+ sys_prefix_candidates = [ | ||
+ p.expanduser().resolve() for p in sys_prefix_candidates | ||
+ ] | ||
+ for candidate_dir in sys_prefix_candidates: | ||
+ libtreelite_sys = candidate_dir / _lib_name() | ||
+ if libtreelite_sys.exists(): | ||
+ logger.info("Using system XGBoost: %s", str(libtreelite_sys)) | ||
+ return libtreelite_sys | ||
+ raise RuntimeError( | ||
+ f"use_system_libxgboost was specified but {_lib_name()} is " | ||
+ f"not found. Paths searched (in order): \n" | ||
+ + "\n".join([f"* {str(p)}" for p in sys_prefix_candidates]) | ||
+ ) | ||
|
||
libxgboost = locate_local_libxgboost(toplevel_dir, logger=logger) | ||
if libxgboost is not None: | ||
diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py | ||
index 0437f3a4..36a92cbc 100644 | ||
--- a/python-package/xgboost/libpath.py | ||
+++ b/python-package/xgboost/libpath.py | ||
@@ -31,16 +31,15 @@ def find_lib_path() -> List[str]: | ||
] | ||
|
||
if sys.platform == "win32": | ||
- if platform.architecture()[0] == "64bit": | ||
- dll_path.append(os.path.join(curr_path, "../../windows/x64/Release/")) | ||
- # hack for pip installation when copy all parent source | ||
- # directory here | ||
- dll_path.append(os.path.join(curr_path, "./windows/x64/Release/")) | ||
- else: | ||
- dll_path.append(os.path.join(curr_path, "../../windows/Release/")) | ||
- # hack for pip installation when copy all parent source | ||
- # directory here | ||
- dll_path.append(os.path.join(curr_path, "./windows/Release/")) | ||
+ # On Windows, Conda may install libs in different paths | ||
+ dll_path.extend( | ||
+ [ | ||
+ os.path.join(sys.prefix, "bin"), | ||
+ os.path.join(sys.prefix, "Library"), | ||
+ os.path.join(sys.prefix, "Library", "bin"), | ||
+ os.path.join(sys.prefix, "Library", "lib"), | ||
+ ] | ||
+ ) | ||
dll_path = [os.path.join(p, "xgboost.dll") for p in dll_path] | ||
elif sys.platform.startswith(("linux", "freebsd", "emscripten")): | ||
dll_path = [os.path.join(p, "libxgboost.so") for p in dll_path] | ||
-- | ||
2.25.1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch will be part of the upcoming patch release 2.0.1 of XGBoost.