From 3192b172137815245881e8a0c7c2d9f3f106938b Mon Sep 17 00:00:00 2001 From: Siddesh-Sangodkar1 Date: Wed, 2 Sep 2026 20:30:23 +0530 Subject: [PATCH 1/8] Added xgboost-cpu 3.4.1 --- x/xgboost-cpu/LICENSE | 201 ++++++++++++++++++++ x/xgboost-cpu/build_info.json | 19 ++ x/xgboost-cpu/xgboost-cpu_3.4.1_ubi_10.2.sh | 150 +++++++++++++++ 3 files changed, 370 insertions(+) create mode 100644 x/xgboost-cpu/LICENSE create mode 100644 x/xgboost-cpu/build_info.json create mode 100644 x/xgboost-cpu/xgboost-cpu_3.4.1_ubi_10.2.sh diff --git a/x/xgboost-cpu/LICENSE b/x/xgboost-cpu/LICENSE new file mode 100644 index 0000000000..90c0ff9368 --- /dev/null +++ b/x/xgboost-cpu/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2019 by Contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/x/xgboost-cpu/build_info.json b/x/xgboost-cpu/build_info.json new file mode 100644 index 0000000000..5d84927d02 --- /dev/null +++ b/x/xgboost-cpu/build_info.json @@ -0,0 +1,19 @@ +{ + "maintainer": "Siddesh-Sangodkar1", + "package_name": "xgboost-cpu", + "github_url": "https://github.com/dmlc/xgboost", + "version": "3.4.1", + "default_branch": "master", + "package_dir": "x/xgboost-cpu", + "build_script": "xgboost-cpu_3.4.1_ubi_10.2.sh", + "docker_build": false, + "validate_build_script": true, + "use_non_root_user": false, + "wheel_build": true, + "3.4.1": { + "build_script": "xgboost-cpu_3.4.1_ubi_10.2.sh" + }, + "*": { + "build_script": "xgboost-cpu_3.4.1_ubi_10.2.sh" + } +} diff --git a/x/xgboost-cpu/xgboost-cpu_3.4.1_ubi_10.2.sh b/x/xgboost-cpu/xgboost-cpu_3.4.1_ubi_10.2.sh new file mode 100644 index 0000000000..e529974f2d --- /dev/null +++ b/x/xgboost-cpu/xgboost-cpu_3.4.1_ubi_10.2.sh @@ -0,0 +1,150 @@ +#!/bin/bash -e +# ----------------------------------------------------------------------------- +# +# Package : xgboost-cpu +# Version : 3.4.1 +# Source repo : https://github.com/dmlc/xgboost +# Tested on : UBI:10.2 +# Language : Python +# Ci-Check : True +# Script License : Apache License, Version 2 or later +# Maintainer : Siddesh Sangodkar +# +# Disclaimer: This script has been tested in root mode on given +# ========== platform using the mentioned version of the package. +# It may not work as expected with newer versions of the +# package and/or distribution. In such case, please +# contact "Maintainer" of this script. +# +# Note: xgboost-cpu is the CPU-only variant of XGBoost (USE_CUDA=OFF). +# It is built from the PyPI source distribution (sdist) which +# includes the C++ tree under cpp_src/ and uses scikit-build-core +# as the PEP 517 backend (CMake + Ninja internally). +# python3.14 requires scikit-build-core >=0.11.0 which is fetched +# at build time by pip via the build isolation requirements. +# +# ----------------------------------------------------------------------------- + +set -e + +PACKAGE_NAME=xgboost-cpu +PACKAGE_VERSION=${1:-3.4.1} +PACKAGE_URL=https://github.com/dmlc/xgboost +CURRENT_DIR=$(pwd) +WHEEL_DIR="${CURRENT_DIR}/wheels" +mkdir -p "${WHEEL_DIR}" + +# --------------------------------------------------------------------------- +# System dependencies +# --------------------------------------------------------------------------- +yum install -y python3.14 python3.14-devel python3.14-pip \ + git gcc-toolset-15 gcc-toolset-15-gcc gcc-toolset-15-gcc-c++ \ + cmake ninja-build make \ + openssl-devel libffi-devel zlib-devel \ + which curl tar + +# UBI 10 dropped SCL — guard block +if [[ -f /opt/rh/gcc-toolset-15/enable ]]; then + source /opt/rh/gcc-toolset-15/enable +elif [[ -d /opt/rh/gcc-toolset-15/root/usr/bin ]]; then + export PATH="/opt/rh/gcc-toolset-15/root/usr/bin:$PATH" + export LD_LIBRARY_PATH="/opt/rh/gcc-toolset-15/root/usr/lib64:$LD_LIBRARY_PATH" +else + echo "ERROR: gcc-toolset-15 not found" + exit 1 +fi + +echo "Using gcc: $(gcc --version | head -1)" +echo "Using cmake: $(cmake --version | head -1)" +echo "Using python: $(python3.14 --version)" + +# --------------------------------------------------------------------------- +# Python build tools +# --------------------------------------------------------------------------- +python3.14 -m pip install --upgrade pip setuptools wheel build +python3.14 -m pip install "scikit-build-core>=0.11.0" cmake ninja + +# --------------------------------------------------------------------------- +# Download xgboost-cpu source distribution from PyPI +# The sdist bundles the C++ tree under cpp_src/ — no git submodule needed. +# --------------------------------------------------------------------------- +SDIST_URL="https://files.pythonhosted.org/packages/99/98/c35e165aff81e43b43411662219764abbd246adae2547d360b23194cf75f/xgboost_cpu-${PACKAGE_VERSION}.tar.gz" + +cd "${CURRENT_DIR}" +curl -sSL --fail -o "xgboost_cpu-${PACKAGE_VERSION}.tar.gz" "${SDIST_URL}" +tar -xzf "xgboost_cpu-${PACKAGE_VERSION}.tar.gz" +cd "xgboost_cpu-${PACKAGE_VERSION}" + +# --------------------------------------------------------------------------- +# Build the wheel via scikit-build-core (CMake + Ninja, CPU-only) +# USE_CUDA=OFF is the default; USE_OPENMP=ON for multi-core ppc64le perf. +# --------------------------------------------------------------------------- +export CMAKE_ARGS="-DUSE_CUDA=OFF -DUSE_OPENMP=ON -DUSE_NCCL=OFF" + +if ! python3.14 -m build --wheel --no-isolation --outdir="${WHEEL_DIR}"; then + echo "------------------$PACKAGE_NAME:Build_fails-------------------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Build_Fails" + exit 1 +fi + +# Copy wheel to CURRENT_DIR for create_wheel_wrapper.sh compatibility +cp "${WHEEL_DIR}"/*.whl "${CURRENT_DIR}/" 2>/dev/null || true + +# --------------------------------------------------------------------------- +# Install wheel dependencies and the wheel itself +# Pip 26+ blocks file:// URIs to non-localhost paths; downgrade to pip 25 +# (last version without this restriction) before the local wheel install. +# --------------------------------------------------------------------------- +IBM_WHEELS="https://wheels.developerfirst.ibm.com/ppc64le/linux/+simple/" +python3.14 -m pip install \ + --trusted-host wheels.developerfirst.ibm.com \ + --extra-index-url "${IBM_WHEELS}" \ + --prefer-binary \ + "numpy==2.5.1" scipy + +# Install the wheel using python -m installer (bypasses pip's URL checks) +WHL=$(ls "${WHEEL_DIR}"/xgboost_cpu-*.whl | head -1) +python3.14 -m pip install installer +python3.14 -m installer "${WHL}" + +# Return to a neutral directory so Python doesn't pick up the source tree +cd "${CURRENT_DIR}" + +if ! python3.14 - <<'PYEOF' +import sys +import xgboost as xgb +import numpy as np + +print(f"xgboost version: {xgb.__version__}") + +# Basic DMatrix and training smoke test +X = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]) +y = np.array([0, 1, 0, 1]) +dtrain = xgb.DMatrix(X, label=y) + +params = { + "max_depth": 2, + "eta": 0.3, + "objective": "binary:logistic", + "device": "cpu", +} +bst = xgb.train(params, dtrain, num_boost_round=3) +preds = bst.predict(dtrain) +assert len(preds) == 4, f"Expected 4 predictions, got {len(preds)}" +print(f"Predictions: {preds}") +print("PASS xgboost basic train/predict") +print("All tests passed.") +sys.exit(0) +PYEOF +then + echo "------------------$PACKAGE_NAME:Install_success_but_test_fails---------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_success_but_test_Fails" + exit 2 +else + echo "------------------$PACKAGE_NAME:Install_&_test_both_success-------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Pass | Both_Install_and_Test_Success" + exit 0 +fi From 7dc20cdfdaace9d177b2d387985c0d206126544c Mon Sep 17 00:00:00 2001 From: Siddesh-Sangodkar1 Date: Thu, 3 Sep 2026 17:57:41 +0530 Subject: [PATCH 2/8] move script to xgboost directory --- x/xgboost-cpu/LICENSE | 201 ------------------ x/xgboost-cpu/build_info.json | 19 -- x/xgboost/build_info.json | 5 +- .../xgboost-cpu_3.4.1_ubi_10.2.sh | 0 4 files changed, 4 insertions(+), 221 deletions(-) delete mode 100644 x/xgboost-cpu/LICENSE delete mode 100644 x/xgboost-cpu/build_info.json rename x/{xgboost-cpu => xgboost}/xgboost-cpu_3.4.1_ubi_10.2.sh (100%) diff --git a/x/xgboost-cpu/LICENSE b/x/xgboost-cpu/LICENSE deleted file mode 100644 index 90c0ff9368..0000000000 --- a/x/xgboost-cpu/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright (c) 2019 by Contributors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/x/xgboost-cpu/build_info.json b/x/xgboost-cpu/build_info.json deleted file mode 100644 index 5d84927d02..0000000000 --- a/x/xgboost-cpu/build_info.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "maintainer": "Siddesh-Sangodkar1", - "package_name": "xgboost-cpu", - "github_url": "https://github.com/dmlc/xgboost", - "version": "3.4.1", - "default_branch": "master", - "package_dir": "x/xgboost-cpu", - "build_script": "xgboost-cpu_3.4.1_ubi_10.2.sh", - "docker_build": false, - "validate_build_script": true, - "use_non_root_user": false, - "wheel_build": true, - "3.4.1": { - "build_script": "xgboost-cpu_3.4.1_ubi_10.2.sh" - }, - "*": { - "build_script": "xgboost-cpu_3.4.1_ubi_10.2.sh" - } -} diff --git a/x/xgboost/build_info.json b/x/xgboost/build_info.json index 27ec0d4f89..d405481241 100644 --- a/x/xgboost/build_info.json +++ b/x/xgboost/build_info.json @@ -14,7 +14,10 @@ "v1.6.2": { "build_script": "xgboost_ubi_9.3.sh" }, + "3.4.1": { + "build_script": "xgboost-cpu_3.4.1_ubi_10.2.sh" + }, "*": { "build_script": "xgboost_3.0.1_ubi_9.3.sh" - } + } } diff --git a/x/xgboost-cpu/xgboost-cpu_3.4.1_ubi_10.2.sh b/x/xgboost/xgboost-cpu_3.4.1_ubi_10.2.sh similarity index 100% rename from x/xgboost-cpu/xgboost-cpu_3.4.1_ubi_10.2.sh rename to x/xgboost/xgboost-cpu_3.4.1_ubi_10.2.sh From e39888c32baef021937a9fc1deb5e6257c2a7400 Mon Sep 17 00:00:00 2001 From: Siddesh Sangodkar Date: Fri, 4 Sep 2026 10:53:52 +0530 Subject: [PATCH 3/8] Update build_info.json to remove old build script Removed deprecated build script entry for version 3.0.1. --- x/xgboost/build_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/xgboost/build_info.json b/x/xgboost/build_info.json index d405481241..4452cc9084 100644 --- a/x/xgboost/build_info.json +++ b/x/xgboost/build_info.json @@ -14,10 +14,10 @@ "v1.6.2": { "build_script": "xgboost_ubi_9.3.sh" }, + "v3.0.1": { + "build_script": "xgboost_3.0.1_ubi_9.3.sh" + }, "3.4.1": { "build_script": "xgboost-cpu_3.4.1_ubi_10.2.sh" - }, - "*": { - "build_script": "xgboost_3.0.1_ubi_9.3.sh" - } + }, } From 251e74963cf14957559adc5e3b264ade4e49bcab Mon Sep 17 00:00:00 2001 From: Siddesh-Sangodkar1 Date: Wed, 9 Sep 2026 19:58:11 +0530 Subject: [PATCH 4/8] Added suggested changes --- x/xgboost/xgboost-cpu_3.4.1_ubi_10.2.sh | 150 ----------------- x/xgboost/xgboost_3.4.0_ubi_10.2.sh | 209 ++++++++++++++++++++++++ 2 files changed, 209 insertions(+), 150 deletions(-) delete mode 100644 x/xgboost/xgboost-cpu_3.4.1_ubi_10.2.sh create mode 100644 x/xgboost/xgboost_3.4.0_ubi_10.2.sh diff --git a/x/xgboost/xgboost-cpu_3.4.1_ubi_10.2.sh b/x/xgboost/xgboost-cpu_3.4.1_ubi_10.2.sh deleted file mode 100644 index e529974f2d..0000000000 --- a/x/xgboost/xgboost-cpu_3.4.1_ubi_10.2.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/bash -e -# ----------------------------------------------------------------------------- -# -# Package : xgboost-cpu -# Version : 3.4.1 -# Source repo : https://github.com/dmlc/xgboost -# Tested on : UBI:10.2 -# Language : Python -# Ci-Check : True -# Script License : Apache License, Version 2 or later -# Maintainer : Siddesh Sangodkar -# -# Disclaimer: This script has been tested in root mode on given -# ========== platform using the mentioned version of the package. -# It may not work as expected with newer versions of the -# package and/or distribution. In such case, please -# contact "Maintainer" of this script. -# -# Note: xgboost-cpu is the CPU-only variant of XGBoost (USE_CUDA=OFF). -# It is built from the PyPI source distribution (sdist) which -# includes the C++ tree under cpp_src/ and uses scikit-build-core -# as the PEP 517 backend (CMake + Ninja internally). -# python3.14 requires scikit-build-core >=0.11.0 which is fetched -# at build time by pip via the build isolation requirements. -# -# ----------------------------------------------------------------------------- - -set -e - -PACKAGE_NAME=xgboost-cpu -PACKAGE_VERSION=${1:-3.4.1} -PACKAGE_URL=https://github.com/dmlc/xgboost -CURRENT_DIR=$(pwd) -WHEEL_DIR="${CURRENT_DIR}/wheels" -mkdir -p "${WHEEL_DIR}" - -# --------------------------------------------------------------------------- -# System dependencies -# --------------------------------------------------------------------------- -yum install -y python3.14 python3.14-devel python3.14-pip \ - git gcc-toolset-15 gcc-toolset-15-gcc gcc-toolset-15-gcc-c++ \ - cmake ninja-build make \ - openssl-devel libffi-devel zlib-devel \ - which curl tar - -# UBI 10 dropped SCL — guard block -if [[ -f /opt/rh/gcc-toolset-15/enable ]]; then - source /opt/rh/gcc-toolset-15/enable -elif [[ -d /opt/rh/gcc-toolset-15/root/usr/bin ]]; then - export PATH="/opt/rh/gcc-toolset-15/root/usr/bin:$PATH" - export LD_LIBRARY_PATH="/opt/rh/gcc-toolset-15/root/usr/lib64:$LD_LIBRARY_PATH" -else - echo "ERROR: gcc-toolset-15 not found" - exit 1 -fi - -echo "Using gcc: $(gcc --version | head -1)" -echo "Using cmake: $(cmake --version | head -1)" -echo "Using python: $(python3.14 --version)" - -# --------------------------------------------------------------------------- -# Python build tools -# --------------------------------------------------------------------------- -python3.14 -m pip install --upgrade pip setuptools wheel build -python3.14 -m pip install "scikit-build-core>=0.11.0" cmake ninja - -# --------------------------------------------------------------------------- -# Download xgboost-cpu source distribution from PyPI -# The sdist bundles the C++ tree under cpp_src/ — no git submodule needed. -# --------------------------------------------------------------------------- -SDIST_URL="https://files.pythonhosted.org/packages/99/98/c35e165aff81e43b43411662219764abbd246adae2547d360b23194cf75f/xgboost_cpu-${PACKAGE_VERSION}.tar.gz" - -cd "${CURRENT_DIR}" -curl -sSL --fail -o "xgboost_cpu-${PACKAGE_VERSION}.tar.gz" "${SDIST_URL}" -tar -xzf "xgboost_cpu-${PACKAGE_VERSION}.tar.gz" -cd "xgboost_cpu-${PACKAGE_VERSION}" - -# --------------------------------------------------------------------------- -# Build the wheel via scikit-build-core (CMake + Ninja, CPU-only) -# USE_CUDA=OFF is the default; USE_OPENMP=ON for multi-core ppc64le perf. -# --------------------------------------------------------------------------- -export CMAKE_ARGS="-DUSE_CUDA=OFF -DUSE_OPENMP=ON -DUSE_NCCL=OFF" - -if ! python3.14 -m build --wheel --no-isolation --outdir="${WHEEL_DIR}"; then - echo "------------------$PACKAGE_NAME:Build_fails-------------------------------------" - echo "$PACKAGE_URL $PACKAGE_NAME" - echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Build_Fails" - exit 1 -fi - -# Copy wheel to CURRENT_DIR for create_wheel_wrapper.sh compatibility -cp "${WHEEL_DIR}"/*.whl "${CURRENT_DIR}/" 2>/dev/null || true - -# --------------------------------------------------------------------------- -# Install wheel dependencies and the wheel itself -# Pip 26+ blocks file:// URIs to non-localhost paths; downgrade to pip 25 -# (last version without this restriction) before the local wheel install. -# --------------------------------------------------------------------------- -IBM_WHEELS="https://wheels.developerfirst.ibm.com/ppc64le/linux/+simple/" -python3.14 -m pip install \ - --trusted-host wheels.developerfirst.ibm.com \ - --extra-index-url "${IBM_WHEELS}" \ - --prefer-binary \ - "numpy==2.5.1" scipy - -# Install the wheel using python -m installer (bypasses pip's URL checks) -WHL=$(ls "${WHEEL_DIR}"/xgboost_cpu-*.whl | head -1) -python3.14 -m pip install installer -python3.14 -m installer "${WHL}" - -# Return to a neutral directory so Python doesn't pick up the source tree -cd "${CURRENT_DIR}" - -if ! python3.14 - <<'PYEOF' -import sys -import xgboost as xgb -import numpy as np - -print(f"xgboost version: {xgb.__version__}") - -# Basic DMatrix and training smoke test -X = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]) -y = np.array([0, 1, 0, 1]) -dtrain = xgb.DMatrix(X, label=y) - -params = { - "max_depth": 2, - "eta": 0.3, - "objective": "binary:logistic", - "device": "cpu", -} -bst = xgb.train(params, dtrain, num_boost_round=3) -preds = bst.predict(dtrain) -assert len(preds) == 4, f"Expected 4 predictions, got {len(preds)}" -print(f"Predictions: {preds}") -print("PASS xgboost basic train/predict") -print("All tests passed.") -sys.exit(0) -PYEOF -then - echo "------------------$PACKAGE_NAME:Install_success_but_test_fails---------------------" - echo "$PACKAGE_URL $PACKAGE_NAME" - echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_success_but_test_Fails" - exit 2 -else - echo "------------------$PACKAGE_NAME:Install_&_test_both_success-------------------------" - echo "$PACKAGE_URL $PACKAGE_NAME" - echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Pass | Both_Install_and_Test_Success" - exit 0 -fi diff --git a/x/xgboost/xgboost_3.4.0_ubi_10.2.sh b/x/xgboost/xgboost_3.4.0_ubi_10.2.sh new file mode 100644 index 0000000000..6c2a88a546 --- /dev/null +++ b/x/xgboost/xgboost_3.4.0_ubi_10.2.sh @@ -0,0 +1,209 @@ +#!/bin/bash -e +# ----------------------------------------------------------------------------- +# +# Package : xgboost +# Version : 3.4.0 +# Source repo : https://github.com/dmlc/xgboost +# Tested on : UBI:10.2 +# Language : Python +# Ci-Check : True +# Script License : Apache License, Version 2 or later +# Maintainer : Siddesh Sangodkar +# +# Disclaimer: This script has been tested in root mode on given +# ========== platform using the mentioned version of the package. +# It may not work as expected with newer versions of the +# package and/or distribution. In such case, please +# contact "Maintainer" of this script. +# +# Note: xgboost is the CPU-only variant of XGBoost (USE_CUDA=OFF). +# Built from the GitHub source tree using CMake + Ninja, then the +# Python wheel is produced from python-package/ via pip wheel. +# nvidia-nccl-cu12 is removed from pyproject.toml before wheel build +# as it is not available on ppc64le. +# numpy 2.5.0 is built from source (Meson-python backend) +# +# ----------------------------------------------------------------------------- + +set -e + +PACKAGE_NAME=xgboost +PACKAGE_VERSION=${1:-3.4.0} +PACKAGE_URL=https://github.com/dmlc/xgboost +PACKAGE_DIR=xgboost + +CURRENT_DIR=$(pwd) +NUMPY_VERSION=2.5.0 + +# --------------------------------------------------------------------------- +# System dependencies +# --------------------------------------------------------------------------- +yum install -y python3.14 python3.14-devel python3.14-pip \ + git gcc-toolset-15 gcc-toolset-15-gcc gcc-toolset-15-gcc-c++ \ + gcc-toolset-15-gcc-gfortran \ + cmake ninja-build make \ + openblas-devel pkg-config \ + openssl-devel libffi-devel zlib-devel \ + which curl tar + +# UBI 10 dropped SCL — guard block +if [[ -f /opt/rh/gcc-toolset-15/enable ]]; then + source /opt/rh/gcc-toolset-15/enable +elif [[ -d /opt/rh/gcc-toolset-15/root/usr/bin ]]; then + export PATH="/opt/rh/gcc-toolset-15/root/usr/bin:$PATH" + export LD_LIBRARY_PATH="/opt/rh/gcc-toolset-15/root/usr/lib64:$LD_LIBRARY_PATH" +else + echo "ERROR: gcc-toolset-15 not found" + exit 1 +fi + +echo "Using gcc: $(gcc --version | head -1)" +echo "Using cmake: $(cmake --version | head -1)" +echo "Using python: $(python3.14 --version)" + +# --------------------------------------------------------------------------- +# Python build tools and test dependencies +# --------------------------------------------------------------------------- +python3.14 -m pip install --upgrade pip setuptools wheel build +python3.14 -m pip install "meson-python>=0.18.0" "Cython>=3.0.6" meson ninja patchelf +python3.14 -m pip install packaging pathspec pluggy trove-classifiers scikit-build-core hatchling +IBM_WHEELS="https://wheels.developerfirst.ibm.com/ppc64le/linux/+simple/" +python3.14 -m pip install \ + --trusted-host wheels.developerfirst.ibm.com \ + --extra-index-url "${IBM_WHEELS}" \ + --prefer-binary \ + "pyarrow==23.0.1" +python3.14 -m pip install pytest hypothesis pandas graphviz + +# --------------------------------------------------------------------------- +# Build numpy from source +# --------------------------------------------------------------------------- +echo "=== Building numpy ${NUMPY_VERSION} from source ===" +cd "${CURRENT_DIR}" +git clone https://github.com/numpy/numpy numpy-src +cd numpy-src + +if git rev-parse "v${NUMPY_VERSION}" &>/dev/null; then + git checkout "v${NUMPY_VERSION}" +elif git rev-parse "${NUMPY_VERSION}" &>/dev/null; then + git checkout "${NUMPY_VERSION}" +else + echo "ERROR: No git tag found for numpy version '${NUMPY_VERSION}'" + exit 1 +fi + +git submodule sync --recursive +git submodule update --init --recursive + +export PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig:${PKG_CONFIG_PATH:-}" + +if ! python3.14 -m build --wheel --no-isolation \ + -Csetup-args="-Dblas=openblas" \ + -Csetup-args="-Dlapack=openblas" \ + --outdir="${CURRENT_DIR}/numpy-wheels/"; then + echo "ERROR: numpy build failed" + exit 1 +fi + +NUMPY_WHL=$(find "${CURRENT_DIR}/numpy-wheels" -name "numpy-*.whl" | head -1) +echo "Installing numpy wheel: ${NUMPY_WHL}" +python3.14 -m pip install --no-deps --force-reinstall "${NUMPY_WHL}" +echo "numpy ${NUMPY_VERSION} installed successfully" + +# --------------------------------------------------------------------------- +# Clone and checkout xgboost +# --------------------------------------------------------------------------- +cd "${CURRENT_DIR}" +git clone "${PACKAGE_URL}" "${PACKAGE_DIR}" +cd "${PACKAGE_DIR}" + +if git rev-parse "v${PACKAGE_VERSION}" &>/dev/null; then + git checkout "v${PACKAGE_VERSION}" +elif git rev-parse "${PACKAGE_VERSION}" &>/dev/null; then + git checkout "${PACKAGE_VERSION}" +else + echo "ERROR: No git tag found for version '${PACKAGE_VERSION}'" + exit 1 +fi + +git submodule update --init + +export SRC_DIR=$(pwd) + +# --------------------------------------------------------------------------- +# Build the shared library via CMake (CPU-only) +# --------------------------------------------------------------------------- +mkdir -p build +cd build + +cmake \ + -DCMAKE_INSTALL_PREFIX="${CURRENT_DIR}/output" \ + -DUSE_CUDA=OFF \ + -DUSE_OPENMP=ON \ + -DUSE_NCCL=OFF \ + .. + +make VERBOSE=1 -j"$(nproc)" +cd "${SRC_DIR}" + +# --------------------------------------------------------------------------- +# Build Python wheel from python-package/ +# Remove nvidia-nccl-cu12 dependency — not available on ppc64le. +# --------------------------------------------------------------------------- +cd "${SRC_DIR}/python-package" +sed -i '/nvidia-nccl-cu12/d' pyproject.toml + +WHEEL_DIR="${CURRENT_DIR}/wheels" +mkdir -p "${WHEEL_DIR}" + +if ! python3.14 -m pip wheel -w "${WHEEL_DIR}" -v . --no-build-isolation --no-deps; then + echo "------------------$PACKAGE_NAME:Build_fails-------------------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Build_Fails" + exit 1 +fi + +# Copy wheel to CURRENT_DIR for create_wheel_wrapper.sh compatibility +cp "${WHEEL_DIR}"/*.whl "${CURRENT_DIR}/" 2>/dev/null || true + +# --------------------------------------------------------------------------- +# Install runtime dependencies and the wheel itself +# --------------------------------------------------------------------------- +python3.14 -m pip install scipy + +WHL=$(ls "${WHEEL_DIR}"/xgboost-*.whl | head -1) +python3.14 -m pip install --no-deps --force-reinstall "${WHL}" + +# --------------------------------------------------------------------------- +# Run test suite (skip GPU, distributed, and unavailable extras) +# --------------------------------------------------------------------------- +cd "${SRC_DIR}" + +if ! python3.14 -m pytest tests/ \ + --ignore=tests/ci_build/test_r_package.py \ + --ignore=tests/python/test_cli.py \ + --ignore=tests/python/test_demos.py \ + --ignore=tests/python/test_openmp.py \ + --ignore=tests/python/test_tracker.py \ + --ignore=tests/python-gpu/ \ + --ignore=tests/test_distributed/test_gpu_with_dask \ + --ignore=tests/test_distributed/test_with_dask \ + --ignore=tests/test_distributed/test_with_spark \ + --ignore=tests/test_distributed/test_gpu_with_spark \ + --ignore=tests/test_distributed/test_federated \ + --ignore=tests/test_distributed/test_gpu_federated \ + --ignore=tests/python-sycl \ + --ignore=tests/cross-platform \ + --ignore=tests/python/test_with_sklearn.py \ + --disable-warnings \ + -p no:xfail -v; then + echo "------------------$PACKAGE_NAME:Install_success_but_test_fails---------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_success_but_test_Fails" + exit 2 +else + echo "------------------$PACKAGE_NAME:Install_&_test_both_success-------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Pass | Both_Install_and_Test_Success" + exit 0 +fi From 4daa3589b7f8faf1822e07d93edda88d0fc0b656 Mon Sep 17 00:00:00 2001 From: Siddesh-Sangodkar1 Date: Wed, 9 Sep 2026 20:02:56 +0530 Subject: [PATCH 5/8] added build_info.json changes --- x/xgboost/build_info.json | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/x/xgboost/build_info.json b/x/xgboost/build_info.json index d405481241..05407e2e0b 100644 --- a/x/xgboost/build_info.json +++ b/x/xgboost/build_info.json @@ -1,23 +1,26 @@ { - "maintainer": "kiranNukal", + "maintainer": "Siddesh-Sangodkar1", "package_name": "xgboost", "github_url": "https://github.com/dmlc/xgboost", - "version": "v3.0.1", + "version": "3.4.0", "wheel_build" : true, "default_branch": "master", "package_dir": "x/xgboost", - "build_script": "xgboost_3.0.1_ubi_9.3.sh", + "build_script": "xgboost_3.4.0_ubi_10.2.sh", "docker_build": false, "validate_build_script": true, "use_non_root_user": false, "wheel_name": "xgboost-cpu", "v1.6.2": { "build_script": "xgboost_ubi_9.3.sh" - }, - "3.4.1": { - "build_script": "xgboost-cpu_3.4.1_ubi_10.2.sh" - }, - "*": { + }, + "3.0.1": { "build_script": "xgboost_3.0.1_ubi_9.3.sh" + }, + "3.4.0": { + "build_script": "xgboost_3.4.0_ubi_10.2.sh" + }, + "*": { + "build_script": "xgboost_3.4.0_ubi_10.2.sh" } } From 50430a4918e38926476a718c646d6425aef894d3 Mon Sep 17 00:00:00 2001 From: Siddesh-Sangodkar1 Date: Thu, 17 Sep 2026 10:50:49 +0530 Subject: [PATCH 6/8] added suggested fixes --- x/xgboost/build_info.json | 4 +- x/xgboost/xgboost_3.4.0_ubi_10.2.sh | 224 +++++++++++++++------------- 2 files changed, 122 insertions(+), 106 deletions(-) diff --git a/x/xgboost/build_info.json b/x/xgboost/build_info.json index dd23a7ebd7..30d1f74b9e 100644 --- a/x/xgboost/build_info.json +++ b/x/xgboost/build_info.json @@ -2,7 +2,7 @@ "maintainer": "Siddesh-Sangodkar1", "package_name": "xgboost", "github_url": "https://github.com/dmlc/xgboost", - "version": "3.4.0", + "version": "v3.4.0", "wheel_build" : true, "default_branch": "master", "package_dir": "x/xgboost", @@ -17,7 +17,7 @@ "v3.0.1": { "build_script": "xgboost_3.0.1_ubi_9.3.sh" }, - "3.4.0": { + "v3.4.0": { "build_script": "xgboost_3.4.0_ubi_10.2.sh" }, "*": { diff --git a/x/xgboost/xgboost_3.4.0_ubi_10.2.sh b/x/xgboost/xgboost_3.4.0_ubi_10.2.sh index 6c2a88a546..14e721c453 100644 --- a/x/xgboost/xgboost_3.4.0_ubi_10.2.sh +++ b/x/xgboost/xgboost_3.4.0_ubi_10.2.sh @@ -2,7 +2,7 @@ # ----------------------------------------------------------------------------- # # Package : xgboost -# Version : 3.4.0 +# Version : v3.4.0 # Source repo : https://github.com/dmlc/xgboost # Tested on : UBI:10.2 # Language : Python @@ -16,34 +16,37 @@ # package and/or distribution. In such case, please # contact "Maintainer" of this script. # -# Note: xgboost is the CPU-only variant of XGBoost (USE_CUDA=OFF). -# Built from the GitHub source tree using CMake + Ninja, then the -# Python wheel is produced from python-package/ via pip wheel. -# nvidia-nccl-cu12 is removed from pyproject.toml before wheel build -# as it is not available on ppc64le. -# numpy 2.5.0 is built from source (Meson-python backend) # # ----------------------------------------------------------------------------- set -e PACKAGE_NAME=xgboost -PACKAGE_VERSION=${1:-3.4.0} +PACKAGE_VERSION=${1:-v3.4.0} PACKAGE_URL=https://github.com/dmlc/xgboost -PACKAGE_DIR=xgboost CURRENT_DIR=$(pwd) + NUMPY_VERSION=2.5.0 +PYARROW_VERSION=25.0.0 +XGBOOST_SDIST_VERSION="${PACKAGE_VERSION#v}" # strip leading 'v' for PyPI URL + +IBM_WHEELS="https://wheels.developerfirst.ibm.com/ppc64le/linux/+simple/" +IBM_WHEELS_HOST="wheels.developerfirst.ibm.com" # --------------------------------------------------------------------------- # System dependencies # --------------------------------------------------------------------------- yum install -y python3.14 python3.14-devel python3.14-pip \ git gcc-toolset-15 gcc-toolset-15-gcc gcc-toolset-15-gcc-c++ \ - gcc-toolset-15-gcc-gfortran \ + gcc-toolset-15-gcc-gfortran gcc-toolset-15-libatomic-devel \ cmake ninja-build make \ - openblas-devel pkg-config \ + openblas-devel libjpeg-turbo-devel pkg-config \ openssl-devel libffi-devel zlib-devel \ + wget xz-devel bzip2-devel lz4-devel \ + libevent libtool patch tzdata binutils \ + brotli brotli-devel perl-Unicode-Normalize \ + libatomic graphviz \ which curl tar # UBI 10 dropped SCL — guard block @@ -57,127 +60,141 @@ else exit 1 fi -echo "Using gcc: $(gcc --version | head -1)" -echo "Using cmake: $(cmake --version | head -1)" -echo "Using python: $(python3.14 --version)" +export CC="$(which gcc)" +export CXX="$(which g++)" + # --------------------------------------------------------------------------- -# Python build tools and test dependencies +# Python build tools and runtime dependencies # --------------------------------------------------------------------------- python3.14 -m pip install --upgrade pip setuptools wheel build -python3.14 -m pip install "meson-python>=0.18.0" "Cython>=3.0.6" meson ninja patchelf -python3.14 -m pip install packaging pathspec pluggy trove-classifiers scikit-build-core hatchling -IBM_WHEELS="https://wheels.developerfirst.ibm.com/ppc64le/linux/+simple/" python3.14 -m pip install \ - --trusted-host wheels.developerfirst.ibm.com \ + "meson-python>=0.18.0" "Cython>=3.0.6" meson ninja patchelf \ + packaging pathspec pluggy trove-classifiers scikit-build-core hatchling \ + pytest hypothesis "pandas==3.0.0" graphviz Pillow matplotlib \ + "numpy==${NUMPY_VERSION}" + +python3.14 -m pip install \ + --trusted-host "${IBM_WHEELS_HOST}" \ --extra-index-url "${IBM_WHEELS}" \ --prefer-binary \ - "pyarrow==23.0.1" -python3.14 -m pip install pytest hypothesis pandas graphviz - -# --------------------------------------------------------------------------- -# Build numpy from source -# --------------------------------------------------------------------------- -echo "=== Building numpy ${NUMPY_VERSION} from source ===" -cd "${CURRENT_DIR}" -git clone https://github.com/numpy/numpy numpy-src -cd numpy-src - -if git rev-parse "v${NUMPY_VERSION}" &>/dev/null; then - git checkout "v${NUMPY_VERSION}" -elif git rev-parse "${NUMPY_VERSION}" &>/dev/null; then - git checkout "${NUMPY_VERSION}" -else - echo "ERROR: No git tag found for numpy version '${NUMPY_VERSION}'" - exit 1 -fi - -git submodule sync --recursive -git submodule update --init --recursive - -export PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig:${PKG_CONFIG_PATH:-}" - -if ! python3.14 -m build --wheel --no-isolation \ - -Csetup-args="-Dblas=openblas" \ - -Csetup-args="-Dlapack=openblas" \ - --outdir="${CURRENT_DIR}/numpy-wheels/"; then - echo "ERROR: numpy build failed" - exit 1 + "scipy==1.18.0" "scikit-learn==1.9.0" + +# =========================================================================== +# Build pyarrow 25.0.0 from source +# (Approach from build-scripts/o/onnx/onnx_1.21.0_ubi_10.2.sh) +# =========================================================================== + +# gcc-toolset-15 ld does not find the system libatomic; create the unversioned +# symlink that -latomic requires. +if [[ ! -e /usr/lib64/libatomic.so ]]; then + ln -s /usr/lib64/libatomic.so.1 /usr/lib64/libatomic.so + echo "Created /usr/lib64/libatomic.so symlink for Arrow C++ build" fi -NUMPY_WHL=$(find "${CURRENT_DIR}/numpy-wheels" -name "numpy-*.whl" | head -1) -echo "Installing numpy wheel: ${NUMPY_WHL}" -python3.14 -m pip install --no-deps --force-reinstall "${NUMPY_WHL}" -echo "numpy ${NUMPY_VERSION} installed successfully" - # --------------------------------------------------------------------------- -# Clone and checkout xgboost -# --------------------------------------------------------------------------- -cd "${CURRENT_DIR}" -git clone "${PACKAGE_URL}" "${PACKAGE_DIR}" -cd "${PACKAGE_DIR}" - -if git rev-parse "v${PACKAGE_VERSION}" &>/dev/null; then - git checkout "v${PACKAGE_VERSION}" -elif git rev-parse "${PACKAGE_VERSION}" &>/dev/null; then - git checkout "${PACKAGE_VERSION}" -else - echo "ERROR: No git tag found for version '${PACKAGE_VERSION}'" - exit 1 -fi - -git submodule update --init - -export SRC_DIR=$(pwd) - -# --------------------------------------------------------------------------- -# Build the shared library via CMake (CPU-only) -# --------------------------------------------------------------------------- -mkdir -p build -cd build - -cmake \ - -DCMAKE_INSTALL_PREFIX="${CURRENT_DIR}/output" \ - -DUSE_CUDA=OFF \ - -DUSE_OPENMP=ON \ - -DUSE_NCCL=OFF \ - .. - -make VERBOSE=1 -j"$(nproc)" -cd "${SRC_DIR}" - -# --------------------------------------------------------------------------- -# Build Python wheel from python-package/ -# Remove nvidia-nccl-cu12 dependency — not available on ppc64le. -# --------------------------------------------------------------------------- -cd "${SRC_DIR}/python-package" -sed -i '/nvidia-nccl-cu12/d' pyproject.toml +# Step 1: Build and install Arrow C++ 25.0.0 (BUNDLED deps — no manual +# protobuf / gRPC / c-ares / re2 build needed) +# --------------------------------------------------------------------------- +echo "--- Building Arrow C++ ${PYARROW_VERSION} ---" +ARROW_TARBALL="https://archive.apache.org/dist/arrow/arrow-${PYARROW_VERSION}/apache-arrow-${PYARROW_VERSION}.tar.gz" +ARROW_SRC="${CURRENT_DIR}/arrow_src" +mkdir -p "${ARROW_SRC}" +curl -sSL --fail -o "${ARROW_SRC}/apache-arrow-${PYARROW_VERSION}.tar.gz" "${ARROW_TARBALL}" +tar -xzf "${ARROW_SRC}/apache-arrow-${PYARROW_VERSION}.tar.gz" -C "${ARROW_SRC}" +ARROW_CPP_SRC="${ARROW_SRC}/apache-arrow-${PYARROW_VERSION}/cpp" + +mkdir -p "${ARROW_CPP_SRC}/build" +cmake -S "${ARROW_CPP_SRC}" -B "${ARROW_CPP_SRC}/build" \ + -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DCMAKE_EXE_LINKER_FLAGS="-L/usr/lib64" \ + -DCMAKE_SHARED_LINKER_FLAGS="-L/usr/lib64" \ + -DCMAKE_MODULE_LINKER_FLAGS="-L/usr/lib64" \ + -DARROW_BUILD_STATIC=OFF \ + -DARROW_BUILD_SHARED=ON \ + -DARROW_PYTHON=ON \ + -DARROW_DATASET=ON \ + -DARROW_PARQUET=ON \ + -DARROW_ACERO=ON \ + -DARROW_COMPUTE=ON \ + -DARROW_CSV=ON \ + -DARROW_JSON=ON \ + -DARROW_IPC=ON \ + -DARROW_WITH_ZLIB=ON \ + -DARROW_WITH_LZ4=ON \ + -DARROW_WITH_SNAPPY=ON \ + -DARROW_WITH_ZSTD=ON \ + -DARROW_WITH_BZ2=ON \ + -DARROW_DEPENDENCY_SOURCE=BUNDLED \ + -DARROW_VERBOSE_THIRDPARTY_BUILD=OFF +cmake --build "${ARROW_CPP_SRC}/build" --parallel "$(nproc)" +cmake --install "${ARROW_CPP_SRC}/build" +ldconfig + +export Arrow_DIR=/usr/local/lib/cmake/Arrow +export ArrowDataset_DIR=/usr/local/lib/cmake/ArrowDataset +export Parquet_DIR=/usr/local/lib/cmake/Parquet +# Persist so pyarrow can dlopen libarrow*.so at validation time +export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:${LD_LIBRARY_PATH:-} +echo "/usr/local/lib" > /etc/ld.so.conf.d/arrow-local.conf +echo "/usr/local/lib64" >> /etc/ld.so.conf.d/arrow-local.conf +ldconfig +echo "Arrow C++ ${PYARROW_VERSION} installed successfully" + +# --------------------------------------------------------------------------- +# Step 2: Build pyarrow wheel against the installed Arrow C++ +# --------------------------------------------------------------------------- +echo "--- Building pyarrow ${PYARROW_VERSION} ---" +python3.14 -m pip install "scikit-build-core>=0.11.0" cython "setuptools_scm[toml]>=8" +export PYARROW_REQUIRE_STUB_DOCSTRINGS=OFF +export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) +PYARROW_SDIST="https://files.pythonhosted.org/packages/27/f3/95428098d1fa7d04432fb750eed06b41304c2f6a5d3319985e64db2d9d41/pyarrow-${PYARROW_VERSION}.tar.gz" +python3.14 -m pip install --no-build-isolation "${PYARROW_SDIST}" +echo "pyarrow ${PYARROW_VERSION} installed successfully" + +# =========================================================================== +# Build xgboost 3.4.0 from source (scikit-build-core / cmake sdist) +# =========================================================================== +echo "--- Building xgboost ${XGBOOST_SDIST_VERSION} ---" WHEEL_DIR="${CURRENT_DIR}/wheels" mkdir -p "${WHEEL_DIR}" -if ! python3.14 -m pip wheel -w "${WHEEL_DIR}" -v . --no-build-isolation --no-deps; then +# xgboost sdist — scikit-build-core drives the cmake build (USE_CUDA=OFF by +# default on CPU-only targets). --no-build-isolation keeps the numpy/scipy +# already installed above visible to the build backend. +XGBOOST_SDIST="https://files.pythonhosted.org/packages/7d/11/2b1de4cb9b7eeb042ca49c7d3b3ed2b77e7645ee6c0f99cf616716f3e8d7/xgboost-${XGBOOST_SDIST_VERSION}.tar.gz" + +if ! python3.14 -m pip wheel \ + --no-build-isolation \ + --no-deps \ + -w "${WHEEL_DIR}" \ + "${XGBOOST_SDIST}"; then echo "------------------$PACKAGE_NAME:Build_fails-------------------------------------" echo "$PACKAGE_URL $PACKAGE_NAME" echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Build_Fails" exit 1 fi -# Copy wheel to CURRENT_DIR for create_wheel_wrapper.sh compatibility cp "${WHEEL_DIR}"/*.whl "${CURRENT_DIR}/" 2>/dev/null || true # --------------------------------------------------------------------------- -# Install runtime dependencies and the wheel itself +# Install the xgboost wheel # --------------------------------------------------------------------------- -python3.14 -m pip install scipy - WHL=$(ls "${WHEEL_DIR}"/xgboost-*.whl | head -1) +echo "Installing xgboost wheel: ${WHL}" python3.14 -m pip install --no-deps --force-reinstall "${WHL}" # --------------------------------------------------------------------------- -# Run test suite (skip GPU, distributed, and unavailable extras) +# Run test suite (skip GPU, distributed, and test files that require +# a live cluster or CUDA) # --------------------------------------------------------------------------- -cd "${SRC_DIR}" +# Fetch the source tree for tests (not needed for the wheel itself) +cd "${CURRENT_DIR}" +git clone --depth 1 --branch "${PACKAGE_VERSION}" "${PACKAGE_URL}" xgboost_src +cd xgboost_src if ! python3.14 -m pytest tests/ \ --ignore=tests/ci_build/test_r_package.py \ @@ -194,7 +211,6 @@ if ! python3.14 -m pytest tests/ \ --ignore=tests/test_distributed/test_gpu_federated \ --ignore=tests/python-sycl \ --ignore=tests/cross-platform \ - --ignore=tests/python/test_with_sklearn.py \ --disable-warnings \ -p no:xfail -v; then echo "------------------$PACKAGE_NAME:Install_success_but_test_fails---------------------" From 4be1ee25312f1016237ba3dde0b3a03378e0523b Mon Sep 17 00:00:00 2001 From: Siddesh-Sangodkar1 Date: Tue, 22 Sep 2026 10:51:34 +0530 Subject: [PATCH 7/8] update pandas version --- x/xgboost/xgboost_3.4.0_ubi_10.2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/xgboost/xgboost_3.4.0_ubi_10.2.sh b/x/xgboost/xgboost_3.4.0_ubi_10.2.sh index 14e721c453..bd7ef85a21 100644 --- a/x/xgboost/xgboost_3.4.0_ubi_10.2.sh +++ b/x/xgboost/xgboost_3.4.0_ubi_10.2.sh @@ -71,7 +71,7 @@ python3.14 -m pip install --upgrade pip setuptools wheel build python3.14 -m pip install \ "meson-python>=0.18.0" "Cython>=3.0.6" meson ninja patchelf \ packaging pathspec pluggy trove-classifiers scikit-build-core hatchling \ - pytest hypothesis "pandas==3.0.0" graphviz Pillow matplotlib \ + pytest hypothesis "pandas==3.0.5" graphviz Pillow matplotlib \ "numpy==${NUMPY_VERSION}" python3.14 -m pip install \ From 4c5359ab523d0ae583d50cca035d83791ab7e35e Mon Sep 17 00:00:00 2001 From: Siddesh-Sangodkar1 Date: Tue, 22 Sep 2026 20:25:26 +0530 Subject: [PATCH 8/8] rerun CI --- x/xgboost/xgboost_3.4.0_ubi_10.2.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/x/xgboost/xgboost_3.4.0_ubi_10.2.sh b/x/xgboost/xgboost_3.4.0_ubi_10.2.sh index bd7ef85a21..04ec628d17 100644 --- a/x/xgboost/xgboost_3.4.0_ubi_10.2.sh +++ b/x/xgboost/xgboost_3.4.0_ubi_10.2.sh @@ -63,7 +63,6 @@ fi export CC="$(which gcc)" export CXX="$(which g++)" - # --------------------------------------------------------------------------- # Python build tools and runtime dependencies # ---------------------------------------------------------------------------