22# -----------------------------------------------------------------------------
33#
44# Package : jaxlib
5- # Version : jaxlib-v0.4.7
5+ # Version : jaxlib-v0.4.23
66# Source repo : https://github.com/jax-ml/jax
77# Tested on : UBI:9.3
88# Language : Python
99# Ci-Check : True
1010# Script License : Apache License, Version 2 or later
11- # Maintainer : Stuti Wali <Stuti.Wali @ibm.com>
11+ # Maintainer : Shivansh Sharma <Shivansh.s1 @ibm.com>
1212#
1313# Disclaimer : This script has been tested in root mode on given
1414# ========== platform using the mentioned version of the package.
2121
2222# Variables
2323PACKAGE_NAME=jax
24- PACKAGE_VERSION=${1:- jaxlib-v0.4.7 }
24+ PACKAGE_VERSION=${1:- jaxlib-v0.4.23 }
2525PACKAGE_URL=https://github.com/jax-ml/jax
2626CURRENT_DIR=$pwd
2727
@@ -39,26 +39,35 @@ yum install -y java-11-openjdk-devel libtool xz libevent-devel clang java-11-
3939export JAVA_HOME=/usr/lib/jvm/$( ls /usr/lib/jvm/ | grep -P ' ^(?=.*java-11)(?=.*ppc64le)' )
4040export PATH=$JAVA_HOME /bin:$PATH
4141export LD_LIBRARY_PATH=/usr/lib64/:$LD_LIBRARY_PATH
42-
43- # dnf groupinstall -y "Development Tools"
44-
45- # installing bazel from source
42+
43+ # Install Bazel based on .bazelversion
4644echo " Installing bazel -------------------------------------------------------------"
45+ BAZEL_VERSION=" "
46+
47+ if [ -f " .bazelversion" ]; then
48+ BAZEL_VERSION=$( cat .bazelversion | tr -d ' [:space:]' )
49+ echo " Found .bazelversion: $BAZEL_VERSION "
50+ else
51+ echo " .bazelversion not found, falling back to default"
52+ BAZEL_VERSION=" 5.1.1"
53+ fi
54+
55+ echo " Installing Bazel version: $BAZEL_VERSION "
56+
4757mkdir bazel
4858cd bazel
49- wget https://github.com/bazelbuild/bazel/releases/download/5.1.1/bazel-5.1.1-dist.zip
50- unzip bazel-5.1.1-dist.zip
51- echo " Installing bazel -------------------------------------------------------------"
59+ wget https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION} /bazel-${BAZEL_VERSION} -dist.zip
60+ unzip bazel-${BAZEL_VERSION} -dist.zip
5261env EXTRA_BAZEL_ARGS=" --tool_java_runtime_version=local_jdk" bash ./compile.sh
5362cp output/bazel /usr/local/bin
5463export PATH=/usr/local/bin:$PATH
5564bazel --version
56- cd ..
57-
65+ cd $CURRENT_DIR
66+
5867echo " Installing dependencies via pip3-------------------------------------------------------------"
5968pip3 install numpy==1.26.4 scipy wheel pytest
6069pip3 install numpy==1.26.4 opt-einsum==3.3.0 ml-dtypes==0.5.0 absl-py
61-
70+
6271# Clone the repository
6372git clone $PACKAGE_URL
6473cd $PACKAGE_NAME
@@ -78,9 +87,9 @@ http_archive(
7887EOF
7988)
8089echo " $BORINGSSL_SUPPORT_CONTENT " > WORKSPACE-TEMP
81- cat WORKSPACE >> WORKSPACE-TEMP
90+ cat WORKSPACE >> WORKSPACE-TEMP
8291rm -rf WORKSPACE && mv WORKSPACE-TEMP WORKSPACE
83-
92+
8493cd build
8594# Install
8695echo " Building package-------------------------------------------------------------"
0 commit comments