diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-09-21 18:00:10 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-09-21 18:00:10 +0100 |
commit | 265dbe5dbc14c199299496c6db8fce3f76647015 (patch) | |
tree | ab18b5617d138f6684566b619405090989d55a2c /sci-libs/tensorflow/files | |
parent | 586819755b4dbfdffdc8a725ab7c0f86095b8489 (diff) |
gentoo resync : 21.09.2018
Diffstat (limited to 'sci-libs/tensorflow/files')
-rw-r--r-- | sci-libs/tensorflow/files/0001-pip_package-modularize-build-script-to-allow-distros.patch | 211 | ||||
-rw-r--r-- | sci-libs/tensorflow/files/tensorflow-1.8.0-0002-dont-strip.patch | 29 |
2 files changed, 0 insertions, 240 deletions
diff --git a/sci-libs/tensorflow/files/0001-pip_package-modularize-build-script-to-allow-distros.patch b/sci-libs/tensorflow/files/0001-pip_package-modularize-build-script-to-allow-distros.patch deleted file mode 100644 index ae17b4f46955..000000000000 --- a/sci-libs/tensorflow/files/0001-pip_package-modularize-build-script-to-allow-distros.patch +++ /dev/null @@ -1,211 +0,0 @@ -From 226dbf58ec54af0a44ec73b3a39ec5bee7cc8454 Mon Sep 17 00:00:00 2001 -From: Jason Zaman <jason@perfinion.com> -Date: Tue, 1 May 2018 19:55:53 +0800 -Subject: [PATCH] pip_package: modularize build script to allow distros to - install more flexibly - -Gentoo Linux handles python modules slightly differently and packaging -wheels is complicated. We prefer to run setup.py ourselves rather than -build a wheel and then install from there. - -This modularizes build_pip_package.sh to allow running parts separately. -using --src srcdir will prepare the package in a known dir so the distro -package can take it from there. If only dstdir is given (either with ---dst or as the only argument to preserve backwards compat) then -behaviour is the same as before, the sources are prepared and the wheel -is built and placed in dstdir. - -Signed-off-by: Jason Zaman <jason@perfinion.com> ---- - tensorflow/tools/pip_package/build_pip_package.sh | 141 ++++++++++++++++------ - 1 file changed, 105 insertions(+), 36 deletions(-) - -diff --git a/tensorflow/tools/pip_package/build_pip_package.sh b/tensorflow/tools/pip_package/build_pip_package.sh -index 3af79ee170..135846519c 100755 ---- a/tensorflow/tools/pip_package/build_pip_package.sh -+++ b/tensorflow/tools/pip_package/build_pip_package.sh -@@ -41,42 +41,15 @@ function is_windows() { - fi - } - --function main() { -+function prepare_src() { - if [ $# -lt 1 ] ; then - echo "No destination dir provided" - exit 1 - fi - -- DEST=$(real_path $1) -- TMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX) -- -- PKG_NAME_FLAG="" -- GPU_BUILD=0 -- NIGHTLY_BUILD=0 -- while true; do -- if [[ "$1" == "--nightly_flag" ]]; then -- NIGHTLY_BUILD=1 -- elif [[ "$1" == "--gpu" ]]; then -- GPU_BUILD=1 -- elif [[ "$1" == "--gpudirect" ]]; then -- PKG_NAME_FLAG="--project_name tensorflow_gpudirect" -- fi -- shift -- -- if [[ -z "$1" ]]; then -- break -- fi -- done -- -- if [[ ${NIGHTLY_BUILD} == "1" && ${GPU_BUILD} == "1" ]]; then -- PKG_NAME_FLAG="--project_name tf_nightly_gpu" -- elif [[ ${NIGHTLY_BUILD} == "1" ]]; then -- PKG_NAME_FLAG="--project_name tf_nightly" -- elif [[ ${GPU_BUILD} == "1" ]]; then -- PKG_NAME_FLAG="--project_name tensorflow_gpu" -- fi -- -- echo $(date) : "=== Using tmpdir: ${TMPDIR}" -+ TMPDIR="$1" -+ mkdir -p "$TMPDIR" -+ echo $(date) : "=== Preparing sources in dir: ${TMPDIR}" - - if [ ! -d bazel-bin/tensorflow ]; then - echo "Could not find bazel-bin. Did you run from the root of the build tree?" -@@ -148,17 +121,28 @@ function main() { - # over so user defined ops can be compiled. - mkdir -p ${TMPDIR}/google - mkdir -p ${TMPDIR}/third_party -- pushd ${RUNFILES%org_tensorflow} -+ pushd ${RUNFILES%org_tensorflow} > /dev/null - for header in $(find protobuf_archive -name \*.h); do - mkdir -p "${TMPDIR}/google/$(dirname ${header})" - cp "$header" "${TMPDIR}/google/$(dirname ${header})/" - done -- popd -+ popd > /dev/null - cp -R $RUNFILES/third_party/eigen3 ${TMPDIR}/third_party - - cp tensorflow/tools/pip_package/MANIFEST.in ${TMPDIR} - cp tensorflow/tools/pip_package/README ${TMPDIR} - cp tensorflow/tools/pip_package/setup.py ${TMPDIR} -+} -+ -+function build_wheel() { -+ if [ $# -lt 2 ] ; then -+ echo "No src and dest dir provided" -+ exit 1 -+ fi -+ -+ TMPDIR="$1" -+ DEST="$2" -+ PKG_NAME_FLAG="$3" - - # Before we leave the top-level directory, make sure we know how to - # call python. -@@ -166,15 +150,100 @@ function main() { - source tools/python_bin_path.sh - fi - -- pushd ${TMPDIR} -+ pushd ${TMPDIR} > /dev/null - rm -f MANIFEST - echo $(date) : "=== Building wheel" - "${PYTHON_BIN_PATH:-python}" setup.py bdist_wheel ${PKG_NAME_FLAG} >/dev/null - mkdir -p ${DEST} - cp dist/* ${DEST} -- popd -- rm -rf ${TMPDIR} -+ popd > /dev/null - echo $(date) : "=== Output wheel file is in: ${DEST}" - } - -+function usage() { -+ echo "Usage:" -+ echo "$0 [--src srcdir] [--dst dstdir] [options]" -+ echo "$0 dstdir [options]" -+ echo "" -+ echo " --src prepare sources in srcdir" -+ echo " will use temporary dir if not specified" -+ echo "" -+ echo " --dst build wheel in dstdir" -+ echo " if dstdir is not set do not build, only prepare sources" -+ echo "" -+ echo " Options:" -+ echo " --gpu build tensorflow_gpu" -+ echo " --gpudirect build tensorflow_gpudirect" -+ echo " --nightly_flag build tensorflow nightly" -+ echo "" -+ exit 1 -+} -+ -+function main() { -+ PKG_NAME_FLAG="" -+ GPU_BUILD=0 -+ NIGHTLY_BUILD=0 -+ SRCDIR="" -+ DSTDIR="" -+ CLEANSRC=1 -+ while true; do -+ if [[ "$1" == "--help" ]]; then -+ usage -+ exit 1 -+ elif [[ "$1" == "--nightly_flag" ]]; then -+ NIGHTLY_BUILD=1 -+ elif [[ "$1" == "--gpu" ]]; then -+ GPU_BUILD=1 -+ elif [[ "$1" == "--gpudirect" ]]; then -+ PKG_NAME_FLAG="--project_name tensorflow_gpudirect" -+ elif [[ "$1" == "--src" ]]; then -+ shift -+ SRCDIR="$(real_path $1)" -+ CLEANSRC=0 -+ elif [[ "$1" == "--dst" ]]; then -+ shift -+ DSTDIR="$(real_path $1)" -+ else -+ DSTDIR="$(real_path $1)" -+ fi -+ shift -+ -+ if [[ -z "$1" ]]; then -+ break -+ fi -+ done -+ -+ if [[ -z "$DSTDIR" ]] && [[ -z "$SRCDIR" ]]; then -+ echo "No destination dir provided" -+ usage -+ exit 1 -+ fi -+ -+ if [[ -z "$SRCDIR" ]]; then -+ # make temp srcdir if none set -+ SRCDIR="$(mktemp -d -t tmp.XXXXXXXXXX)" -+ fi -+ -+ prepare_src "$SRCDIR" -+ -+ if [[ -z "$DSTDIR" ]]; then -+ # only want to prepare sources -+ exit -+ fi -+ -+ if [[ ${NIGHTLY_BUILD} == "1" && ${GPU_BUILD} == "1" ]]; then -+ PKG_NAME_FLAG="--project_name tf_nightly_gpu" -+ elif [[ ${NIGHTLY_BUILD} == "1" ]]; then -+ PKG_NAME_FLAG="--project_name tf_nightly" -+ elif [[ ${GPU_BUILD} == "1" ]]; then -+ PKG_NAME_FLAG="--project_name tensorflow_gpu" -+ fi -+ -+ build_wheel "$SRCDIR" "$DSTDIR" "$PKG_NAME_FLAG" -+ -+ if [[ $CLEANSRC -ne 0 ]]; then -+ rm -rf ${TMPDIR} -+ fi -+} -+ - main "$@" --- -2.16.1 - diff --git a/sci-libs/tensorflow/files/tensorflow-1.8.0-0002-dont-strip.patch b/sci-libs/tensorflow/files/tensorflow-1.8.0-0002-dont-strip.patch deleted file mode 100644 index 9f828f3c8efc..000000000000 --- a/sci-libs/tensorflow/files/tensorflow-1.8.0-0002-dont-strip.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/tensorflow/BUILD b/tensorflow/BUILD -index cfafffdd13..8ed22ccfea 100644 ---- a/tensorflow/BUILD -+++ b/tensorflow/BUILD -@@ -470,7 +470,7 @@ tf_cc_shared_object( - # excludes all but a subset of function names. - # On MacOS, the linker does not support version_script, but has an - # an "-exported_symbols_list" command. -z defs disallows undefined --# symbols in object files and -s strips the output. -+# symbols in object files. - - tf_cc_shared_object( - name = "libtensorflow.so", -@@ -484,7 +484,6 @@ tf_cc_shared_object( - "//tensorflow:windows_msvc": [], - "//conditions:default": [ - "-z defs", -- "-s", - "-Wl,--version-script", # This line must be directly followed by the version_script.lds file - "$(location //tensorflow/c:version_script.lds)", - ], -@@ -510,7 +509,6 @@ tf_cc_shared_object( - "//tensorflow:windows_msvc": [], - "//conditions:default": [ - "-z defs", -- "-s", - "-Wl,--version-script", # This line must be directly followed by the version_script.lds file - "$(location //tensorflow:tf_version_script.lds)", - ], |