3535# Note: "libtensorflow_framework.so.2" need to be added to the allowlisted
3636# files (for example, in "policy.json" in "/home/${USER}/.local/lib/
3737# python3.9/site-packages/auditwheel/policy/policy.json").
38- # This change is done automatically (see "patch_auditwell " function). If
38+ # This change is done automatically (see "patch_auditwheel " function). If
3939# the automatic patch does not work, it has to be done manually by adding
4040# "libtensorflow_framework.so.2" next to each "libresolv.so.2" entries
4141# See https://github.com/tensorflow/tensorflow/issues/31807
5858# Temporary directory used to assemble the package.
5959SRCPK=" $( pwd) /tmp_package"
6060
61- function patch_auditwell () {
61+ function patch_auditwheel () {
6262 PYTHON=" $1 "
6363 shift
6464 # Patch auditwheel for TensorFlow
65- AUDITWHELL_DIR =" $( ${PYTHON} -m pip show auditwheel | grep " Location:" ) "
66- AUDITWHELL_DIR =" ${AUDITWHELL_DIR : 10} /auditwheel"
67- echo " Auditwell location: ${AUDITWHELL_DIR } "
68- POLICY_PATH=" ${AUDITWHELL_DIR } /policy/manylinux-policy.json"
65+ AUDITWHEEL_DIR =" $( ${PYTHON} -m pip show auditwheel | grep " Location:" ) "
66+ AUDITWHEEL_DIR =" ${AUDITWHEEL_DIR : 10} /auditwheel"
67+ echo " Auditweel location: ${AUDITWHEEL_DIR } "
68+ POLICY_PATH=" ${AUDITWHEEL_DIR } /policy/manylinux-policy.json"
6969 TF_DYNAMIC_FILENAME=" libtensorflow_framework.so.2"
7070 if ! grep -q " ${TF_DYNAMIC_FILENAME} " " ${POLICY_PATH} " ; then
71- echo " Patching Auditwhell "
71+ echo " Patching Auditwheel "
7272 cp " ${POLICY_PATH} " " ${POLICY_PATH} .orig"
7373 if is_macos; then
7474 sed -i ' ' " s/\" libresolv.so.2\" /\" libresolv.so.2\" ,\" ${TF_DYNAMIC_FILENAME} \" /g" " ${POLICY_PATH} "
7575 else
7676 sed -i " s/\" libresolv.so.2\" /\" libresolv.so.2\" ,\" ${TF_DYNAMIC_FILENAME} \" /g" " ${POLICY_PATH} "
7777 fi
7878 else
79- echo " Auditwhell already patched"
79+ echo " Auditwheel already patched"
8080 fi
8181}
8282
@@ -186,7 +186,7 @@ function e2e_native() {
186186 PACKAGE=$( python_to_package_version ${PYTHON} )
187187
188188 install_dependencies ${PYTHON}
189- patch_auditwell ${PYTHON}
189+ patch_auditwheel ${PYTHON}
190190 build_package ${PYTHON}
191191 test_package ${PYTHON} ${PACKAGE}
192192
@@ -196,6 +196,11 @@ function e2e_native() {
196196 else
197197 PACKAGEPATH=" dist/tensorflow_decision_forests-*-cp${PACKAGE} -cp${PACKAGE} *-linux_x86_64.whl"
198198 fi
199+ TF_LFLAGS=" $( ${PYTHON} -c ' import tensorflow as tf; print(tf.sysconfig.get_link_flags()[0])' ) "
200+ SHARED_LIBRARY_DIR=${TF_LFLAGS: 2}
201+ echo " Old LD_LIBRARY_PATH was ${LD_LIBRARY_PATH} "
202+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH :$SHARED_LIBRARY_DIR
203+ echo " New LD_LIBRARY_PATH is ${LD_LIBRARY_PATH} "
199204 auditwheel repair --plat manylinux2014_x86_64 -w dist ${PACKAGEPATH}
200205}
201206
@@ -225,10 +230,20 @@ shift | true
225230
226231if [ ${INSTALL_PYENV} == " INSTALL_PYENV" ]; then
227232 if ! [ -x " $( command -v pyenv) " ]; then
228- echo ' Pyenv is not installed. Installing Pyenv'
229- git clone --branch v1.2.23 https://github.com/pyenv/pyenv.git
233+ echo " Pyenv not found."
234+ echo " Installing build deps, pyenv 2.3.0 and pyenv virtualenv 1.1.5"
235+ apt-get update
236+ apt-get install -qq make build-essential libssl-dev zlib1g-dev \
237+ libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
238+ libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev \
239+ libffi-dev liblzma-dev
240+ git clone --branch v2.3.0 https://github.com/pyenv/pyenv.git
230241 PYENV_ROOT=" $( pwd) /pyenv"
231242 export PATH=" $PYENV_ROOT /bin:$PATH "
243+ eval " $( pyenv init -) "
244+ git clone --branch v1.1.5 https://github.com/pyenv/pyenv-virtualenv.git $( pyenv root) /plugins/pyenv-virtualenv
245+ eval " $( pyenv virtualenv-init -) "
246+ source ~ /.profile
232247 fi
233248fi
234249
@@ -242,16 +257,16 @@ elif [ ${ARG} == "ALL_VERSIONS" ]; then
242257 # Compile with all the version of python using pyenv.
243258 assemble_files
244259 eval " $( pyenv init -) "
245- e2e_pyenv 3.9.13
260+ e2e_pyenv 3.9.12
246261 e2e_pyenv 3.8.13
247262 e2e_pyenv 3.7.13
248- e2e_pyenv 3.10.6
263+ e2e_pyenv 3.10.4
249264elif [ ${ARG} == " ALL_VERSIONS_ALREADY_ASSEMBLED" ]; then
250265 eval " $( pyenv init -) "
251- e2e_pyenv 3.9.13
266+ e2e_pyenv 3.9.12
252267 e2e_pyenv 3.8.13
253268 e2e_pyenv 3.7.13
254- e2e_pyenv 3.10.6
269+ e2e_pyenv 3.10.4
255270else
256271 # Compile with a specific version of python provided in the call arguments.
257272 assemble_files
0 commit comments