Skip to content

Commit

Permalink
Add py3.12 to tf-build container
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfurmanek committed Aug 1, 2024
1 parent b00c7ee commit 78a7e17
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions tensorflow/tools/tf_sig_build_dockerfiles/setup.build-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ elif [ "$PYTHON_VERSION" = "3.11" ]; then
scl enable devtoolset-9 'bash'
rm -f /usr/bin/ld && ln -s /opt/rh/devtoolset-9/root/usr/bin/ld /usr/bin/ld

NUMPY_VERSION=1.21.4
elif [ "$PYTHON_VERSION" = "3.12" ]; then
#install openssl1.1.1
wget --no-check-certificate https://ftp.openssl.org/source/openssl-1.1.1k.tar.gz && tar xvf openssl-1.1.1k.tar.gz && cd openssl-1.1.1k &&
./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic && make && make install

wget https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tgz && tar xvf Python-3.12.4.tgz && cd Python-3.12*/ &&
sed -i 's/PKG_CONFIG openssl /PKG_CONFIG openssl11 /g' configure && ./configure --enable-optimizations && make altinstall
ln -sf /usr/local/bin/python3.12 /usr/bin/python3 && ln -sf /usr/local/bin/pip3.12 /usr/bin/pip3
ln -sf /usr/local/lib/python3.12 /usr/lib/tf_python

scl enable devtoolset-9 'bash'
rm -f /usr/bin/ld && ln -s /opt/rh/devtoolset-9/root/usr/bin/ld /usr/bin/ld

NUMPY_VERSION=1.21.4
else
printf '%s\n' "Python Version not Supported" >&2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ elif [ "$PYTHON_VERSION" = "3.12" ]; then
wget --no-check-certificate https://ftp.openssl.org/source/openssl-1.1.1k.tar.gz && tar xvf openssl-1.1.1k.tar.gz && cd openssl-1.1.1k &&
./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic && make && make install

wget https://www.python.org/ftp/python/3.12.3/Python-3.12.3.tgz && tar xvf Python-3.12.3.tgz && cd Python-3.12*/ &&
wget https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tgz && tar xvf Python-3.12.4.tgz && cd Python-3.12*/ &&
sed -i 's/PKG_CONFIG openssl /PKG_CONFIG openssl11 /g' configure && ./configure --enable-optimizations && make altinstall
ln -sf /usr/local/bin/python3.12 /usr/bin/python3 && ln -sf /usr/local/bin/pip3.12 /usr/bin/pip3
ln -sf /usr/local/lib/python3.12 /usr/lib/tf_python
Expand Down
1 change: 1 addition & 0 deletions tensorflow/tools/tf_sig_build_dockerfiles/setup.python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function build_python_from_src() {
[python3.9]='3.9.12'
[python3.10]='3.10.9'
[python3.11]='3.11.2'
[python3.12]='3.12.4'
)
local _ver=${python_map[$VERSION]}
wget https://www.python.org/ftp/python/${_ver}/Python-${_ver}.tgz
Expand Down

0 comments on commit 78a7e17

Please sign in to comment.