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 79E431382C5 for ; Mon, 9 Apr 2018 16:56:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C0BFAE06FE; Mon, 9 Apr 2018 16:56:05 +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 8C08AE06FE for ; Mon, 9 Apr 2018 16:56:04 +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 C0F44335C0A for ; Mon, 9 Apr 2018 16:56:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 073B5274 for ; Mon, 9 Apr 2018 16:56:00 +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: <1523292942.d4716dbcfa408f14649ecf58d015c167cb57ded0.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: d4716dbcfa408f14649ecf58d015c167cb57ded0 X-VCS-Branch: master Date: Mon, 9 Apr 2018 16:56:00 +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: 5b4b1b74-8eaa-4407-8b11-6ef3765e1635 X-Archives-Hash: 2c19e317a091163ddc7f803cffef20c0 commit: d4716dbcfa408f14649ecf58d015c167cb57ded0 Author: Martin Mokrejs fold natur cuni cz> AuthorDate: Mon Apr 9 16:55:42 2018 +0000 Commit: Martin Mokrejs fold natur cuni cz> CommitDate: Mon Apr 9 16:55:42 2018 +0000 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=d4716dbc sci-libs/tensorflow: more tweaks to use bazel build system It does not build for me and later runs in sandbox violation error. Possibly the build system could respect USE=mkl too. The autogenerated? BUILD file speaks of static libs being output instead of shared libs. It also mentions how to call linker when linking 3rd-party apps against these libs. Package-Manager: Portage-2.3.27, Repoman-2.3.9 sci-libs/tensorflow/tensorflow-1.7.0.ebuild | 40 +++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/sci-libs/tensorflow/tensorflow-1.7.0.ebuild b/sci-libs/tensorflow/tensorflow-1.7.0.ebuild index 0dae0c1d0..d411ba0ac 100644 --- a/sci-libs/tensorflow/tensorflow-1.7.0.ebuild +++ b/sci-libs/tensorflow/tensorflow-1.7.0.ebuild @@ -5,7 +5,7 @@ EAPI=6 PYTHON_COMPAT=( python2_7 python3_{3,4,5,6} ) -inherit distutils-r1 eutils +inherit python-r1 distutils-r1 eutils DESCRIPTION="Library for numerical computation using data flow graphs" HOMEPAGE="https://www.tensorflow.org @@ -27,6 +27,7 @@ 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 )" RDEPEND="${DEPEND}" @@ -39,5 +40,40 @@ src_configure(){ # https://www.tensorflow.org/install/install_linux#InstallingNativePip # # usage: configure.py [-h] [--workspace WORKSPACE] - ./configure || die + python_configure() { + export PYTHON_BIN_PATH=${PYTHON} + export PYTHON_LIB_PATH=${PYTHON_SITEDIR} + export TF_NEED_JEMALLOC=1 + export TF_NEED_GCP=0 + export TF_NEED_HDFS=0 + export TF_NEED_S3=0 + export TF_NEED_KAFKA=0 + export TF_ENABLE_XLA=0 + 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 + export TF_NEED_OPENCL_SYCL=0 + export CC_OPT_FLAGS=${CFLAGS} + export JAVA_HOME=$(java-config -O) + # TODO: protect by a USE flag test --config=mkl + ./configure || die + } + 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 + 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 + bazel test || die + bazel shutdown || die + } + python_foreach_impl python_compile }