py-xgboost: add lib64 (#46926)

This commit is contained in:
Joseph Wang 2024-10-12 05:55:03 +08:00 committed by GitHub
parent 386d115333
commit 93f356c1cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,24 @@
diff --git a/packager/nativelib.py b/packager/nativelib.py
index 1a3df2e..24ba471 100644
--- a/packager/nativelib.py
+++ b/packager/nativelib.py
@@ -133,6 +133,7 @@ def locate_or_build_libxgboost(
sys_prefix = pathlib.Path(sys.base_prefix)
sys_prefix_candidates = [
sys_prefix / "lib",
+ sys_prefix / "lib64",
# Paths possibly used on Windows
sys_prefix / "bin",
sys_prefix / "Library",
diff --git a/xgboost/libpath.py b/xgboost/libpath.py
index 92d46a0..2007579 100644
--- a/xgboost/libpath.py
+++ b/xgboost/libpath.py
@@ -28,6 +28,7 @@ def find_lib_path() -> List[str]:
# use libxgboost from a system prefix, if available. This should be the last
# option.
os.path.join(sys.base_prefix, "lib"),
+ os.path.join(sys.base_prefix, "lib64"),
]
if sys.platform == "win32":

View File

@ -33,6 +33,7 @@ class PyXgboost(PythonPackage):
)
variant("dask", default=False, description="Enables Dask extensions for distributed training.")
variant("plotting", default=False, description="Enables tree and importance plotting.")
patch("add-lib64.patch", when="@2:")
for ver in ["1.3.3", "1.5.2", "1.6.1", "1.6.2", "1.7.6", "2.1.0", "2.1.1"]:
depends_on("xgboost@" + ver, when="@" + ver)