Date: Friday, June 30, 2017 @ 17:47:56 Author: svenstaro Revision: 241715
archrelease: copy trunk to community-x86_64 Added: tensorflow/repos/community-x86_64/10868.patch (from rev 241714, tensorflow/trunk/10868.patch) tensorflow/repos/community-x86_64/11174.patch (from rev 241714, tensorflow/trunk/11174.patch) tensorflow/repos/community-x86_64/PKGBUILD (from rev 241714, tensorflow/trunk/PKGBUILD) Deleted: tensorflow/repos/community-x86_64/10868.patch tensorflow/repos/community-x86_64/PKGBUILD -------------+ 10868.patch | 178 ++++++++++++++++++++--------------------- 11174.patch | 36 ++++++++ PKGBUILD | 250 +++++++++++++++++++++++++++++----------------------------- 3 files changed, 252 insertions(+), 212 deletions(-) Deleted: 10868.patch =================================================================== --- 10868.patch 2017-06-30 17:47:42 UTC (rev 241714) +++ 10868.patch 2017-06-30 17:47:56 UTC (rev 241715) @@ -1,89 +0,0 @@ -From eb197c45eda55b1047b00f1136a4fec2b8adb2d5 Mon Sep 17 00:00:00 2001 -From: Todd Wang <toddw...@gmail.com> -Date: Tue, 20 Jun 2017 14:16:26 -0700 -Subject: [PATCH 1/3] [XLA] Explicitly instantiate Permute template func - -This is an attempted fix for older compilers that can't deduce the template args. ---- - tensorflow/compiler/xla/service/llvm_ir/ir_array.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc b/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc -index e401305ae73..b14104be6ad 100644 ---- a/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc -+++ b/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc -@@ -158,7 +158,7 @@ IrArray::Index IrArray::Index::SourceIndexOfTranspose( - tensorflow::gtl::ArraySlice<int64> dimension_mapping, - llvm::IRBuilder<>* builder) const { - std::vector<llvm::Value*> operand_multidim_index = -- Permute(dimension_mapping, multidim()); -+ Permute<std::vector, llvm::Value*>(dimension_mapping, multidim()); - if (linear() != nullptr && - ShapeUtil::TransposeIsBitcast(operand_shape, shape, dimension_mapping)) { - return Index(operand_multidim_index, linear(), operand_shape); - -From 2df6cd3acd71a6dcf459e92c26ac426c90a57be4 Mon Sep 17 00:00:00 2001 -From: Todd Wang <toddw...@gmail.com> -Date: Wed, 21 Jun 2017 17:51:55 -0700 -Subject: [PATCH 2/3] Another try - ---- - tensorflow/compiler/xla/util.h | 17 ++++++++++++----- - 1 file changed, 12 insertions(+), 5 deletions(-) - -diff --git a/tensorflow/compiler/xla/util.h b/tensorflow/compiler/xla/util.h -index 42d5c1d1550..32aa81d1f42 100644 ---- a/tensorflow/compiler/xla/util.h -+++ b/tensorflow/compiler/xla/util.h -@@ -195,16 +195,23 @@ bool IsPermutation(tensorflow::gtl::ArraySlice<int64> permutation, int64 rank); - // 2. permutation.size() == input.size(). - template <template <typename...> class C, typename T> - std::vector<T> Permute(tensorflow::gtl::ArraySlice<int64> permutation, -- C<T> input_) { -- tensorflow::gtl::ArraySlice<T> input(input_); -- CHECK(IsPermutation(permutation, input.size())); -- std::vector<T> output(input.size()); -+ C<T> input) { -+ tensorflow::gtl::ArraySlice<T> data(input); -+ CHECK(IsPermutation(permutation, data.size())); -+ std::vector<T> output(data.size()); - for (size_t i = 0; i < permutation.size(); ++i) { -- output[permutation[i]] = input[i]; -+ output[permutation[i]] = data[i]; - } - return output; - } - -+// Override of the above that works around compile failures with vectors. -+template <typename T> -+std::vector<T> Permute(tensorflow::gtl::ArraySlice<int64> permutation, -+ const std::vector<T>& input) { -+ return Permute<std::vector, T>(permutation, input); -+} -+ - // Inverts a permutation, i.e., output_permutation[input_permutation[i]] = i. - std::vector<int64> InversePermutation( - tensorflow::gtl::ArraySlice<int64> input_permutation); - -From 03da6113468d6b256a755d0521b9b239eaf8b6a9 Mon Sep 17 00:00:00 2001 -From: Todd Wang <toddw...@gmail.com> -Date: Wed, 21 Jun 2017 17:54:15 -0700 -Subject: [PATCH 3/3] Update ir_array.cc - ---- - tensorflow/compiler/xla/service/llvm_ir/ir_array.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc b/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc -index b14104be6ad..e401305ae73 100644 ---- a/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc -+++ b/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc -@@ -158,7 +158,7 @@ IrArray::Index IrArray::Index::SourceIndexOfTranspose( - tensorflow::gtl::ArraySlice<int64> dimension_mapping, - llvm::IRBuilder<>* builder) const { - std::vector<llvm::Value*> operand_multidim_index = -- Permute<std::vector, llvm::Value*>(dimension_mapping, multidim()); -+ Permute(dimension_mapping, multidim()); - if (linear() != nullptr && - ShapeUtil::TransposeIsBitcast(operand_shape, shape, dimension_mapping)) { - return Index(operand_multidim_index, linear(), operand_shape); Copied: tensorflow/repos/community-x86_64/10868.patch (from rev 241714, tensorflow/trunk/10868.patch) =================================================================== --- 10868.patch (rev 0) +++ 10868.patch 2017-06-30 17:47:56 UTC (rev 241715) @@ -0,0 +1,89 @@ +From eb197c45eda55b1047b00f1136a4fec2b8adb2d5 Mon Sep 17 00:00:00 2001 +From: Todd Wang <toddw...@gmail.com> +Date: Tue, 20 Jun 2017 14:16:26 -0700 +Subject: [PATCH 1/3] [XLA] Explicitly instantiate Permute template func + +This is an attempted fix for older compilers that can't deduce the template args. +--- + tensorflow/compiler/xla/service/llvm_ir/ir_array.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc b/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc +index e401305ae73..b14104be6ad 100644 +--- a/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc ++++ b/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc +@@ -158,7 +158,7 @@ IrArray::Index IrArray::Index::SourceIndexOfTranspose( + tensorflow::gtl::ArraySlice<int64> dimension_mapping, + llvm::IRBuilder<>* builder) const { + std::vector<llvm::Value*> operand_multidim_index = +- Permute(dimension_mapping, multidim()); ++ Permute<std::vector, llvm::Value*>(dimension_mapping, multidim()); + if (linear() != nullptr && + ShapeUtil::TransposeIsBitcast(operand_shape, shape, dimension_mapping)) { + return Index(operand_multidim_index, linear(), operand_shape); + +From 2df6cd3acd71a6dcf459e92c26ac426c90a57be4 Mon Sep 17 00:00:00 2001 +From: Todd Wang <toddw...@gmail.com> +Date: Wed, 21 Jun 2017 17:51:55 -0700 +Subject: [PATCH 2/3] Another try + +--- + tensorflow/compiler/xla/util.h | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/tensorflow/compiler/xla/util.h b/tensorflow/compiler/xla/util.h +index 42d5c1d1550..32aa81d1f42 100644 +--- a/tensorflow/compiler/xla/util.h ++++ b/tensorflow/compiler/xla/util.h +@@ -195,16 +195,23 @@ bool IsPermutation(tensorflow::gtl::ArraySlice<int64> permutation, int64 rank); + // 2. permutation.size() == input.size(). + template <template <typename...> class C, typename T> + std::vector<T> Permute(tensorflow::gtl::ArraySlice<int64> permutation, +- C<T> input_) { +- tensorflow::gtl::ArraySlice<T> input(input_); +- CHECK(IsPermutation(permutation, input.size())); +- std::vector<T> output(input.size()); ++ C<T> input) { ++ tensorflow::gtl::ArraySlice<T> data(input); ++ CHECK(IsPermutation(permutation, data.size())); ++ std::vector<T> output(data.size()); + for (size_t i = 0; i < permutation.size(); ++i) { +- output[permutation[i]] = input[i]; ++ output[permutation[i]] = data[i]; + } + return output; + } + ++// Override of the above that works around compile failures with vectors. ++template <typename T> ++std::vector<T> Permute(tensorflow::gtl::ArraySlice<int64> permutation, ++ const std::vector<T>& input) { ++ return Permute<std::vector, T>(permutation, input); ++} ++ + // Inverts a permutation, i.e., output_permutation[input_permutation[i]] = i. + std::vector<int64> InversePermutation( + tensorflow::gtl::ArraySlice<int64> input_permutation); + +From 03da6113468d6b256a755d0521b9b239eaf8b6a9 Mon Sep 17 00:00:00 2001 +From: Todd Wang <toddw...@gmail.com> +Date: Wed, 21 Jun 2017 17:54:15 -0700 +Subject: [PATCH 3/3] Update ir_array.cc + +--- + tensorflow/compiler/xla/service/llvm_ir/ir_array.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc b/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc +index b14104be6ad..e401305ae73 100644 +--- a/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc ++++ b/tensorflow/compiler/xla/service/llvm_ir/ir_array.cc +@@ -158,7 +158,7 @@ IrArray::Index IrArray::Index::SourceIndexOfTranspose( + tensorflow::gtl::ArraySlice<int64> dimension_mapping, + llvm::IRBuilder<>* builder) const { + std::vector<llvm::Value*> operand_multidim_index = +- Permute<std::vector, llvm::Value*>(dimension_mapping, multidim()); ++ Permute(dimension_mapping, multidim()); + if (linear() != nullptr && + ShapeUtil::TransposeIsBitcast(operand_shape, shape, dimension_mapping)) { + return Index(operand_multidim_index, linear(), operand_shape); Copied: tensorflow/repos/community-x86_64/11174.patch (from rev 241714, tensorflow/trunk/11174.patch) =================================================================== --- 11174.patch (rev 0) +++ 11174.patch 2017-06-30 17:47:56 UTC (rev 241715) @@ -0,0 +1,36 @@ +From 0c0005e3eb83b0e0c4903d2ec4223a58ef115e54 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C3=ABl=20Defferrard?= <michael.defferr...@epfl.ch> +Date: Fri, 30 Jun 2017 13:47:39 +0000 +Subject: [PATCH] Only use weakref.finalize from backports in Python < 3.4 + +--- + tensorflow/python/util/tf_should_use.py | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/tensorflow/python/util/tf_should_use.py b/tensorflow/python/util/tf_should_use.py +index 05c99856d27..491b78f1dd3 100644 +--- a/tensorflow/python/util/tf_should_use.py ++++ b/tensorflow/python/util/tf_should_use.py +@@ -25,7 +25,12 @@ + + import six # pylint: disable=unused-import + +-from backports import weakref # pylint: disable=g-bad-import-order ++# pylint: disable=g-bad-import-order ++try: ++ from weakref import finalize ++except ImportError: ++ from backports.weakref import finalize ++# pylint: enable=g-bad-import-order + + from tensorflow.python.platform import tf_logging + from tensorflow.python.util import tf_decorator +@@ -107,7 +112,7 @@ def __init__(self, true_self): + # garbage collected. Can't add self as the args because the + # loop will break garbage collection. We keep track of + # ourselves via python ids. +- weakref.finalize(self, _deleted, self._tf_ref_id, fatal_error) ++ finalize(self, _deleted, self._tf_ref_id, fatal_error) + + # Not sure why this pylint warning is being used; this is not an + # old class form. Deleted: PKGBUILD =================================================================== --- PKGBUILD 2017-06-30 17:47:42 UTC (rev 241714) +++ PKGBUILD 2017-06-30 17:47:56 UTC (rev 241715) @@ -1,123 +0,0 @@ -# Maintainer: Sven-Hendrik Haase <s...@lutzhaase.com> -# Contributor: Adria Arrufat (archdria) <adria.arrufat+...@protonmail.ch> -# Contributor: Thibault Lorrain (fredszaq) <freds...@gmail.com> - -pkgbase=tensorflow -pkgname=(tensorflow tensorflow-cuda python-tensorflow python-tensorflow-cuda) -pkgver=1.2.1 -pkgrel=1 -pkgdesc="Library for computation using data flow graphs for scalable machine learning" -url="https://www.tensorflow.org/" -license=('Apache2') -arch=('x86_64') -makedepends=('git' 'bazel' 'python-numpy' 'gcc5' 'cuda' 'cudnn' 'python-pip' 'python-wheel' 'python-setuptools') -source=("https://github.com/tensorflow/tensorflow/archive/v${pkgver}.tar.gz" - 10868.patch - https://raw.githubusercontent.com/tensorflow/tensorflow/847484e39485dc727dd72a0970d5bfb5c2d5e538/tensorflow/c/generate-pc.sh) -sha512sums=('bed3d2173db41d5d6882dbe2bafac3b6cd541acc2e6bb73c838fbf34160a3fe4cff83e0ee0cf79a8081928701cc9752dc5bea7bf733ffadb7745a974e0467b0f' - '90940827ea6cbc6694b14ea276a37c5f8af027317873d67a8b40802d8d75a81984c283335bf62cc5b5fa63023c9cc9b414a145d3019124127c5f15472bfdfcec' - '9a1d82df83881c662d088ccd5b21abcb8b46726f2090f64d968d270d99e3b7bbd6b3c9dae6e83479ff724a47238384df95ed67d0d096d97231c793e7f63a1034') - -prepare() { - patch -Np1 -d tensorflow-${pkgver} < ${srcdir}/10868.patch - # We'll not need this in >1.2 - cp ${srcdir}/generate-pc.sh tensorflow-${pkgver}/tensorflow/c/generate-pc.sh - - cp -r tensorflow-${pkgver} tensorflow-${pkgver}-cuda - # These environment variables influence the behavior of the configure call below. - export TF_NEED_MKL=0 - export PYTHON_BIN_PATH=/usr/bin/python - export USE_DEFAULT_PYTHON_LIB_PATH=1 - export CC_OPT_FLAGS="-march=x86-64" - export TF_NEED_JEMALLOC=1 - export TF_NEED_GCP=0 - export TF_NEED_HDFS=0 - export TF_ENABLE_XLA=1 - export TF_NEED_VERBS=0 - export TF_NEED_OPENCL=0 -} - -build() { - cd ${srcdir}/tensorflow-${pkgver} - - export TF_NEED_CUDA=0 - - ./configure - bazel build --config=opt //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package - bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmp - - cd ${srcdir}/tensorflow-${pkgver}-cuda - - export TF_NEED_CUDA=1 - export GCC_HOST_COMPILER_PATH=/usr/bin/gcc-5 - # For next version instead of the gcc-5 stuff: - export TF_CUDA_CLANG=0 - # export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang - export CUDA_TOOLKIT_PATH=/opt/cuda - export TF_CUDA_VERSION=$($CUDA_TOOLKIT_PATH/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p') - export CUDNN_INSTALL_PATH=/opt/cuda - export TF_CUDNN_VERSION=$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' $CUDNN_INSTALL_PATH/include/cudnn.h) - export TF_CUDA_COMPUTE_CAPABILITIES=3.0,3.5,5.2,6.1 - - ./configure - bazel build --config=opt --config=cuda //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package - bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpcuda -} - -package_tensorflow() { - 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/lib${pkgname}.so - install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/${pkgname}/c/c_api.h - install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE -} - -package_tensorflow-cuda() { - depends=(cuda cudnn) - conflicts=(tensorflow) - provides=(tensorflow) - - 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/lib${pkgname}.so - install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/${pkgname}/c/c_api.h - install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE -} - -package_python-tensorflow() { - depends=(python python-protobuf) - optdepends=('python-werkzeug: for using tensorboard' - 'python-bleach: for using tensorboard' - 'python-markdown: for using tensorboard') - - cd ${srcdir}/tensorflow-${pkgver} - - WHEEL_PACKAGE=$(find ${srcdir}/tmp -name "tensor*.whl") - pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies - find ${pkgdir} -name __pycache__ -exec rm -r {} + - - install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE -} - -package_python-tensorflow-cuda() { - depends=(python cuda cudnn python-pycuda python-protobuf) - conflicts=(python-tensorflow) - provides=(python-tensorflow) - optdepends=('python-werkzeug: for using tensorboard' - 'python-bleach: for using tensorboard' - 'python-markdown: for using tensorboard') - - cd ${srcdir}/tensorflow-${pkgver}-cuda - - WHEEL_PACKAGE=$(find ${srcdir}/tmpcuda -name "tensor*.whl") - pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies - find ${pkgdir} -name __pycache__ -exec rm -r {} + - - install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE -} - -# vim:set ts=2 sw=2 et: Copied: tensorflow/repos/community-x86_64/PKGBUILD (from rev 241714, tensorflow/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2017-06-30 17:47:56 UTC (rev 241715) @@ -0,0 +1,127 @@ +# Maintainer: Sven-Hendrik Haase <s...@lutzhaase.com> +# Contributor: Adria Arrufat (archdria) <adria.arrufat+...@protonmail.ch> +# Contributor: Thibault Lorrain (fredszaq) <freds...@gmail.com> + +pkgbase=tensorflow +pkgname=(tensorflow tensorflow-cuda python-tensorflow python-tensorflow-cuda) +pkgver=1.2.1 +pkgrel=2 +pkgdesc="Library for computation using data flow graphs for scalable machine learning" +url="https://www.tensorflow.org/" +license=('Apache2') +arch=('x86_64') +makedepends=('git' 'bazel' 'python-numpy' 'gcc5' 'cuda' 'cudnn' 'python-pip' 'python-wheel' 'python-setuptools') +source=("https://github.com/tensorflow/tensorflow/archive/v${pkgver}.tar.gz" + 10868.patch + 11174.patch + https://raw.githubusercontent.com/tensorflow/tensorflow/847484e39485dc727dd72a0970d5bfb5c2d5e538/tensorflow/c/generate-pc.sh) +sha512sums=('bed3d2173db41d5d6882dbe2bafac3b6cd541acc2e6bb73c838fbf34160a3fe4cff83e0ee0cf79a8081928701cc9752dc5bea7bf733ffadb7745a974e0467b0f' + '90940827ea6cbc6694b14ea276a37c5f8af027317873d67a8b40802d8d75a81984c283335bf62cc5b5fa63023c9cc9b414a145d3019124127c5f15472bfdfcec' + 'a6c13050a1e5398546e3879a5ce805211b79a5947becb486974e67cedfd1dae87773a21a4614343eca6f956ceda9e5b46e0ac7f259b685a83f412f41d051a6b7' + '9a1d82df83881c662d088ccd5b21abcb8b46726f2090f64d968d270d99e3b7bbd6b3c9dae6e83479ff724a47238384df95ed67d0d096d97231c793e7f63a1034') + +prepare() { + patch -Np1 -d tensorflow-${pkgver} < ${srcdir}/10868.patch + patch -Np1 -d tensorflow-${pkgver} < ${srcdir}/11174.patch + + # We'll not need this in >1.2 + cp ${srcdir}/generate-pc.sh tensorflow-${pkgver}/tensorflow/c/generate-pc.sh + + cp -r tensorflow-${pkgver} tensorflow-${pkgver}-cuda + # These environment variables influence the behavior of the configure call below. + export TF_NEED_MKL=0 + export PYTHON_BIN_PATH=/usr/bin/python + export USE_DEFAULT_PYTHON_LIB_PATH=1 + export CC_OPT_FLAGS="-march=x86-64" + export TF_NEED_JEMALLOC=1 + export TF_NEED_GCP=0 + export TF_NEED_HDFS=0 + export TF_ENABLE_XLA=1 + export TF_NEED_VERBS=0 + export TF_NEED_OPENCL=0 +} + +build() { + cd ${srcdir}/tensorflow-${pkgver} + + export TF_NEED_CUDA=0 + + ./configure + bazel build --config=opt //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package + bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmp + + cd ${srcdir}/tensorflow-${pkgver}-cuda + + export TF_NEED_CUDA=1 + export GCC_HOST_COMPILER_PATH=/usr/bin/gcc-5 + # For next version instead of the gcc-5 stuff: + export TF_CUDA_CLANG=0 + # export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang + export CUDA_TOOLKIT_PATH=/opt/cuda + export TF_CUDA_VERSION=$($CUDA_TOOLKIT_PATH/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p') + export CUDNN_INSTALL_PATH=/opt/cuda + export TF_CUDNN_VERSION=$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' $CUDNN_INSTALL_PATH/include/cudnn.h) + export TF_CUDA_COMPUTE_CAPABILITIES=3.0,3.5,5.2,6.1 + + ./configure + bazel build --config=opt --config=cuda //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package + bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpcuda +} + +package_tensorflow() { + 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/lib${pkgname}.so + install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/${pkgname}/c/c_api.h + install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE +} + +package_tensorflow-cuda() { + depends=(cuda cudnn) + conflicts=(tensorflow) + provides=(tensorflow) + + 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/lib${pkgname}.so + install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/${pkgname}/c/c_api.h + install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE +} + +package_python-tensorflow() { + depends=(python python-protobuf) + optdepends=('python-werkzeug: for using tensorboard' + 'python-bleach: for using tensorboard' + 'python-markdown: for using tensorboard') + + cd ${srcdir}/tensorflow-${pkgver} + + WHEEL_PACKAGE=$(find ${srcdir}/tmp -name "tensor*.whl") + pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies + find ${pkgdir} -name __pycache__ -exec rm -r {} + + + install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE +} + +package_python-tensorflow-cuda() { + depends=(python cuda cudnn python-pycuda python-protobuf) + conflicts=(python-tensorflow) + provides=(python-tensorflow) + optdepends=('python-werkzeug: for using tensorboard' + 'python-bleach: for using tensorboard' + 'python-markdown: for using tensorboard') + + cd ${srcdir}/tensorflow-${pkgver}-cuda + + WHEEL_PACKAGE=$(find ${srcdir}/tmpcuda -name "tensor*.whl") + pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies + find ${pkgdir} -name __pycache__ -exec rm -r {} + + + install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE +} + +# vim:set ts=2 sw=2 et: