[arch-commits] Commit in tensorflow/trunk (PKGBUILD)

Konstantin Gizdov kgizdov at archlinux.org
Tue Mar 26 21:34:04 UTC 2019


    Date: Tuesday, March 26, 2019 @ 21:34:02
  Author: kgizdov
Revision: 443708

patch protobuf to compile against CUDA 10.1

Modified:
  tensorflow/trunk/PKGBUILD

----------+
 PKGBUILD |  148 ++++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 79 insertions(+), 69 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-03-26 21:33:09 UTC (rev 443707)
+++ PKGBUILD	2019-03-26 21:34:02 UTC (rev 443708)
@@ -7,20 +7,28 @@
 pkgname=(tensorflow tensorflow-opt tensorflow-cuda tensorflow-opt-cuda python-tensorflow python-tensorflow-opt python-tensorflow-cuda python-tensorflow-opt-cuda)
 pkgver=1.13.1
 _pkgver=1.13.1
-pkgrel=2
+pkgrel=3
 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')
-makedepends=('bazel' 'python-numpy' 'cuda' 'nvidia-utils' 'nccl' 'git' 'gcc7'
+makedepends=('bazel=0.22.0' 'python-numpy' 'cuda' 'nvidia-utils' 'nccl' 'git' 'gcc7'
              'cudnn' 'python-pip' 'python-wheel' 'python-setuptools' 'python-h5py'
              'python-keras-applications' 'python-keras-preprocessing')
 optdepends=('tensorboard: Tensorflow visualization toolkit')
-source=("https://github.com/tensorflow/tensorflow/archive/v${_pkgver}.tar.gz")
-sha512sums=('1e5c020a82b0b502c9c6fc9439905e19e8f1fb07e32740a5e2c70f4a3565c8c87053ccdcad360e95550dad648154e399ca8e352fb97a1788acfec3b87bf323bb')
+source=("https://github.com/tensorflow/tensorflow/archive/v${_pkgver}.tar.gz"
+        'protobuf_temp_fix_cuda10.1_apply.patch'
+        'protobuf_temp_fix_cuda10.1.patch')
+sha512sums=('1e5c020a82b0b502c9c6fc9439905e19e8f1fb07e32740a5e2c70f4a3565c8c87053ccdcad360e95550dad648154e399ca8e352fb97a1788acfec3b87bf323bb'
+            '770afd62612abac4fcef6919f75d1ac3519030d917ce8b277de4f88b76f5449c2ad7af81fbbcd17f5e799d637f188de200f078211f13809373d8f0378bb01754'
+            '5900002170aab40144453d3d0d1b097475d0cbc48c5901147214e38ed7d8634ea9207fc187b44129c878b0355676a531cb4807d4f2124f6110a20cbb61172c18')
 
 prepare() {
+  # https://github.com/tensorflow/tensorflow/issues/26155
+  patch -d tensorflow-${_pkgver} -Np1 -i "${srcdir}/protobuf_temp_fix_cuda10.1_apply.patch"
+  cp "${srcdir}/protobuf_temp_fix_cuda10.1.patch" "${srcdir}/tensorflow-${_pkgver}/third_party"/
+
   cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-opt
   cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-cuda
   cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-opt-cuda
@@ -45,13 +53,13 @@
   export TF_NEED_ROCM=0
   export TF_SET_ANDROID_WORKSPACE=0
   export TF_DOWNLOAD_CLANG=0
-  export TF_NCCL_VERSION=2.3
+  export TF_NCCL_VERSION=2.4
   export NCCL_INSTALL_PATH=/usr
   export TF_IGNORE_MAX_BAZEL_VERSION=1
 }
 
 build() {
-  cd ${srcdir}/tensorflow-${_pkgver}
+  cd "${srcdir}"/tensorflow-${_pkgver}
   export CC_OPT_FLAGS="-march=x86-64"
   export TF_NEED_CUDA=0
   ./configure
@@ -61,12 +69,13 @@
       //tensorflow:libtensorflow_cc.so \
       //tensorflow:install_headers \
       //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmp
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package "${srcdir}"/tmp
 
-  cd ${srcdir}/tensorflow-${_pkgver}-cuda
+  cd "${srcdir}"/tensorflow-${_pkgver}-cuda
   export CC_OPT_FLAGS="-march=x86-64"
   export TF_NEED_CUDA=1
   export GCC_HOST_COMPILER_PATH=/usr/bin/gcc-7
+  export HOST_CXX_COMPILER_PATH=/usr/bin/gcc-7
   export TF_CUDA_CLANG=0
   # export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang
   export CUDA_TOOLKIT_PATH=/opt/cuda
@@ -81,9 +90,9 @@
       //tensorflow:libtensorflow_cc.so \
       //tensorflow:install_headers \
       //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpcuda
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package "${srcdir}"/tmpcuda
 
-  cd ${srcdir}/tensorflow-${_pkgver}-opt
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt
   export CC_OPT_FLAGS="-march=haswell"
   export TF_NEED_CUDA=0
   ./configure
@@ -93,12 +102,13 @@
       //tensorflow:libtensorflow_cc.so \
       //tensorflow:install_headers \
       //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpopt
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package "${srcdir}"/tmpopt
 
-  cd ${srcdir}/tensorflow-${_pkgver}-opt-cuda
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt-cuda
   export CC_OPT_FLAGS="-march=haswell"
   export TF_NEED_CUDA=1
   export GCC_HOST_COMPILER_PATH=/usr/bin/gcc-7
+  export HOST_CXX_COMPILER_PATH=/usr/bin/gcc-7
   export TF_CUDA_CLANG=0
   # export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang
   export CUDA_TOOLKIT_PATH=/opt/cuda
@@ -113,22 +123,22 @@
       //tensorflow:libtensorflow_cc.so \
       //tensorflow:install_headers \
       //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpcudaopt
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package "${srcdir}"/tmpcudaopt
 }
 
 package_tensorflow() {
-  cd ${srcdir}/tensorflow-${_pkgver}
+  cd "${srcdir}"/tensorflow-${_pkgver}
 
   tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
-  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
-  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_cc.so ${pkgdir}/usr/lib/libtensorflow_cc.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
-  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+  install -Dm644 tensorflow.pc "${pkgdir}"/usr/lib/pkgconfig/tensorflow.pc
+  install -Dm755 bazel-bin/tensorflow/libtensorflow.so "${pkgdir}"/usr/lib/libtensorflow.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_cc.so "${pkgdir}"/usr/lib/libtensorflow_cc.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so "${pkgdir}"/usr/lib/libtensorflow_framework.so
+  install -Dm644 tensorflow/c/c_api.h "${pkgdir}"/usr/include/tensorflow/c/c_api.h
+  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
 
-  mkdir -p ${pkgdir}/usr/include/tensorflow/
-  cp -r bazel-genfiles/tensorflow/include/tensorflow ${pkgdir}/usr/include/
+  mkdir -p "${pkgdir}"/usr/include/tensorflow/
+  cp -r bazel-genfiles/tensorflow/include/tensorflow "${pkgdir}"/usr/include/
 }
 
 package_tensorflow-opt() {
@@ -136,18 +146,18 @@
   provides=(tensorflow)
   pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CPU optimizations)"
 
-  cd ${srcdir}/tensorflow-${_pkgver}-opt
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt
 
   tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
-  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
-  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_cc.so ${pkgdir}/usr/lib/libtensorflow_cc.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
-  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+  install -Dm644 tensorflow.pc "${pkgdir}"/usr/lib/pkgconfig/tensorflow.pc
+  install -Dm755 bazel-bin/tensorflow/libtensorflow.so "${pkgdir}"/usr/lib/libtensorflow.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_cc.so "${pkgdir}"/usr/lib/libtensorflow_cc.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so "${pkgdir}"/usr/lib/libtensorflow_framework.so
+  install -Dm644 tensorflow/c/c_api.h "${pkgdir}"/usr/include/tensorflow/c/c_api.h
+  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
 
-  mkdir -p ${pkgdir}/usr/include/tensorflow/
-  cp -r bazel-genfiles/tensorflow/include/tensorflow ${pkgdir}/usr/include/
+  mkdir -p "${pkgdir}"/usr/include/tensorflow/
+  cp -r bazel-genfiles/tensorflow/include/tensorflow "${pkgdir}"/usr/include/
 }
 
 package_tensorflow-cuda() {
@@ -156,18 +166,18 @@
   provides=(tensorflow)
   pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA)"
 
-  cd ${srcdir}/tensorflow-${_pkgver}-cuda
+  cd "${srcdir}"/tensorflow-${_pkgver}-cuda
 
   tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
-  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
-  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_cc.so ${pkgdir}/usr/lib/libtensorflow_cc.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
-  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+  install -Dm644 tensorflow.pc "${pkgdir}"/usr/lib/pkgconfig/tensorflow.pc
+  install -Dm755 bazel-bin/tensorflow/libtensorflow.so "${pkgdir}"/usr/lib/libtensorflow.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_cc.so "${pkgdir}"/usr/lib/libtensorflow_cc.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so "${pkgdir}"/usr/lib/libtensorflow_framework.so
+  install -Dm644 tensorflow/c/c_api.h "${pkgdir}"/usr/include/tensorflow/c/c_api.h
+  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
 
-  mkdir -p ${pkgdir}/usr/include/tensorflow/
-  cp -r bazel-genfiles/tensorflow/include/tensorflow ${pkgdir}/usr/include/
+  mkdir -p "${pkgdir}"/usr/include/tensorflow/
+  cp -r bazel-genfiles/tensorflow/include/tensorflow "${pkgdir}"/usr/include/
 }
 
 package_tensorflow-opt-cuda() {
@@ -176,34 +186,34 @@
   provides=(tensorflow tensorflow-cuda)
   pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA and CPU optimizations)"
 
-  cd ${srcdir}/tensorflow-${_pkgver}-opt-cuda
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt-cuda
 
   tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
-  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
-  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_cc.so ${pkgdir}/usr/lib/libtensorflow_cc.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
-  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+  install -Dm644 tensorflow.pc "${pkgdir}"/usr/lib/pkgconfig/tensorflow.pc
+  install -Dm755 bazel-bin/tensorflow/libtensorflow.so "${pkgdir}"/usr/lib/libtensorflow.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_cc.so "${pkgdir}"/usr/lib/libtensorflow_cc.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so "${pkgdir}"/usr/lib/libtensorflow_framework.so
+  install -Dm644 tensorflow/c/c_api.h "${pkgdir}"/usr/include/tensorflow/c/c_api.h
+  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
 
-  mkdir -p ${pkgdir}/usr/include/tensorflow/
-  cp -r bazel-genfiles/tensorflow/include/tensorflow ${pkgdir}/usr/include/
+  mkdir -p "${pkgdir}"/usr/include/tensorflow/
+  cp -r bazel-genfiles/tensorflow/include/tensorflow "${pkgdir}"/usr/include/
 }
 
 package_python-tensorflow() {
   depends+=(python-termcolor python-astor python-gast python-numpy python-protobuf absl-py python-h5py python-keras-applications python-keras-preprocessing python-tensorflow-estimator)
 
-  cd ${srcdir}/tensorflow-${_pkgver}
+  cd "${srcdir}"/tensorflow-${_pkgver}
 
-  WHEEL_PACKAGE=$(find ${srcdir}/tmp -name "tensor*.whl")
-  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
+  WHEEL_PACKAGE=$(find "${srcdir}"/tmp -name "tensor*.whl")
+  pip install --ignore-installed --upgrade --root "${pkgdir}"/ $WHEEL_PACKAGE --no-dependencies
 
   # tensorboard has been separated from upstream but they still install it with
   # tensorflow. I don't know what kind of sense that makes but we have to clean
   # it out from this pacakge.
-  rm -rf ${pkgdir}/usr/bin/tensorboard
+  rm -rf "${pkgdir}"/usr/bin/tensorboard
 
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
 }
 
 package_python-tensorflow-opt() {
@@ -212,17 +222,17 @@
   provides=(python-tensorflow)
   pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CPU optimizations)"
 
-  cd ${srcdir}/tensorflow-${_pkgver}-opt
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt
 
-  WHEEL_PACKAGE=$(find ${srcdir}/tmpopt -name "tensor*.whl")
-  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
+  WHEEL_PACKAGE=$(find "${srcdir}"/tmpopt -name "tensor*.whl")
+  pip install --ignore-installed --upgrade --root "${pkgdir}"/ $WHEEL_PACKAGE --no-dependencies
 
   # tensorboard has been separated from upstream but they still install it with
   # tensorflow. I don't know what kind of sense that makes but we have to clean
   # it out from this pacakge.
-  rm -rf ${pkgdir}/usr/bin/tensorboard
+  rm -rf "${pkgdir}"/usr/bin/tensorboard
 
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
 }
 
 package_python-tensorflow-cuda() {
@@ -231,17 +241,17 @@
   provides=(python-tensorflow)
   pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA)"
 
-  cd ${srcdir}/tensorflow-${_pkgver}-cuda
+  cd "${srcdir}"/tensorflow-${_pkgver}-cuda
 
-  WHEEL_PACKAGE=$(find ${srcdir}/tmpcuda -name "tensor*.whl")
-  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
+  WHEEL_PACKAGE=$(find "${srcdir}"/tmpcuda -name "tensor*.whl")
+  pip install --ignore-installed --upgrade --root "${pkgdir}"/ $WHEEL_PACKAGE --no-dependencies
 
   # tensorboard has been separated from upstream but they still install it with
   # tensorflow. I don't know what kind of sense that makes but we have to clean
   # it out from this pacakge.
-  rm -rf ${pkgdir}/usr/bin/tensorboard
+  rm -rf "${pkgdir}"/usr/bin/tensorboard
 
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
 }
 
 package_python-tensorflow-opt-cuda() {
@@ -250,17 +260,17 @@
   provides=(python-tensorflow python-tensorflow-cuda)
   pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA and CPU optimizations)"
 
-  cd ${srcdir}/tensorflow-${_pkgver}-opt-cuda
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt-cuda
 
-  WHEEL_PACKAGE=$(find ${srcdir}/tmpcudaopt -name "tensor*.whl")
-  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
+  WHEEL_PACKAGE=$(find "${srcdir}"/tmpcudaopt -name "tensor*.whl")
+  pip install --ignore-installed --upgrade --root "${pkgdir}"/ $WHEEL_PACKAGE --no-dependencies
 
   # tensorboard has been separated from upstream but they still install it with
   # tensorflow. I don't know what kind of sense that makes but we have to clean
   # it out from this pacakge.
-  rm -rf ${pkgdir}/usr/bin/tensorboard
+  rm -rf "${pkgdir}"/usr/bin/tensorboard
 
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
 }
 
 # vim:set ts=2 sw=2 et:


More information about the arch-commits mailing list