aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wright <gienah@gentoo.org>2018-05-02 14:55:44 +1000
committerMark Wright <gienah@gentoo.org>2018-05-02 14:55:44 +1000
commit1c845e66f1f35f54b72789fa8e787c59ccbed19f (patch)
tree2181a55ffdf9d6308a3ce68fe6b95dd6bde130ed
parentsci-biology/quorum: drop old (diff)
downloadsci-1c845e66f1f35f54b72789fa8e787c59ccbed19f.zip
sci-1c845e66f1f35f54b72789fa8e787c59ccbed19f.tar.gz
sci-1c845e66f1f35f54b72789fa8e787c59ccbed19f.tar.bz2
sci-libs/tensorflow: Use CPPFLAGS, CXXFLAGS, LDFLAGS.
Setting CPPFLAGS should help #861 sci-libs/tensorflow: respect EPREFIX. Require [${PYTHON_USEDEP}] on Python deps, which should help the dev-python/wheel not working in #849 sci-libs/tensorflow: new package, ebuilds with IUSE="cuda mpi" need improvements. Package-Manager: Portage-2.3.31, Repoman-2.3.9
-rw-r--r--sci-libs/tensorflow/tensorflow-1.8.0.ebuild40
1 files changed, 33 insertions, 7 deletions
diff --git a/sci-libs/tensorflow/tensorflow-1.8.0.ebuild b/sci-libs/tensorflow/tensorflow-1.8.0.ebuild
index 15e09b5..cfef9ea 100644
--- a/sci-libs/tensorflow/tensorflow-1.8.0.ebuild
+++ b/sci-libs/tensorflow/tensorflow-1.8.0.ebuild
@@ -37,13 +37,13 @@ IUSE="cuda cxx mpi"
# dev-python/gast
DEPEND="
cxx? ( dev-libs/protobuf )
- dev-python/absl-py
- dev-python/astor
- dev-python/numpy
- dev-python/protobuf-python
- dev-python/six
- dev-python/termcolor
- dev-python/wheel
+ dev-python/absl-py[${PYTHON_USEDEP}]
+ dev-python/astor[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/protobuf-python[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ dev-python/termcolor[${PYTHON_USEDEP}]
+ dev-python/wheel[${PYTHON_USEDEP}]
dev-libs/jemalloc
dev-libs/protobuf-c
dev-util/bazel
@@ -109,17 +109,43 @@ src_compile() {
addpredict /proc
local opt=$(usex cuda "--config=cuda" "")
+ local fs=""
+ for i in ${CXXFLAGS}; do
+ [[ -n "${fs}" ]] && fs+=" "
+ fs+="--cxxopt=${i}"
+ done
+ for i in ${CPPFLAGS}; do
+ [[ -n "${fs}" ]] && fs+=" "
+ fs+="--copt=${i}"
+ fs+="--cxxopt=${i}"
+ done
+ for i in ${LDFLAGS}; do
+ [[ -n "${fs}" ]] && fs+=" "
+ fs+="--linkopt=${i}"
+ done
einfo ">>> Compiling ${PN} C"$(usex cxx " and C++" "")
+ einfo " bazel build \\"
+ einfo " --config=opt ${opt} \\"
+ einfo " ${fs} \\"
+ einfo " //tensorflow:libtensorflow.so \\"
+ einfo " //tensorflow:libtensorflow_framework.so \\"
+ einfo " "$(usex cxx "//tensorflow:libtensorflow_cc.so" "")
bazel build \
--config=opt ${opt} \
+ ${fs} \
//tensorflow:libtensorflow.so \
//tensorflow:libtensorflow_framework.so \
$(usex cxx "//tensorflow:libtensorflow_cc.so" "") || die
python_compile() {
einfo ">>> Compiling ${PN} ${MULTIBUILD_VARIANT}"
+ einfo " bazel build \\"
+ einfo " --config=opt ${opt} \\"
+ einfo " ${fs} \\"
+ einfo " //tensorflow/tools/pip_package:build_pip_package"
bazel build \
--config=opt ${opt} \
+ ${fs} \
//tensorflow/tools/pip_package:build_pip_package || die
bazel-bin/tensorflow/tools/pip_package/build_pip_package tensorflow_pkg || die
unzip -o -d ${PN}_pkg_${MULTIBUILD_VARIANT} ${PN}_pkg/${P}-*.whl || die