From 6906406d2db66c1ee1db2e81ac8e82b71b023aa3 Mon Sep 17 00:00:00 2001 From: SakshiJain0302 Date: Thu, 30 Jul 2026 15:47:01 +0530 Subject: [PATCH 1/2] Added script for ubi 10.1 --- n/numpy/build_info.json | 7 ++- n/numpy/numpy_2.5.2_ubi_10.2.sh | 104 ++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 n/numpy/numpy_2.5.2_ubi_10.2.sh diff --git a/n/numpy/build_info.json b/n/numpy/build_info.json index 537653b538..e4459d6e79 100644 --- a/n/numpy/build_info.json +++ b/n/numpy/build_info.json @@ -1,5 +1,5 @@ { - "maintainer": "shubham-garud", + "maintainer": "SakshiJain0302", "package_name": "numpy", "github_url": "https://github.com/numpy/numpy.git", "version": "v2.2.2", @@ -26,6 +26,9 @@ "build_script": "numpy_v2.2.5_ubi_9.3.sh" }, "*":{ - "build_script": "numpy_v2.2.5_ubi_9.3.sh" + "build_script": [ + "numpy_v2.2.5_ubi_9.3.sh", + "numpy_2.5.2_ubi_10.2.sh" + ] } } diff --git a/n/numpy/numpy_2.5.2_ubi_10.2.sh b/n/numpy/numpy_2.5.2_ubi_10.2.sh new file mode 100644 index 0000000000..6080035843 --- /dev/null +++ b/n/numpy/numpy_2.5.2_ubi_10.2.sh @@ -0,0 +1,104 @@ +#!/bin/bash -e +# ----------------------------------------------------------------------------- +# +# Package : numpy +# Version : v2.5.2 +# Source repo : https://github.com/numpy/numpy +# Tested on : UBI:10.2 +# Language : Python +# Ci-Check : True +# Script License: Apache License, Version 2 or later +# Maintainer : Sakshi Jain +# +# 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. +# +# ---------------------------------------------------------------------------- +PACKAGE_NAME=numpy +PACKAGE_VERSION=${1:-v2.5.2} +PACKAGE_URL=https://github.com/numpy/numpy.git +PACKAGE_DIR=numpy +CURRENT_DIR="${PWD}" + +yum install -y wget python3.14 python3.14-devel python3.14-pip git gcc gcc-c++ gcc-gfortran make pkgconf-pkg-config +python3.14 -m pip install --upgrade pip +python3.14 -m pip install tox Cython pytest hypothesis wheel meson ninja build meson-python patchelf + +#clone and install openblas from source +git clone https://github.com/OpenMathLib/OpenBLAS +cd OpenBLAS +git checkout v0.3.29 +git submodule update --init + +make -j$(nproc) TARGET=POWER9 BUILD_BFLOAT16=1 BINARY=64 USE_OPENMP=1 USE_THREAD=1 NUM_THREADS=120 DYNAMIC_ARCH=1 INTERFACE64=0 +make install PREFIX=/usr/local + +export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH +export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH +export LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:$LIBRARY_PATH +export CPATH=/usr/local/include:$CPATH + +cd .. + + +#clone package +git clone $PACKAGE_URL +cd $PACKAGE_NAME +git checkout $PACKAGE_VERSION +git submodule update --init +export CC=/usr/bin/gcc +export CXX=/usr/bin/g++ +export FC=/usr/bin/gfortran +export AR=/usr/bin/ar +export LD=/usr/bin/ld +export NM=/usr/bin/nm +export OBJCOPY=/usr/bin/objcopy +export OBJDUMP=/usr/bin/objdump +export RANLIB=/usr/bin/ranlib +export STRIP=/usr/bin/strip +export READELF=/usr/bin/readelf +UNAME_M=$(uname -m) +case "$UNAME_M" in + ppc64*) + # Optimizations trigger compiler bug. + export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/ -fno-plt//')" + export CFLAGS="$(echo ${CFLAGS} | sed -e 's/ -fno-plt//')" + ;; + *) + EXTRA_OPTS="" + ;; +esac + +if ! (python3.14 -m pip install . --no-build-isolation);then + echo "------------------$PACKAGE_NAME:Install_fails-------------------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_Fails" + exit 1 +fi + +if ! python3.14 -m build --wheel --no-isolation --outdir="$CURRENT_DIR/"; then + echo "============ Wheel Creation Failed for Python $PYTHON_VERSION (without isolation) =================" + echo "Attempting to build with isolation..." + + # Attempt to build the wheel without isolation + if ! python3.14 -m build --wheel --outdir="$CURRENT_DIR/"; then + echo "============ Wheel Creation Failed for Python $PYTHON_VERSION =================" + fi +fi + +export CFLAGS="-DCYTHON_PEP489_MULTI_PHASE_INIT=0" + +if ! (tox -e py3); 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 \ No newline at end of file From 0e29ccec5ba3e304a84238e418d5e13eaf6815de Mon Sep 17 00:00:00 2001 From: Sakshi Jain Date: Tue, 25 Aug 2026 19:11:17 +0530 Subject: [PATCH 2/2] Built v2.5.0 with blas 0.3.33 --- n/numpy/build_info.json | 2 +- ....2_ubi_10.2.sh => numpy_2.5.0_ubi_10.2.sh} | 110 ++++++++++++++++-- 2 files changed, 99 insertions(+), 13 deletions(-) rename n/numpy/{numpy_2.5.2_ubi_10.2.sh => numpy_2.5.0_ubi_10.2.sh} (54%) diff --git a/n/numpy/build_info.json b/n/numpy/build_info.json index e4459d6e79..d02a9530cb 100644 --- a/n/numpy/build_info.json +++ b/n/numpy/build_info.json @@ -28,7 +28,7 @@ "*":{ "build_script": [ "numpy_v2.2.5_ubi_9.3.sh", - "numpy_2.5.2_ubi_10.2.sh" + "numpy_2.5.0_ubi_10.2.sh" ] } } diff --git a/n/numpy/numpy_2.5.2_ubi_10.2.sh b/n/numpy/numpy_2.5.0_ubi_10.2.sh similarity index 54% rename from n/numpy/numpy_2.5.2_ubi_10.2.sh rename to n/numpy/numpy_2.5.0_ubi_10.2.sh index 6080035843..db603e4b46 100644 --- a/n/numpy/numpy_2.5.2_ubi_10.2.sh +++ b/n/numpy/numpy_2.5.0_ubi_10.2.sh @@ -2,7 +2,7 @@ # ----------------------------------------------------------------------------- # # Package : numpy -# Version : v2.5.2 +# Version : v2.5.0 # Source repo : https://github.com/numpy/numpy # Tested on : UBI:10.2 # Language : Python @@ -18,7 +18,7 @@ # # ---------------------------------------------------------------------------- PACKAGE_NAME=numpy -PACKAGE_VERSION=${1:-v2.5.2} +PACKAGE_VERSION=${1:-v2.5.0} PACKAGE_URL=https://github.com/numpy/numpy.git PACKAGE_DIR=numpy CURRENT_DIR="${PWD}" @@ -27,21 +27,107 @@ yum install -y wget python3.14 python3.14-devel python3.14-pip git gcc gcc-c++ g python3.14 -m pip install --upgrade pip python3.14 -m pip install tox Cython pytest hypothesis wheel meson ninja build meson-python patchelf -#clone and install openblas from source -git clone https://github.com/OpenMathLib/OpenBLAS +echo " --------------------------------------------------- OpenBlas Installing --------------------------------------------------- " + +# OpenBLAS version and source +OPENBLAS_VERSION=v0.3.33 +OPENBLAS_URL=https://github.com/OpenMathLib/OpenBLAS + +# Clone OpenBLAS +git clone -b "${OPENBLAS_VERSION}" "${OPENBLAS_URL}" cd OpenBLAS -git checkout v0.3.29 git submodule update --init +SRC_DIR=$(pwd) + +# Set pip config +python3.14 -m pip config set global.index-url https://pypi.python.org/simple +python3.14 -m pip config set global.no-index false + +# Install prerequisites +python3.14 -m pip install setuptools + +# Remove problematic linker flag +LDFLAGS=$(echo "${LDFLAGS}" | sed "s/-Wl,--gc-sections//g") +export LDFLAGS + +# Compiler flags +export CF="${CFLAGS} -Wno-unused-parameter -Wno-old-style-declaration" +unset CFLAGS + +export USE_OPENMP=1 + +# Installation prefix +export PREFIX="${SRC_DIR}/local/openblas" + +# Build options +build_opts=() + +build_opts+=(USE_OPENMP=${USE_OPENMP}) +build_opts+=(BINARY="64") +build_opts+=(DYNAMIC_ARCH=1) + +# ppc64le / POWER platform +build_opts+=(TARGET="POWER9") + +# LP64 interface +build_opts+=(INTERFACE64=0) +build_opts+=(SYMBOLSUFFIX="") + +# Build LAPACK +build_opts+=(NO_LAPACK=0) + +# Enable threading +build_opts+=(USE_THREAD=1) +build_opts+=(NUM_THREADS=8) + +# Disable CPU affinity +build_opts+=(NO_AFFINITY=1) + +# Handle Fortran flags +if [ -n "${FFLAGS}" ]; then + # Don't use GNU OpenMP, which is not fork-safe + export FFLAGS="${FFLAGS/-fopenmp/ }" + export FFLAGS="${FFLAGS} -frecursive" + export LAPACK_FFLAGS="${FFLAGS}" +fi + +# Build OpenBLAS +make -j8 "${build_opts[@]}" \ + CFLAGS="${CF}" \ + FFLAGS="${FFLAGS}" + +# Install OpenBLAS +make install \ + PREFIX="${PREFIX}" \ + "${build_opts[@]}" \ + CFLAGS="${CF}" \ + FFLAGS="${FFLAGS}" + +# Verify installation +[ -d "${PREFIX}" ] || { + echo "ERROR: make install failed — PREFIX directory was not created: ${PREFIX}" + exit 1 +} + +# Set OpenBLAS paths +export OPENBLAS_HOME="${PREFIX}" +export LD_LIBRARY_PATH="${OPENBLAS_HOME}/lib:${LD_LIBRARY_PATH}" +export LIBRARY_PATH="${OPENBLAS_HOME}/lib:${LIBRARY_PATH}" +export CPATH="${OPENBLAS_HOME}/include:${CPATH}" +export PKG_CONFIG_PATH="${OPENBLAS_HOME}/lib/pkgconfig:${PKG_CONFIG_PATH}" +export CMAKE_PREFIX_PATH="${OPENBLAS_HOME}:${CMAKE_PREFIX_PATH}" + +# Prepare Python package structure +wget https://raw.githubusercontent.com/i-wheels-cpd/build-scripts/refs/heads/main/o/openblas/pyproject.toml + +sed -i "s/{PACKAGE_VERSION}/${OPENBLAS_VERSION}/g" pyproject.toml -make -j$(nproc) TARGET=POWER9 BUILD_BFLOAT16=1 BINARY=64 USE_OPENMP=1 USE_THREAD=1 NUM_THREADS=120 DYNAMIC_ARCH=1 INTERFACE64=0 -make install PREFIX=/usr/local +touch "${PREFIX}/__init__.py" +rm -rf "${PREFIX}/bin" -export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH -export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH -export LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:$LIBRARY_PATH -export CPATH=/usr/local/include:$CPATH +echo " --------------------------------------------------- OpenBLAS Successfully Installed --------------------------------------------------- " -cd .. +cd $CURRENT_DIR #clone package