From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 55C221382C5 for ; Wed, 18 Apr 2018 16:53:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 909DFE08A2; Wed, 18 Apr 2018 16:53:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5EF05E08A2 for ; Wed, 18 Apr 2018 16:53:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C5DE5335C06 for ; Wed, 18 Apr 2018 16:53:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3B94D270 for ; Wed, 18 Apr 2018 16:53:06 +0000 (UTC) From: "Martin Mokrejs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Martin Mokrejs" Message-ID: <1524070370.d3e2915edd509df1b98cd0fb8ef70b259af9f9a0.mmokrejs@gentoo> Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/tensorflow/ X-VCS-Repository: proj/sci X-VCS-Files: sci-libs/tensorflow/tensorflow-1.7.0.ebuild X-VCS-Directories: sci-libs/tensorflow/ X-VCS-Committer: mmokrejs X-VCS-Committer-Name: Martin Mokrejs X-VCS-Revision: d3e2915edd509df1b98cd0fb8ef70b259af9f9a0 X-VCS-Branch: master Date: Wed, 18 Apr 2018 16:53:06 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 621e1b91-7ba8-4f20-91ba-08ad1e7310da X-Archives-Hash: cfde4a94bc1f1b722913a3dbd624cdaa commit: d3e2915edd509df1b98cd0fb8ef70b259af9f9a0 Author: Martin Mokrejs fold natur cuni cz> AuthorDate: Wed Apr 18 16:52:50 2018 +0000 Commit: Martin Mokrejs fold natur cuni cz> CommitDate: Wed Apr 18 16:52:50 2018 +0000 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=d3e2915e sci-libs/tensorflow: more ebuild tweaks (still not working) - partially incorporate changes from https://github.com/gentoo/sci/issues/862 - respect more USE flags: cuda mpi - similar addition of opencl use flag doe snot work for me, repoman complains with: IUSE.invalid [fatal] 1 sci-libs/tensorflow/tensorflow-1.7.0.ebuild: opencl - try to install into python's site-packages properly (cannot test it) - the ebuild does not work for me still (SANDBOX VIOLATION due to /proc/self/setgroups access) Package-Manager: Portage-2.3.28, Repoman-2.3.9 sci-libs/tensorflow/tensorflow-1.7.0.ebuild | 42 +++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/sci-libs/tensorflow/tensorflow-1.7.0.ebuild b/sci-libs/tensorflow/tensorflow-1.7.0.ebuild index d411ba0ac..75f5d499d 100644 --- a/sci-libs/tensorflow/tensorflow-1.7.0.ebuild +++ b/sci-libs/tensorflow/tensorflow-1.7.0.ebuild @@ -23,24 +23,25 @@ IUSE="cuda mpi" # TensorFlow 1.7 may be the last time we support cuDNN versions below 6.0. # Starting with TensorFlow 1.8 release, 6.0 will be the minimum supported # version. -DEPEND="dev-util/bazel +DEPEND=" + dev-util/bazel dev-python/wheel dev-python/numpy dev-libs/protobuf-c dev-python/absl-py cuda? ( >=dev-util/nvidia-cuda-toolkit-7.0[profiler] >=dev-libs/cudnn-3 ) mpi? ( virtual/mpi )" + #opencl? ( virtual/opencl )" RDEPEND="${DEPEND}" -# TODO: seems it also supports some MPI implementation - +# TODO: seems it also supports some MPI implementations src_configure(){ # there is no setup.py but there is configure # https://www.tensorflow.org/install/install_sources # https://www.tensorflow.org/install/install_linux#InstallingNativePip # # usage: configure.py [-h] [--workspace WORKSPACE] - python_configure() { + python_configure() { export PYTHON_BIN_PATH=${PYTHON} export PYTHON_LIB_PATH=${PYTHON_SITEDIR} export TF_NEED_JEMALLOC=1 @@ -52,8 +53,16 @@ src_configure(){ export TF_NEED_GDR=0 export TF_NEED_VERBS=0 export TF_NEED_OPENCL=0 - export TF_NEED_CUDA=0 - export TF_NEED_MPI=0 + if use cuda; then + export TF_NEED_CUDA=1 + else + export TF_NEED_CUDA=0 + fi + if use mpi; then + export TF_NEED_MPI=1 + else + export TF_NEED_MPI=0 + fi export TF_NEED_OPENCL_SYCL=0 export CC_OPT_FLAGS=${CFLAGS} export JAVA_HOME=$(java-config -O) @@ -63,12 +72,16 @@ src_configure(){ python_foreach_impl python_configure } - src_compile() { python_compile() { # huh, by default tensorflow links static libs? See BUILD file # set framework_shared_object=true somehow - bazel build --config=opt /tensorflow/tools/pip_package:build_pip_package || die + if use cuda; then + opt="--config=cuda" + else + opt="" + fi + bazel build --config=opt ${opt} /tensorflow/tools/pip_package:build_pip_package || die bazel-bin/tensorflow/tools/pip_package/build_pip_package tensorflow_pkg || die unzip -o -d tensorflow_pkg tensorflow_pkg/${P}-cp35-cp35m-linux_x86_64.whl || die python_domodule tensorflow_pkg/${P}.data/purelib/tensorflow @@ -77,3 +90,16 @@ src_compile() { } python_foreach_impl python_compile } + +src_test() { + python_foreach_impl python_test +} + +src_install() { + python_install() { + python_copy_sources tensorflow_pkg/${P}.data/purelib/tensorflow/ + python_copy_sources tensorflow_pkg/${P}.dist-info + } + python_foreach_impl python_install + einstalldocs +}