diff --git a/p/pillow/build_info.json b/p/pillow/build_info.json index 77ebe149bb..c9b041bfff 100644 --- a/p/pillow/build_info.json +++ b/p/pillow/build_info.json @@ -1,5 +1,5 @@ { - "maintainer": "Ryder Salinas ", + "maintainer": "RSakshiJain0302", "package_name": "pillow", "github_url": "https://github.com/python-pillow/Pillow", "version": "12.3.0", @@ -20,9 +20,15 @@ "build_script": "pillow_v12.0.0_ubi_9.3.sh" }, "12.3.0": { - "build_script": "pillow_v12.3.0_ubi_9.6.sh" + "build_script": [ + "pillow_v12.3.0_ubi_9.6.sh", + "pillow_v11.1.0_ubi_10.1.sh" + ] }, "*": { - "build_script": "pillow_v12.3.0_ubi_9.6.sh" + "build_script": [ + "pillow_v12.3.0_ubi_9.6.sh", + "pillow_v11.1.0_ubi_10.1.sh" + ] } } diff --git a/p/pillow/pillow_v11.1.0_ubi_10.1.sh b/p/pillow/pillow_v11.1.0_ubi_10.1.sh new file mode 100644 index 0000000000..c11d8141de --- /dev/null +++ b/p/pillow/pillow_v11.1.0_ubi_10.1.sh @@ -0,0 +1,131 @@ +#!/bin/bash -e +# ----------------------------------------------------------------------------- +# +# Package : pillow +# Version : 11.1.0 +# Source repo : https://github.com/python-pillow/Pillow +# Tested on : UBI:10.1 +# Language : Python, C +# 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=pillow +PACKAGE_DIR=Pillow +PACKAGE_VERSION=${1:-11.1.0} +PACKAGE_URL=https://github.com/python-pillow/Pillow/ + +# install core dependencies +yum install -y python3.12 python3.12-pip python3.12-devel git gcc make gcc-c++ + + +# install pillow's minimum dependencies +yum install -y zlib zlib-devel libjpeg-turbo libjpeg-turbo-devel wget freetype-devel + + +echo " ------------------------------------------ Openblas Installing ------------------------------------------ " + +#clone and install openblas from source +git clone https://github.com/OpenMathLib/OpenBLAS +cd OpenBLAS +git checkout v0.3.29 +git submodule update --init + +PREFIX=local/openblas +OPENBLAS_SOURCE=$(pwd) + +# Set build options +declare -a build_opts +# Fix ctest not automatically discovering tests +LDFLAGS=$(echo "${LDFLAGS}" | sed "s/-Wl,--gc-sections//g") +export CF="${CFLAGS} -Wno-unused-parameter -Wno-old-style-declaration" + +unset CFLAGS +export USE_OPENMP=1 +build_opts+=(USE_OPENMP=${USE_OPENMP}) +export PREFIX=${PREFIX} + +# Handle Fortran flags +if [ ! -z "$FFLAGS" ]; then + export FFLAGS="${FFLAGS/-fopenmp/ }" + export FFLAGS="${FFLAGS} -frecursive" + export LAPACK_FFLAGS="${FFLAGS}" +fi + +export PLATFORM=$(uname -m) +build_opts+=(BINARY="64") +build_opts+=(DYNAMIC_ARCH=1) +build_opts+=(TARGET="POWER9") +BUILD_BFLOAT16=1 + +# Placeholder for future builds that may include ILP64 variants. +build_opts+=(INTERFACE64=0) +build_opts+=(SYMBOLSUFFIX="") + +# Build LAPACK +build_opts+=(NO_LAPACK=0) + +# Enable threading and set the number of threads +build_opts+=(USE_THREAD=1) +build_opts+=(NUM_THREADS=8) + +# Disable CPU/memory affinity handling to avoid problems with NumPy and R +build_opts+=(NO_AFFINITY=1) + +# Build OpenBLAS +make -j8 ${build_opts[@]} CFLAGS="${CF}" FFLAGS="${FFLAGS}" prefix=${PREFIX} + +# Install OpenBLAS +CFLAGS="${CF}" FFLAGS="${FFLAGS}" make install PREFIX="${PREFIX}" ${build_opts[@]} +OpenBLASInstallPATH=$(pwd)/$PREFIX +OpenBLASConfigFile=$(find . -name OpenBLASConfig.cmake) +OpenBLASPCFile=$(find . -name openblas.pc) + +sed -i "/OpenBLAS_INCLUDE_DIRS/c\SET(OpenBLAS_INCLUDE_DIRS ${OpenBLASInstallPATH}/include)" ${OpenBLASConfigFile} +sed -i "/OpenBLAS_LIBRARIES/c\SET(OpenBLAS_INCLUDE_DIRS ${OpenBLASInstallPATH}/include)" ${OpenBLASConfigFile} +sed -i "s|libdir=local/openblas/lib|libdir=${OpenBLASInstallPATH}/lib|" ${OpenBLASPCFile} +sed -i "s|includedir=local/openblas/include|includedir=${OpenBLASInstallPATH}/include|" ${OpenBLASPCFile} + +export LD_LIBRARY_PATH="$OpenBLASInstallPATH/lib" +export PKG_CONFIG_PATH="$OpenBLASInstallPATH/lib/pkgconfig:${PKG_CONFIG_PATH}" + +echo " ------------------------------------------ Openblas Successfully Installed ------------------------------------------ " + +cd .. + +# install build tools for wheel generation +python3.12 -m pip install --upgrade pip setuptools wheel pytest numpy==2.2.6 + +# clone source repository +git clone $PACKAGE_URL +cd $PACKAGE_DIR +git checkout $PACKAGE_VERSION +git submodule update --init + +if ! python3.12 -m pip install . ; 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 + +#test +if ! python3.12 -m pytest -k "not test_segfault"; 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