Date: Sunday, January 8, 2023 @ 11:50:11 Author: svenstaro Revision: 1381995
upgpkg: tensorflow 2.11.0-2: Rebuild using python-installer instead of pip Modified: tensorflow/trunk/PKGBUILD ----------+ PKGBUILD | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2023-01-08 11:44:46 UTC (rev 1381994) +++ PKGBUILD 2023-01-08 11:50:11 UTC (rev 1381995) @@ -7,20 +7,22 @@ pkgname=(tensorflow tensorflow-opt tensorflow-cuda tensorflow-opt-cuda python-tensorflow python-tensorflow-opt python-tensorflow-cuda python-tensorflow-opt-cuda) pkgver=2.11.0 _pkgver=2.11.0 -pkgrel=1 +pkgrel=2 pkgdesc="Library for computation using data flow graphs for scalable machine learning" url="https://www.tensorflow.org/" license=('APACHE') arch=('x86_64') depends=('c-ares' 'pybind11' 'openssl' 'lmdb' 'libpng' 'curl' 'giflib' 'icu' 'libjpeg-turbo' 'openmp') -makedepends=('bazel' 'python-numpy' 'cuda' 'nvidia-utils' 'nccl' 'git' 'cudnn' 'python-pip' 'python-wheel' - 'python-setuptools' 'python-h5py' 'python-keras-applications' 'python-keras-preprocessing' - 'cython' 'patchelf' 'python-requests') +makedepends=('bazel' 'python-numpy' 'cuda' 'nvidia-utils' 'nccl' 'git' 'cudnn' 'python-wheel' + 'python-installer' 'python-setuptools' 'python-h5py' 'python-keras-applications' + 'python-keras-preprocessing' 'cython' 'patchelf' 'python-requests') optdepends=('tensorboard: Tensorflow visualization toolkit') source=("$pkgname-$pkgver.tar.gz::https://github.com/tensorflow/tensorflow/archive/v${_pkgver}.tar.gz" + https://github.com/bazelbuild/bazel/releases/download/5.4.0/bazel_nojdk-5.4.0-linux-x86_64 fix-c++17-compat.patch fix-cusolver-version.patch) sha512sums=('cda16db72a0ede72ac9f5e76c3a745ea9d72421fa40021303032f8fc3ac2755f64524f97a4629c18cf888f259027439b49ec921e0f5fd329a6ba060235a658d5' + 'e2adb747cd1fe3c90686831703618af3f8bc8197a96d9e1e90e66db38dbc4e7a94d88dac755b25e288002983a87fcffbfb0d7c2e356d979d4635301c3daf9281' 'f682368bb47b2b022a51aa77345dfa30f3b0d7911c56515d428b8326ee3751242f375f4e715a37bb723ef20a86916dad9871c3c81b1b58da85e1ca202bc4901e' '6f42455db1db0a5cd58ab5fe5554317e9ff648c046bb81cef9b4c61cce8380da08b681f825544b5388f02da863ff19f642efa9459691cbcf8852a21bd0dc7447') @@ -59,6 +61,12 @@ # Allow any bazel version echo "*" > tensorflow-${_pkgver}/.bazelversion + # Since Tensorflow is currently imcompatible with Bazel 6, we're going to use + # a local Bazel 5 to fix that. Stupid problems call for stupid solutions. + install -Dm755 "${srcdir}"/bazel_nojdk-5.4.0-linux-x86_64 bazel/bazel + export PATH="${srcdir}/bazel:$PATH" + bazel --version + # Get rid of hardcoded versions. Not like we ever cared about what upstream # thinks about which versions should be used anyway. ;) (FS#68772) sed -i -E "s/'([0-9a-z_-]+) .= [0-9].+[0-9]'/'\1'/" tensorflow-${_pkgver}/tensorflow/tools/pip_package/setup.py @@ -99,7 +107,7 @@ # Does tensorflow really need the compiler overridden in 5 places? Yes. export CC=gcc-11 export CXX=g++-11 - export GCC_HOST_COMPILER_PATH=/usr/bin/${CC} + export GCC_HOST_COMPILER_PATH=/opt/cuda/bin/gcc export HOST_C_COMPILER=/usr/bin/${CC} export HOST_CXX_COMPILER=/usr/bin/${CXX} export TF_CUDA_CLANG=0 # Clang currently disabled because it's not compatible at the moment. @@ -182,7 +190,7 @@ cp -r bazel-bin/tensorflow/include/* "${pkgdir}"/usr/include/tensorflow/ # install python-version to get all extra headers WHEEL_PACKAGE=$(find "${srcdir}"/$1 -name "tensor*.whl") - pip install --ignore-installed --upgrade --root "${pkgdir}"/ $WHEEL_PACKAGE --no-dependencies + python -m installer --destdir="$pkgdir" $WHEEL_PACKAGE # move extra headers to correct location local _srch_path="${pkgdir}/usr/lib/python$(get_pyver)"/site-packages/tensorflow/include check_dir "${_srch_path}" # we need to quit on broken search paths @@ -227,7 +235,7 @@ _python_package() { WHEEL_PACKAGE=$(find "${srcdir}"/$1 -name "tensor*.whl") - pip install --ignore-installed --upgrade --root "${pkgdir}"/ $WHEEL_PACKAGE --no-dependencies + python -m installer --destdir="$pkgdir" $WHEEL_PACKAGE # create symlinks to headers local _srch_path="${pkgdir}/usr/lib/python$(get_pyver)"/site-packages/tensorflow/include/
