diff --git a/.ci_support/README b/.ci_support/README new file mode 100644 index 0000000000000000000000000000000000000000..e4e2dcec93ed8e44f5ac196c2ba23afc7bdb9936 --- /dev/null +++ b/.ci_support/README @@ -0,0 +1 @@ +This file is automatically generated by conda-smithy. To change any matrix elements, you should change conda-smithy's input conda_build_config.yaml and re-render the recipe, rather than editing these files directly. \ No newline at end of file diff --git a/.ci_support/linux_64_python3.6.____cpython.yaml b/.ci_support/linux_64_python3.6.____cpython.yaml new file mode 100644 index 0000000000000000000000000000000000000000..26fde42f619cce201094291bea28eb13ba7d1664 --- /dev/null +++ b/.ci_support/linux_64_python3.6.____cpython.yaml @@ -0,0 +1,39 @@ +c_compiler: +- gcc +c_compiler_version: +- '7' +cdt_name: +- cos6 +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +cxx_compiler: +- gxx +cxx_compiler_version: +- '7' +docker_image: +- quay.io/condaforge/linux-anvil-comp7 +libcurl: +- '7' +libpng: +- '1.6' +pin_run_as_build: + libcurl: + max_pin: x + libpng: + max_pin: x.x + python: + min_pin: x.x + max_pin: x.x + zlib: + max_pin: x.x +python: +- 3.6.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +zlib: +- '1.2' diff --git a/.ci_support/linux_64_python3.7.____cpython.yaml b/.ci_support/linux_64_python3.7.____cpython.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cb66d5c306271beaa0f76e5010583d1f7e6ed4cd --- /dev/null +++ b/.ci_support/linux_64_python3.7.____cpython.yaml @@ -0,0 +1,39 @@ +c_compiler: +- gcc +c_compiler_version: +- '7' +cdt_name: +- cos6 +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +cxx_compiler: +- gxx +cxx_compiler_version: +- '7' +docker_image: +- quay.io/condaforge/linux-anvil-comp7 +libcurl: +- '7' +libpng: +- '1.6' +pin_run_as_build: + libcurl: + max_pin: x + libpng: + max_pin: x.x + python: + min_pin: x.x + max_pin: x.x + zlib: + max_pin: x.x +python: +- 3.7.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +zlib: +- '1.2' diff --git a/.ci_support/linux_64_python3.8.____cpython.yaml b/.ci_support/linux_64_python3.8.____cpython.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d0c5e866ce60e698ab71a64443329847b44bb8d4 --- /dev/null +++ b/.ci_support/linux_64_python3.8.____cpython.yaml @@ -0,0 +1,39 @@ +c_compiler: +- gcc +c_compiler_version: +- '7' +cdt_name: +- cos6 +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +cxx_compiler: +- gxx +cxx_compiler_version: +- '7' +docker_image: +- quay.io/condaforge/linux-anvil-comp7 +libcurl: +- '7' +libpng: +- '1.6' +pin_run_as_build: + libcurl: + max_pin: x + libpng: + max_pin: x.x + python: + min_pin: x.x + max_pin: x.x + zlib: + max_pin: x.x +python: +- 3.8.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +zlib: +- '1.2' diff --git a/.ci_support/osx_64_python3.6.____cpython.yaml b/.ci_support/osx_64_python3.6.____cpython.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e5f17c2bd2bbd55471408f0c405b71932196b0c9 --- /dev/null +++ b/.ci_support/osx_64_python3.6.____cpython.yaml @@ -0,0 +1,16 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.9' +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +macos_machine: +- x86_64-apple-darwin13.4.0 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.6.* *_cpython +target_platform: +- osx-64 diff --git a/.ci_support/osx_64_python3.7.____cpython.yaml b/.ci_support/osx_64_python3.7.____cpython.yaml new file mode 100644 index 0000000000000000000000000000000000000000..163d3ce627616e4c07d4080a359a0a36a791915c --- /dev/null +++ b/.ci_support/osx_64_python3.7.____cpython.yaml @@ -0,0 +1,16 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.9' +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +macos_machine: +- x86_64-apple-darwin13.4.0 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.7.* *_cpython +target_platform: +- osx-64 diff --git a/.ci_support/osx_64_python3.8.____cpython.yaml b/.ci_support/osx_64_python3.8.____cpython.yaml new file mode 100644 index 0000000000000000000000000000000000000000..63cee21d973393d4e192b3ac1c94986422e63eb8 --- /dev/null +++ b/.ci_support/osx_64_python3.8.____cpython.yaml @@ -0,0 +1,16 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.9' +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +macos_machine: +- x86_64-apple-darwin13.4.0 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.8.* *_cpython +target_platform: +- osx-64 diff --git a/.ci_support/win_64_python3.6.____cpython.yaml b/.ci_support/win_64_python3.6.____cpython.yaml new file mode 100644 index 0000000000000000000000000000000000000000..96be81f2dc82ea9a06ef68ae7d983e95a217a362 --- /dev/null +++ b/.ci_support/win_64_python3.6.____cpython.yaml @@ -0,0 +1,12 @@ +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.6.* *_cpython +target_platform: +- win-64 diff --git a/.ci_support/win_64_python3.7.____cpython.yaml b/.ci_support/win_64_python3.7.____cpython.yaml new file mode 100644 index 0000000000000000000000000000000000000000..281bd46025a1a7e2aa49d59cf3c32177622b82a7 --- /dev/null +++ b/.ci_support/win_64_python3.7.____cpython.yaml @@ -0,0 +1,12 @@ +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.7.* *_cpython +target_platform: +- win-64 diff --git a/.ci_support/win_64_python3.8.____cpython.yaml b/.ci_support/win_64_python3.8.____cpython.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0840c1a97ec52cc344c35122235d75274075ac6c --- /dev/null +++ b/.ci_support/win_64_python3.8.____cpython.yaml @@ -0,0 +1,12 @@ +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.8.* *_cpython +target_platform: +- win-64 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..9060b272b25719c02fac7599ddf8a2c30d192016 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,25 @@ +* text=auto + +*.patch binary +*.diff binary +meta.yaml text eol=lf +build.sh text eol=lf +bld.bat text eol=crlf + +# github helper pieces to make some files not show up in diffs automatically +.azure-pipelines/* linguist-generated=true +.circleci/* linguist-generated=true +.drone/* linguist-generated=true +.drone.yml linguist-generated=true +.github/* linguist-generated=true +.travis/* linguist-generated=true +.appveyor.yml linguist-generated=true +.gitattributes linguist-generated=true +.gitignore linguist-generated=true +.travis.yml linguist-generated=true +.scripts/* linguist-generated=true +LICENSE.txt linguist-generated=true +README.md linguist-generated=true +azure-pipelines.yml linguist-generated=true +build-locally.py linguist-generated=true +shippable.yml linguist-generated=true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..c89ecb7d69f1d663169e586f55f68f1cb7875290 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.pyc + +build_artifacts diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh new file mode 100755 index 0000000000000000000000000000000000000000..aa9727b9f1413b1555a0b2e8baea35d41847c10a --- /dev/null +++ b/.scripts/build_steps.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +# benefit from the improvement. + +set -xeuo pipefail +export PYTHONUNBUFFERED=1 +export FEEDSTOCK_ROOT="${FEEDSTOCK_ROOT:-/home/conda/feedstock_root}" +export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}" +export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" +export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" + +cat >~/.condarc <<CONDARC + +conda-build: + root-dir: ${FEEDSTOCK_ROOT}/build_artifacts + +CONDARC + +conda install --yes --quiet "conda-forge-ci-setup=3" conda-build pip -c conda-forge + +# set up the condarc +setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" + +source run_conda_forge_build_setup + +# make the build number clobber +make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" + + +if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then + if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" + fi + conda debug "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + ${EXTRA_CB_OPTIONS:-} \ + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + # Drop into an interactive shell + /bin/bash +else + conda build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + --suppress-variables ${EXTRA_CB_OPTIONS:-} \ + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + validate_recipe_outputs "${FEEDSTOCK_NAME}" + + if [[ "${UPLOAD_PACKAGES}" != "False" ]]; then + upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" + fi +fi + +touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" \ No newline at end of file diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh new file mode 100755 index 0000000000000000000000000000000000000000..87ba4db0460e397314518ae991b4aa3551cff0d2 --- /dev/null +++ b/.scripts/run_docker_build.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash + +# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +# benefit from the improvement. + +set -xeo pipefail + +THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" +PROVIDER_DIR="$(basename $THISDIR)" + +FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) +RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" + +if [ -z ${FEEDSTOCK_NAME} ]; then + export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) +fi + +docker info + +# In order for the conda-build process in the container to write to the mounted +# volumes, we need to run with the same id as the host machine, which is +# normally the owner of the mounted volumes, or at least has write permission +export HOST_USER_ID=$(id -u) +# Check if docker-machine is being used (normally on OSX) and get the uid from +# the VM +if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then + export HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u) +fi + +ARTIFACTS="$FEEDSTOCK_ROOT/build_artifacts" + +if [ -z "$CONFIG" ]; then + set +x + FILES=`ls .ci_support/linux_*` + CONFIGS="" + for file in $FILES; do + CONFIGS="${CONFIGS}'${file:12:-5}' or "; + done + echo "Need to set CONFIG env variable. Value can be one of ${CONFIGS:0:-4}" + exit 1 +fi + +if [ -z "${DOCKER_IMAGE}" ]; then + SHYAML_INSTALLED="$(shyaml -h || echo NO)" + if [ "${SHYAML_INSTALLED}" == "NO" ]; then + echo "WARNING: DOCKER_IMAGE variable not set and shyaml not installed. Falling back to condaforge/linux-anvil-comp7" + DOCKER_IMAGE="condaforge/linux-anvil-comp7" + else + DOCKER_IMAGE="$(cat "${FEEDSTOCK_ROOT}/.ci_support/${CONFIG}.yaml" | shyaml get-value docker_image.0 condaforge/linux-anvil-comp7 )" + fi +fi + +mkdir -p "$ARTIFACTS" +DONE_CANARY="$ARTIFACTS/conda-forge-build-done-${CONFIG}" +rm -f "$DONE_CANARY" + +# Allow people to specify extra default arguments to `docker run` (e.g. `--rm`) +DOCKER_RUN_ARGS="${CONDA_FORGE_DOCKER_RUN_ARGS}" +if [ -z "${CI}" ]; then + DOCKER_RUN_ARGS="-it ${DOCKER_RUN_ARGS}" +fi + +export UPLOAD_PACKAGES="${UPLOAD_PACKAGES:-True}" +docker run ${DOCKER_RUN_ARGS} \ + -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z \ + -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z \ + -e CONFIG \ + -e HOST_USER_ID \ + -e UPLOAD_PACKAGES \ + -e GIT_BRANCH \ + -e UPLOAD_ON_BRANCH \ + -e CI \ + -e FEEDSTOCK_NAME \ + -e CPU_COUNT \ + -e BUILD_WITH_CONDA_DEBUG \ + -e BUILD_OUTPUT_ID \ + -e BINSTAR_TOKEN \ + -e FEEDSTOCK_TOKEN \ + -e STAGING_BINSTAR_TOKEN \ + $DOCKER_IMAGE \ + bash \ + /home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh + +# verify that the end of the script was reached +test -f "$DONE_CANARY" \ No newline at end of file diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh new file mode 100755 index 0000000000000000000000000000000000000000..c299b7925719dd913a88e3f19bfbf5335c32cb0d --- /dev/null +++ b/.scripts/run_osx_build.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +set -x + +echo -e "\n\nInstalling a fresh version of Miniforge." +if [[ ${CI} == "travis" ]]; then + echo -en 'travis_fold:start:install_miniforge\\r' +fi +MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download" +MINIFORGE_FILE="Miniforge3-MacOSX-x86_64.sh" +curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" +bash $MINIFORGE_FILE -b +if [[ ${CI} == "travis" ]]; then + echo -en 'travis_fold:end:install_miniforge\\r' +fi + +echo -e "\n\nConfiguring conda." +if [[ ${CI} == "travis" ]]; then + echo -en 'travis_fold:start:configure_conda\\r' +fi + +source ${HOME}/miniforge3/etc/profile.d/conda.sh +conda activate base + +echo -e "\n\nInstalling conda-forge-ci-setup=3 and conda-build." +conda install -n base --quiet --yes "conda-forge-ci-setup=3" conda-build pip + + + +echo -e "\n\nSetting up the condarc and mangling the compiler." +setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml +mangle_compiler ./ ./recipe .ci_support/${CONFIG}.yaml + +echo -e "\n\nMangling homebrew in the CI to avoid conflicts." +/usr/bin/sudo mangle_homebrew +/usr/bin/sudo -k + +echo -e "\n\nRunning the build setup script." +source run_conda_forge_build_setup + + +if [[ ${CI} == "travis" ]]; then + echo -en 'travis_fold:end:configure_conda\\r' +fi + +set -e + +echo -e "\n\nMaking the build clobber file and running the build." +make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml + +conda build ./recipe -m ./.ci_support/${CONFIG}.yaml --suppress-variables --clobber-file ./.ci_support/clobber_${CONFIG}.yaml ${EXTRA_CB_OPTIONS:-} +validate_recipe_outputs "${FEEDSTOCK_NAME}" + +if [[ "${UPLOAD_PACKAGES}" != "False" ]]; then + echo -e "\n\nUploading the packages." + upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml +fi \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..5f302793a84a7e5bf79abee2e013e1673a118f0a --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,13 @@ +BSD 3-clause license +Copyright (c) 2015-2020, conda-forge contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..38d9c56bb3b4f82d0a0e307903a2ca77d6a32815 --- /dev/null +++ b/README.md @@ -0,0 +1,211 @@ +About tensorflow +================ + +Home: http://tensorflow.org/ + +Package license: Apache-2.0 + +Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/tensorflow-feedstock/blob/master/LICENSE.txt) + +Summary: TensorFlow is an open source machine learning framework for everyone. + +Development: https://github.com/tensorflow/tensorflow + +Documentation: https://www.tensorflow.org/get_started/get_started + +TensorFlow provides multiple APIs.The lowest level API, TensorFlow Core +provides you with complete programming control. +Base package contains only tensorflow, not tensorflow-tensorboard. + + +Current build status +==================== + + +<table> + + <tr> + <td>Azure</td> + <td> + <details> + <summary> + <a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=4385&branchName=master"> + <img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/tensorflow-feedstock?branchName=master"> + </a> + </summary> + <table> + <thead><tr><th>Variant</th><th>Status</th></tr></thead> + <tbody><tr> + <td>linux_64_python3.6.____cpython</td> + <td> + <a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=4385&branchName=master"> + <img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/tensorflow-feedstock?branchName=master&jobName=linux&configuration=linux_64_python3.6.____cpython" alt="variant"> + </a> + </td> + </tr><tr> + <td>linux_64_python3.7.____cpython</td> + <td> + <a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=4385&branchName=master"> + <img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/tensorflow-feedstock?branchName=master&jobName=linux&configuration=linux_64_python3.7.____cpython" alt="variant"> + </a> + </td> + </tr><tr> + <td>linux_64_python3.8.____cpython</td> + <td> + <a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=4385&branchName=master"> + <img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/tensorflow-feedstock?branchName=master&jobName=linux&configuration=linux_64_python3.8.____cpython" alt="variant"> + </a> + </td> + </tr><tr> + <td>osx_64_python3.6.____cpython</td> + <td> + <a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=4385&branchName=master"> + <img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/tensorflow-feedstock?branchName=master&jobName=osx&configuration=osx_64_python3.6.____cpython" alt="variant"> + </a> + </td> + </tr><tr> + <td>osx_64_python3.7.____cpython</td> + <td> + <a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=4385&branchName=master"> + <img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/tensorflow-feedstock?branchName=master&jobName=osx&configuration=osx_64_python3.7.____cpython" alt="variant"> + </a> + </td> + </tr><tr> + <td>osx_64_python3.8.____cpython</td> + <td> + <a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=4385&branchName=master"> + <img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/tensorflow-feedstock?branchName=master&jobName=osx&configuration=osx_64_python3.8.____cpython" alt="variant"> + </a> + </td> + </tr><tr> + <td>win_64_python3.6.____cpython</td> + <td> + <a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=4385&branchName=master"> + <img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/tensorflow-feedstock?branchName=master&jobName=win&configuration=win_64_python3.6.____cpython" alt="variant"> + </a> + </td> + </tr><tr> + <td>win_64_python3.7.____cpython</td> + <td> + <a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=4385&branchName=master"> + <img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/tensorflow-feedstock?branchName=master&jobName=win&configuration=win_64_python3.7.____cpython" alt="variant"> + </a> + </td> + </tr><tr> + <td>win_64_python3.8.____cpython</td> + <td> + <a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=4385&branchName=master"> + <img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/tensorflow-feedstock?branchName=master&jobName=win&configuration=win_64_python3.8.____cpython" alt="variant"> + </a> + </td> + </tr> + </tbody> + </table> + </details> + </td> + </tr> +</table> + +Current release info +==================== + +| Name | Downloads | Version | Platforms | +| --- | --- | --- | --- | +| [](https://anaconda.org/conda-forge/libtensorflow) | [](https://anaconda.org/conda-forge/libtensorflow) | [](https://anaconda.org/conda-forge/libtensorflow) | [](https://anaconda.org/conda-forge/libtensorflow) | +| [](https://anaconda.org/conda-forge/libtensorflow_cc) | [](https://anaconda.org/conda-forge/libtensorflow_cc) | [](https://anaconda.org/conda-forge/libtensorflow_cc) | [](https://anaconda.org/conda-forge/libtensorflow_cc) | +| [](https://anaconda.org/conda-forge/tensorflow) | [](https://anaconda.org/conda-forge/tensorflow) | [](https://anaconda.org/conda-forge/tensorflow) | [](https://anaconda.org/conda-forge/tensorflow) | +| [](https://anaconda.org/conda-forge/tensorflow-base) | [](https://anaconda.org/conda-forge/tensorflow-base) | [](https://anaconda.org/conda-forge/tensorflow-base) | [](https://anaconda.org/conda-forge/tensorflow-base) | + +Installing tensorflow +===================== + +Installing `tensorflow` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with: + +``` +conda config --add channels conda-forge +``` + +Once the `conda-forge` channel has been enabled, `libtensorflow, libtensorflow_cc, tensorflow, tensorflow-base` can be installed with: + +``` +conda install libtensorflow libtensorflow_cc tensorflow tensorflow-base +``` + +It is possible to list all of the versions of `libtensorflow` available on your platform with: + +``` +conda search libtensorflow --channel conda-forge +``` + + +About conda-forge +================= + +[](http://numfocus.org) + +conda-forge is a community-led conda channel of installable packages. +In order to provide high-quality builds, the process has been automated into the +conda-forge GitHub organization. The conda-forge organization contains one repository +for each of the installable packages. Such a repository is known as a *feedstock*. + +A feedstock is made up of a conda recipe (the instructions on what and how to build +the package) and the necessary configurations for automatic building using freely +available continuous integration services. Thanks to the awesome service provided by +[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/) +and [TravisCI](https://travis-ci.com/) it is possible to build and upload installable +packages to the [conda-forge](https://anaconda.org/conda-forge) +[Anaconda-Cloud](https://anaconda.org/) channel for Linux, Windows and OSX respectively. + +To manage the continuous integration and simplify feedstock maintenance +[conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed. +Using the ``conda-forge.yml`` within this repository, it is possible to re-render all of +this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``. + +For more information please check the [conda-forge documentation](https://conda-forge.org/docs/). + +Terminology +=========== + +**feedstock** - the conda recipe (raw material), supporting scripts and CI configuration. + +**conda-smithy** - the tool which helps orchestrate the feedstock. + Its primary use is in the construction of the CI ``.yml`` files + and simplify the management of *many* feedstocks. + +**conda-forge** - the place where the feedstock and smithy live and work to + produce the finished article (built conda distributions) + + +Updating tensorflow-feedstock +============================= + +If you would like to improve the tensorflow recipe or build a new +package version, please fork this repository and submit a PR. Upon submission, +your changes will be run on the appropriate platforms to give the reviewer an +opportunity to confirm that the changes result in a successful build. Once +merged, the recipe will be re-built and uploaded automatically to the +`conda-forge` channel, whereupon the built conda packages will be available for +everybody to install and use from the `conda-forge` channel. +Note that all branches in the conda-forge/tensorflow-feedstock are +immediately built and any created packages are uploaded, so PRs should be based +on branches in forks and branches in the main repository should only be used to +build distinct package versions. + +In order to produce a uniquely identifiable distribution: + * If the version of a package **is not** being increased, please add or increase + the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string). + * If the version of a package **is** being increased, please remember to return + the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string) + back to 0. + +Feedstock Maintainers +===================== + +* [@farhantejani](https://github.com/farhantejani/) +* [@ghego](https://github.com/ghego/) +* [@gilbertfrancois](https://github.com/gilbertfrancois/) +* [@hajapy](https://github.com/hajapy/) +* [@jschueller](https://github.com/jschueller/) +* [@njzjz](https://github.com/njzjz/) +* [@waitingkuo](https://github.com/waitingkuo/) + diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000000000000000000000000000000000..6b346f505e5d415eeb91f140f75568318e6c65a1 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,8 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: + - template: ./.azure-pipelines/azure-pipelines-linux.yml + - template: ./.azure-pipelines/azure-pipelines-win.yml + - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file diff --git a/build-locally.py b/build-locally.py new file mode 100755 index 0000000000000000000000000000000000000000..3453cfe68810d02bf917d7c384eff6366efbe608 --- /dev/null +++ b/build-locally.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +# +# This file has been generated by conda-smithy in order to build the recipe +# locally. +# +import os +import glob +import subprocess +from argparse import ArgumentParser + + +def setup_environment(ns): + os.environ["CONFIG"] = ns.config + os.environ["UPLOAD_PACKAGES"] = "False" + if ns.debug: + os.environ["BUILD_WITH_CONDA_DEBUG"] = "1" + if ns.output_id: + os.environ["BUILD_OUTPUT_ID"] = ns.output_id + + +def run_docker_build(ns): + script = ".scripts/run_docker_build.sh" + subprocess.check_call([script]) + + +def verify_config(ns): + valid_configs = { + os.path.basename(f)[:-5] for f in glob.glob(".ci_support/*.yaml") + } + print(f"valid configs are {valid_configs}") + if ns.config in valid_configs: + print("Using " + ns.config + " configuration") + return + elif len(valid_configs) == 1: + ns.config = valid_configs.pop() + print("Found " + ns.config + " configuration") + elif ns.config is None: + print("config not selected, please choose from the following:\n") + selections = list(enumerate(sorted(valid_configs), 1)) + for i, c in selections: + print(f"{i}. {c}") + s = input("\n> ") + idx = int(s) - 1 + ns.config = selections[idx][1] + print(f"selected {ns.config}") + else: + raise ValueError("config " + ns.config + " is not valid") + # Remove the following, as implemented + if not ns.config.startswith("linux"): + raise ValueError( + f"only Linux configs currently supported, got {ns.config}" + ) + + +def main(args=None): + p = ArgumentParser("build-locally") + p.add_argument("config", default=None, nargs="?") + p.add_argument( + "--debug", + action="store_true", + help="Setup debug environment using `conda debug`", + ) + p.add_argument( + "--output-id", help="If running debug, specify the output to setup." + ) + + ns = p.parse_args(args=args) + verify_config(ns) + setup_environment(ns) + + run_docker_build(ns) + + +if __name__ == "__main__": + main() diff --git a/conda-forge.yml b/conda-forge.yml new file mode 100644 index 0000000000000000000000000000000000000000..7abbcf1a1db8e76fa7f7c957bc373961975b316a --- /dev/null +++ b/conda-forge.yml @@ -0,0 +1,9 @@ +travis: + secure: + BINSTAR_TOKEN: NBULVMw70vHV7ch6QWoFGS84M9ghYbix6Fru8O6db3pTyPXZoNlOaNdkHKaOdR88sahmjZx23T00bk9G/UjDqNO+SmPpf30m2Mt8DY+in3rAB9fi9xSJBjZ51xnAVH3JXXGo884wgtjLkCwk7aBYNLtNWtJl0AA5VgxS+1guMGYsqWiPDAtiFEswyhB4ZVO2budldeatef5unjpYC2im9gok5/fGHlRFGf8ds1K4xc22uIDeqnlR4hbu1IUS4n1+qLNi+TYLjoVyoghIm6BBuJyVMoWyGNayGootFByfPGttnfYU/9D9Z/cfonpW3iBkz3oLfq6vtKRE0mwxRdY0ZpPhQitCH6dLWA7z+9aRSLSfnZkwuFGr8uosVWFTqG0WwudgURr2PLSZf14U7tK1sVLnlVaRIfghmCFh9m8GYTImlrfUPZHsS+dtXOnLosPmH97XJke028J6dIwtNXsMaiQSJc+R7ugN6QbGKgDklsgEWJyUm7+LfSVbMf03u9fslU8V7U/TUeCqZye86GWjmcz+s42sqQ0XooPdqj3PMG6f9SeH/muxpMFnnxSoiITnmgB64dhTrymv1U0edWlbgvg9u4F7/opKExfBZtTcL5op5MKrKsMRgOAho6hixedoBXtXUts8UB4xMt3qTzDz43PkaeA096TCqyJbYJTtZqM= +appveyor: + secure: + BINSTAR_TOKEN: tumuXLL8PU75WMnRDemRy02ruEq2RpNxeK3dz0MjFssnosPm2v4EFjfNB4PTotA1 +provider: + win: azure +conda_forge_output_validation: true diff --git a/recipe/LICENSE b/recipe/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..40f8c347693afa4897252cbc76000beef1f52770 --- /dev/null +++ b/recipe/LICENSE @@ -0,0 +1,203 @@ +Copyright 2019 The TensorFlow Authors. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/recipe/bld.bat b/recipe/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..70703d2309b1a1f01e92ab4bd30d25585d10b85e --- /dev/null +++ b/recipe/bld.bat @@ -0,0 +1,2 @@ +pip install --no-deps -vv *.whl +for %%f in (*.whl) do pip install --no-deps -vv "%%f" diff --git a/recipe/build.sh b/recipe/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..c9c04dbf847731ed6f2c816c2d86df01522daef1 --- /dev/null +++ b/recipe/build.sh @@ -0,0 +1,121 @@ +#!/bin/bash + +set -ex + +if [[ "$target_platform" == "osx-64" ]]; then + # install the whl using pip + pip install --no-deps *.whl + + # The tensorboard package has the proper entrypoint + ls -l ${SP_DIR} +# rm -f ${PREFIX}/bin/tensorboard + + exit 0 +fi + +export PATH="$PWD:$PATH" +export CC=$(basename $CC) +export CXX=$(basename $CXX) +export LIBDIR=$PREFIX/lib +export INCLUDEDIR=$PREFIX/include + +export TF_SYSTEM_LIBS="llvm,swig" + +# do not build with MKL support +export TF_NEED_MKL=0 +export BAZEL_MKL_OPT="" + +mkdir -p ./bazel_output_base +export BAZEL_OPTS="" + +if [[ "$target_platform" == "osx-64" ]]; then + # set up bazel config file for conda provided clang toolchain + cp -r ${RECIPE_DIR}/custom_clang_toolchain . + pushd custom_clang_toolchain + cp ../$CC cc_wrapper.sh + sed -e "s:\${PREFIX}:${BUILD_PREFIX}:" \ + -e "s:\${LD}:${LD}:" \ + -e "s:\${NM}:${NM}:" \ + -e "s:\${STRIP}:${STRIP}:" \ + -e "s:\${LIBTOOL}:${LIBTOOL}:" \ + -e "s:\${CONDA_BUILD_SYSROOT}:${CONDA_BUILD_SYSROOT}:" \ + CROSSTOOL.template > CROSSTOOL + popd + export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 + BUILD_OPTS=" + --crosstool_top=//custom_clang_toolchain:toolchain + --verbose_failures + ${BAZEL_MKL_OPT} + --config=opt" + export TF_ENABLE_XLA=0 + export BUILD_TARGET="//tensorflow/tools/pip_package:build_pip_package" +else + # Linux + # the following arguments are useful for debugging + # --logging=6 + # --subcommands + # jobs can be used to limit parallel builds and reduce resource needs + # --jobs=20 + # Set compiler and linker flags as bazel does not account for CFLAGS, + # CXXFLAGS and LDFLAGS. + BUILD_OPTS=" + --copt=-march=nocona + --copt=-mtune=haswell + --copt=-ftree-vectorize + --copt=-fPIC + --copt=-fstack-protector-strong + --copt=-O2 + --cxxopt=-fvisibility-inlines-hidden + --cxxopt=-fmessage-length=0 + --linkopt=-zrelro + --linkopt=-znow + --verbose_failures + ${BAZEL_MKL_OPT} + --config=opt" + export TF_ENABLE_XLA=0 + export BUILD_TARGET="//tensorflow/tools/pip_package:build_pip_package //tensorflow:libtensorflow.so //tensorflow:libtensorflow_cc.so" +fi + +# TODO: publish 2.0 branch in bazel-feedstock +export BAZEL_VERSION=2.0.0 +export EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" +mkdir bazel_local +cd bazel_local +curl -sSOL https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip +unzip bazel-${BAZEL_VERSION}-dist.zip +./compile.sh +cd .. +export PATH="$PWD/bazel_local/output:$PATH" +bazel version + +# Python settings +export PYTHON_BIN_PATH=${PYTHON} +export PYTHON_LIB_PATH=${SP_DIR} +export USE_DEFAULT_PYTHON_LIB_PATH=1 + +# additional settings +export CC_OPT_FLAGS="-march=nocona -mtune=haswell" +export TF_NEED_OPENCL=0 +export TF_NEED_OPENCL_SYCL=0 +export TF_NEED_COMPUTECPP=0 +export TF_NEED_CUDA=0 +export TF_CUDA_CLANG=0 +export TF_NEED_TENSORRT=0 +export TF_NEED_ROCM=0 +export TF_NEED_MPI=0 +export TF_DOWNLOAD_CLANG=0 +export TF_SET_ANDROID_WORKSPACE=0 +./configure + +# build using bazel +bazel ${BAZEL_OPTS} build ${BUILD_OPTS} ${BUILD_TARGET} + +# build a whl file +mkdir -p $SRC_DIR/tensorflow_pkg +bazel-bin/tensorflow/tools/pip_package/build_pip_package $SRC_DIR/tensorflow_pkg + +# install the whl using pip +pip install --no-deps $SRC_DIR/tensorflow_pkg/*.whl + +# The tensorboard package has the proper entrypoint +rm -f ${PREFIX}/bin/tensorboard diff --git a/recipe/cp_libtensorflow.sh b/recipe/cp_libtensorflow.sh new file mode 100644 index 0000000000000000000000000000000000000000..525d78a9459f4af616ecea8bc0d37ab3be600fa0 --- /dev/null +++ b/recipe/cp_libtensorflow.sh @@ -0,0 +1,7 @@ +# copy libraries +mkdir -p ${PREFIX}/lib +cp bazel-bin/tensorflow/*.so ${PREFIX}/lib/ + +# copy includes +mkdir -p ${PREFIX}/include/tensorflow/c +cp -R tensorflow/c/* ${PREFIX}/include/tensorflow/c/. diff --git a/recipe/cp_libtensorflow_cc.sh b/recipe/cp_libtensorflow_cc.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c8e38ad529334308636e0d6d5ee3ba2ac4e8b9 --- /dev/null +++ b/recipe/cp_libtensorflow_cc.sh @@ -0,0 +1,22 @@ +# copy libraries +mkdir -p ${PREFIX}/lib +cp bazel-bin/tensorflow/libtensorflow_cc.so ${PREFIX}/lib/ +cp bazel-bin/tensorflow/libtensorflow_framework.so ${PREFIX}/lib/ + +# remove cc files +find bazel-genfiles/ -name "*.cc" -type f -delete +find tensorflow/cc -name "*.cc" -type f -delete +find tensorflow/core -name "*.cc" -type f -delete +find third_party -name "*.cc" -type f -delete +find bazel-work/external/com_google_absl/absl -name "*.cc" -type f -delete + +# copy includes +mkdir -p ${PREFIX}/include/tensorflow +cp -r bazel-genfiles/* ${PREFIX}/include/ +cp -r tensorflow/cc/ ${PREFIX}/include/tensorflow +cp -r tensorflow/core/ ${PREFIX}/include/tensorflow +cp -r third_party/ ${PREFIX}/include + +cp -r bazel-work/external/com_google_absl/absl/ ${PREFIX}/include +cp -r bazel-work/external/eigen_archive/Eigen/ ${PREFIX}/include +cp -r bazel-work/external/eigen_archive/unsupported/ ${PREFIX}/include diff --git a/recipe/custom_clang_toolchain/BUILD b/recipe/custom_clang_toolchain/BUILD new file mode 100755 index 0000000000000000000000000000000000000000..9ebaf9ffff68d2501a0eb5596677c8c634053335 --- /dev/null +++ b/recipe/custom_clang_toolchain/BUILD @@ -0,0 +1,39 @@ +package(default_visibility = ["//visibility:public"]) + +filegroup( + name = "empty", + srcs = [], +) + +filegroup( + name = "cc_wrapper", + srcs = ["cc_wrapper.sh"], +) + +filegroup( + name = "compiler_deps", + srcs = glob(["extra_tools/**"]) + [":cc_wrapper"], +) + +cc_toolchain_suite( + name = "toolchain", + toolchains = { + "darwin|compiler": ":cc-compiler-darwin", + "darwin": ":cc-compiler-darwin", + }, +) + +cc_toolchain( + name = "cc-compiler-darwin", + all_files = ":compiler_deps", + compiler_files = ":compiler_deps", + cpu = "darwin", + toolchain_identifier = "local", + dwp_files = ":empty", + dynamic_runtime_libs = [":empty"], + linker_files = ":compiler_deps", + objcopy_files = ":empty", + static_runtime_libs = [":empty"], + strip_files = ":empty", + supports_param_files = 0, +) diff --git a/recipe/custom_clang_toolchain/CROSSTOOL.template b/recipe/custom_clang_toolchain/CROSSTOOL.template new file mode 100755 index 0000000000000000000000000000000000000000..3999152bc1fa4c1c192c7f448b860c78db0824aa --- /dev/null +++ b/recipe/custom_clang_toolchain/CROSSTOOL.template @@ -0,0 +1,82 @@ +major_version: "local" +minor_version: "" +default_target_cpu: "same_as_host" + +default_toolchain { + cpu: "darwin" + toolchain_identifier: "local" +} + +toolchain { + toolchain_identifier: "local" + abi_version: "local" + abi_libc_version: "local" + builtin_sysroot: "" + compiler: "compiler" + host_system_name: "local" + needsPic: true + supports_gold_linker: false + supports_incremental_linker: false + supports_fission: false + supports_interface_shared_objects: false + supports_normalizing_ar: false + supports_start_end_lib: false + target_libc: "macosx" + target_cpu: "darwin" + target_system_name: "local" + cxx_flag: "-stdlib=libc++" + cxx_flag: "-fvisibility-inlines-hidden" + cxx_flag: "-std=c++14" + cxx_flag: "-fmessage-length=0" + linker_flag: "-Wl,-pie" + linker_flag: "-headerpad_max_install_names" + linker_flag: "-Wl,-dead_strip_dylibs" + linker_flag: "-lc++" + linker_flag: "-undefined" + linker_flag: "dynamic_lookup" + cxx_builtin_include_directory: "${PREFIX}/include/c++/v1" + cxx_builtin_include_directory: "${PREFIX}/lib/clang/4.0.1/include" + cxx_builtin_include_directory: "${CONDA_BUILD_SYSROOT}/usr/include" + cxx_builtin_include_directory: "${CONDA_BUILD_SYSROOT}/System/Library/Frameworks" + objcopy_embed_flag: "-I" + objcopy_embed_flag: "binary" + unfiltered_cxx_flag: "-no-canonical-prefixes" + unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" + unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" + unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" + unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" + compiler_flag: "-march=core2" + compiler_flag: "-mtune=haswell" + compiler_flag: "-mssse3" + compiler_flag: "-ftree-vectorize" + compiler_flag: "-fPIC" + compiler_flag: "-fPIE" + compiler_flag: "-fstack-protector-strong" + compiler_flag: "-O1" + compiler_flag: "-pipe" + tool_path {name: "ld" path: "${LD}" } + tool_path {name: "cpp" path: "/usr/bin/cpp" } + tool_path {name: "dwp" path: "/usr/bin/dwp" } + tool_path {name: "gcov" path: "/usr/bin/gcov" } + tool_path {name: "nm" path: "${NM}" } + tool_path {name: "objcopy" path: "/usr/bin/objcopy" } + tool_path {name: "objdump" path: "/usr/bin/objdump" } + tool_path {name: "strip" path: "${STRIP}" } + tool_path {name: "gcc" path: "cc_wrapper.sh" } + tool_path {name: "ar" path: "${LIBTOOL}" } + + compilation_mode_flags { + mode: DBG + compiler_flag: "-g" + } + compilation_mode_flags { + mode: OPT + compiler_flag: "-g0" + compiler_flag: "-O1" + compiler_flag: "-D_FORTIFY_SOURCE=1" + compiler_flag: "-DNDEBUG" + compiler_flag: "-ffunction-sections" + compiler_flag: "-fdata-sections" + } + linking_mode_flags { mode: DYNAMIC } +} diff --git a/recipe/custom_clang_toolchain/WORKSPACE b/recipe/custom_clang_toolchain/WORKSPACE new file mode 100644 index 0000000000000000000000000000000000000000..125586504a29b8a61b4e668d407b866ab5cde480 --- /dev/null +++ b/recipe/custom_clang_toolchain/WORKSPACE @@ -0,0 +1 @@ +workspace(name = "local_config_cc") diff --git a/recipe/custom_clang_toolchain/cc_wrapper.sh.template b/recipe/custom_clang_toolchain/cc_wrapper.sh.template new file mode 100755 index 0000000000000000000000000000000000000000..069d37b010d854ecc865097fd9cd83c954e4dce5 --- /dev/null +++ b/recipe/custom_clang_toolchain/cc_wrapper.sh.template @@ -0,0 +1,106 @@ +#!/bin/bash +# +# Copyright 2015 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# OS X relpath is not really working. This is a wrapper script around gcc +# to simulate relpath behavior. +# +# This wrapper uses install_name_tool to replace all paths in the binary +# (bazel-out/.../path/to/original/library.so) by the paths relative to +# the binary. It parses the command line to behave as rpath is supposed +# to work. +# +# See https://blogs.oracle.com/dipol/entry/dynamic_libraries_rpath_and_mac +# on how to set those paths for Mach-O binaries. +# +set -eu + +INSTALL_NAME_TOOL="${INSTALL_NAME_TOOL}" + +LIBS= +LIB_DIRS= +RPATHS= +OUTPUT= +# let parse the option list +for i in "$@"; do + if [[ "${OUTPUT}" = "1" ]]; then + OUTPUT=$i + elif [[ "$i" =~ ^-l(.*)$ ]]; then + LIBS="${BASH_REMATCH[1]} $LIBS" + elif [[ "$i" =~ ^-L(.*)$ ]]; then + LIB_DIRS="${BASH_REMATCH[1]} $LIB_DIRS" + elif [[ "$i" =~ ^-Wl,-rpath,\@loader_path/(.*)$ ]]; then + RPATHS="${BASH_REMATCH[1]} ${RPATHS}" + elif [[ "$i" = "-o" ]]; then + # output is coming + OUTPUT=1 + fi +done + +# Set-up the environment + + +# Call the C++ compiler +CONDA_BUILD_SYSROOT=${CONDA_BUILD_SYSROOT} ${CLANG} "$@" + +function get_library_path() { + for libdir in ${LIB_DIRS}; do + if [ -f ${libdir}/lib$1.so ]; then + echo "${libdir}/lib$1.so" + elif [ -f ${libdir}/lib$1.dylib ]; then + echo "${libdir}/lib$1.dylib" + fi + done +} + +# A convenient method to return the actual path even for non symlinks +# and multi-level symlinks. +function get_realpath() { + local previous="$1" + local next=$(readlink "${previous}") + while [ -n "${next}" ]; do + previous="${next}" + next=$(readlink "${previous}") + done + echo "${previous}" +} + +# Get the path of a lib inside a tool +function get_otool_path() { + # the lib path is the path of the original lib relative to the workspace + get_realpath $1 | sed 's|^.*/bazel-out/|bazel-out/|' +} + +# Do replacements in the output +for rpath in ${RPATHS}; do + for lib in ${LIBS}; do + unset libname + if [ -f "$(dirname ${OUTPUT})/${rpath}/lib${lib}.so" ]; then + libname="lib${lib}.so" + elif [ -f "$(dirname ${OUTPUT})/${rpath}/lib${lib}.dylib" ]; then + libname="lib${lib}.dylib" + fi + # ${libname-} --> return $libname if defined, or undefined otherwise. This is to make + # this set -e friendly + if [[ -n "${libname-}" ]]; then + libpath=$(get_library_path ${lib}) + if [ -n "${libpath}" ]; then + ${INSTALL_NAME_TOOL} -change $(get_otool_path "${libpath}") \ + "@loader_path/${rpath}/${libname}" "${OUTPUT}" + fi + fi + done +done + diff --git a/recipe/meta.yaml b/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..03d98865a6d2d0826dc83ba05aea2b5e54d1df2e --- /dev/null +++ b/recipe/meta.yaml @@ -0,0 +1,213 @@ +{% set version = "2.2.0" %} + +{% set pyver = "cp{}{}".format(PY_VER[0], PY_VER[2]) %} +{% set platform = "macosx_10_11_x86_64" %} # [osx] +{% set platform = "win_amd64" %} # [win] +{% set fn = "{}-{}-{}-{}m-{}.whl".format("tensorflow", version, pyver, pyver, platform) %} # [not linux] +{% set fn = "tensorflow-{{ version }}.tar.gz" %} # [linux] + +package: + name: tensorflow + version: {{ version }} + +source: + fn: {{ fn }} + url: https://github.com/tensorflow/tensorflow/archive/v{{ version }}.tar.gz # [linux] + sha256: 69cd836f87b8c53506c4f706f655d423270f5a563b76dc1cfa60fbc3184185a3 # [linux] + url: https://pypi.io/packages/{{ pyver }}/t/tensorflow/{{ fn }} # [not linux] + sha256: 6735486ee9c3cb0807476e2b36ef7a4cd6c597cb24abf496e66b703360e1e54e # [osx and py==36] + sha256: c332c7fc5cfd54cb86d5da99787c9693e3a924848097c54df1b71ee595a39c93 # [osx and py==37] + sha256: bbcfb04738099bd46822db91584db74703fdddacf4cd0a76acfc5e086956b5ba # [osx and py==38] + sha256: 3ee8819732d8594913b7d22ded7b22e48a49aa015050d8dd8464eaa010ba2e41 # [win and py==36] + sha256: 68ea22aee9c269a6a0c1061c141f1ec1cd1b1be7569390519c1bf4773f434a40 # [win and py==37] + sha256: 784ab8217e4b0eb4d121c28430c6cdc2ce56c02634a9720d84fb30598b338b8c # [win and py==38] + + patches: + #- patches/0001-add-rt-to-linkopts.patch # [linux] + #- patches/0002-stable-image-rotate-test.patch # [linux] + - patches/0003-relax-tolerence-in-special_math_test.patch # [linux] + - patches/0004-skip-read-only-debugger_cli_common-test.patch # [linux] + #- patches/0005-fix-lookup_ops-test.patch # [linux] + - patches/0006-relax-precision-in-matrix_log_op_test.patch # [linux] + #- patches/0007-Add-init-symbol-names-prefixed-with-an-underscore.patch # [osx] + #- patches/0008-Add-alternate-clock_gettime-implementation-for-macOS.patch # [osx] + - patches/unbundle_llvm.patch # [linux] + +build: + number: 0 + skip: True # [not x86_64] + +requirements: + build: + - {{ compiler('c') }} # [linux] + - {{ compiler('cxx') }} # [linux] + #- bazel ==2.0.0 # [linux] + - nasm # [linux] + - swig # [linux] + host: + # conda build requirements + - python + - pip + #- setuptools <=39.1.0 + # requirements specified by the package itself + - absl-py >=0.1.6 + - astor >=0.6.0 + - gast >=0.2.0 + - keras-applications >=1.0.6 + - keras-preprocessing >=1.0.5 + - llvmdev >=8.0.0,<9.0.0 # [linux] + - zlib # [linux] + - libpng # [linux] + - libcurl # [linux] + - unzip # [linux] + - zip # [linux] + - openjdk >=8 # [linux] + - nsync # [linux] + - numpy >=1.16.1 + - six >=1.10.0 + - protobuf >=3.6.1 + - termcolor >=1.1.0 + - grpcio >=1.8.6 + - wheel >=0.26 # [linux] + - tensorflow-estimator >=2.2.0,<2.3.0a0 + run: + - {{ pin_subpackage('tensorflow-base', exact=True) }} + +outputs: + - name: tensorflow-base + build: + entry_points: + - toco_from_protos = tensorflow.lite.toco.python.toco_from_protos:main + - tflite_convert = tensorflow.lite.python.tflite_convert:main + - toco = tensorflow.lite.python.tflite_convert:main + - saved_model_cli = tensorflow.python.tools.saved_model_cli:main + # The tensorboard package adds this entry point. + # - tensorboard = tensorboard.main:run_main + - tf_upgrade_v2 = tensorflow.tools.compatibility.tf_upgrade_v2_main:main + - estimator_ckpt_converter = tensorflow_estimator.python.estimator.tools.checkpoint_converter:main + requirements: + # build requirements needs to pick up the compiler run_exports + build: + - {{ compiler('c') }} # [linux] + - {{ compiler('cxx') }} # [linux] + host: + # conda build requirements + - python + - pip + # requirements specified by the package itself + - absl-py >=0.1.6 + - astor >=0.6.0 + - astunparse + - gast >=0.2.0 + - google-pasta + - h5py + - keras-preprocessing >=1.0.5 + - numpy >=1.16.1 + - six >=1.10.0 + - protobuf >=3.6.1 + - termcolor >=1.1.0 + - grpcio >=1.8.6 + - wheel >=0.26 # [unix] + - tensorflow-estimator >=2.2.0,<2.3.0a0 + - zlib # [linux] + - libpng # [linux] + - libcurl # [linux] + run: + - python + - absl-py >=0.1.6 + - astor >=0.6.0 + - astunparse + - gast >=0.2.0 + - google-pasta + - h5py + - opt_einsum + - keras-preprocessing >=1.0.5 + - {{ pin_compatible('numpy') }} + - scipy + - six >=1.10.0 + - protobuf >=3.6.1 + - termcolor >=1.1.0 + - grpcio >=1.8.6 + - tensorflow-estimator >=2.2.0,<2.3.0a0 + - tensorboard >=2.2.0,<2.3.0a0 + test: + imports: + - tensorflow + commands: + - freeze_graph --help + - saved_model_cli --help + - tflite_convert --help # [not win] + - toco_from_protos --help # [not win] + - toco --help # [not win] + + - name: libtensorflow + script: cp_libtensorflow.sh # [unix] + build: + skip: true # [not linux] + requirements: + # build requirements needs to pick up the compiler run_exports + build: + - {{ compiler('c') }} # [linux] + - {{ compiler('cxx') }} # [linux] + # host requirements to pick up run_exports + host: + - libcurl # [linux] + - zlib # [linux] + + test: + files: + - test_c.c + requires: + - {{ compiler('c') }} + commands: + - test -f $PREFIX/lib/libtensorflow.so # [not win] + - $CC -o test_c -L${PREFIX}/lib/ -ltensorflow -I${PREFIX}/include/ test_c.c && ./test_c # [not win] + + - name: libtensorflow_cc + script: cp_libtensorflow_cc.sh # [unix] + build: + skip: true # [not linux] + requirements: + # build requirements needs to pick up the compiler run_exports + build: + - {{ compiler('c') }} # [linux] + - {{ compiler('cxx') }} # [linux] + # host requirements to pick up run_exports + host: + - libcurl # [linux] + - zlib # [linux] + run: + - libprotobuf >=3.6.1,<3.7 + - nsync + test: + files: + - test_cc.cc + requires: + - {{ compiler('cxx') }} + commands: + - test -f $PREFIX/lib/libtensorflow_cc.so # [not win] + - $CXX -std=c++11 -o test_cc -L${PREFIX}/lib/ -ltensorflow_cc -ltensorflow_framework -lrt -I${PREFIX}/include/ test_cc.cc && ./test_cc # [not win] + +about: + home: http://tensorflow.org/ + license: Apache-2.0 + license_file: LICENSE + license_family: Apache + summary: TensorFlow is an open source machine learning framework for everyone. + description: | + TensorFlow provides multiple APIs.The lowest level API, TensorFlow Core + provides you with complete programming control. + Base package contains only tensorflow, not tensorflow-tensorboard. + dev_url: https://github.com/tensorflow/tensorflow + doc_url: https://www.tensorflow.org/get_started/get_started + doc_source_url: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/docs_src + +extra: + recipe-maintainers: + - waitingkuo + - ghego + - hajapy + - gilbertfrancois + - farhantejani + - njzjz + - jschueller diff --git a/recipe/patches/0001-add-rt-to-linkopts.patch b/recipe/patches/0001-add-rt-to-linkopts.patch new file mode 100644 index 0000000000000000000000000000000000000000..5706732ba76d40b902a352aada00014f8aa907d2 --- /dev/null +++ b/recipe/patches/0001-add-rt-to-linkopts.patch @@ -0,0 +1,47 @@ +From 30a4ed9b097f1ea9a2a1e9303e044015d0041d63 Mon Sep 17 00:00:00 2001 +From: Jonathan Helmus <jjhelmus@gmail.com> +Date: Wed, 27 Jun 2018 12:46:18 -0500 +Subject: [PATCH 1/8] add rt to linkopts + +--- + tensorflow/BUILD | 1 + + tensorflow/tensorflow.bzl | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/tensorflow/BUILD b/tensorflow/BUILD +index 823ad8f..96e12cb 100644 +--- a/tensorflow/BUILD ++++ b/tensorflow/BUILD +@@ -429,6 +429,7 @@ tf_cc_shared_object( + "//tensorflow:darwin": [], + "//tensorflow:windows": [], + "//conditions:default": [ ++ "-lrt", + "-Wl,--version-script", # This line must be directly followed by the version_script.lds file + "$(location //tensorflow:tf_framework_version_script.lds)", + ], +diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl +index d93e0df..b8438d2 100644 +--- a/tensorflow/tensorflow.bzl ++++ b/tensorflow/tensorflow.bzl +@@ -377,7 +377,7 @@ def tf_cc_shared_object( + srcs = [], + deps = [], + data = [], +- linkopts = [], ++ linkopts = ['-lrt'], + framework_so = tf_binary_additional_srcs(), + kernels = [], + **kwargs): +@@ -413,7 +413,7 @@ def tf_cc_binary( + srcs = [], + deps = [], + data = [], +- linkopts = [], ++ linkopts = ['-lrt'], + copts = tf_copts(), + kernels = [], + **kwargs): +-- +2.7.4 + diff --git a/recipe/patches/0002-stable-image-rotate-test.patch b/recipe/patches/0002-stable-image-rotate-test.patch new file mode 100644 index 0000000000000000000000000000000000000000..2a2c4448bbab49217069ccb4082285522269484c --- /dev/null +++ b/recipe/patches/0002-stable-image-rotate-test.patch @@ -0,0 +1,38 @@ +From 11a1f8a90ccffb2746c1d6a3356fc2033be38bea Mon Sep 17 00:00:00 2001 +From: Jonathan Helmus <jjhelmus@gmail.com> +Date: Thu, 8 Jun 2017 10:48:30 -0500 +Subject: [PATCH 2/8] stable image rotate test + +--- + tensorflow/contrib/image/python/kernel_tests/image_ops_test.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tensorflow/contrib/image/python/kernel_tests/image_ops_test.py b/tensorflow/contrib/image/python/kernel_tests/image_ops_test.py +index ba5cdfe..41ffac4 100644 +--- a/tensorflow/contrib/image/python/kernel_tests/image_ops_test.py ++++ b/tensorflow/contrib/image/python/kernel_tests/image_ops_test.py +@@ -54,7 +54,7 @@ class ImageOpsTest(test_util.TensorFlowTestCase): + image = array_ops.reshape( + math_ops.cast(math_ops.range(36), dtype), (6, 6)) + image_rep = array_ops.tile(image[None, :, :, None], [3, 1, 1, 1]) +- angles = constant_op.constant([0.0, np.pi / 4.0, np.pi / 2.0], ++ angles = constant_op.constant([0.0, -np.pi / 2.0, np.pi / 2.0], + dtypes.float32) + image_rotated = image_ops.rotate(image_rep, angles) + self.assertAllEqual(image_rotated[:, :, :, 0].eval(), +@@ -63,9 +63,9 @@ class ImageOpsTest(test_util.TensorFlowTestCase): + [18, 19, 20, 21, 22, 23], + [24, 25, 26, 27, 28, 29], + [30, 31, 32, 33, 34, 35]], +- [[0, 3, 4, 11, 17, 0], [2, 3, 9, 16, 23, 23], +- [1, 8, 15, 21, 22, 29], [6, 13, 20, 21, 27, 34], +- [12, 18, 19, 26, 33, 33], [0, 18, 24, 31, 32, 0]], ++ [[30, 24, 18, 12, 6, 0], [31, 25, 19, 13, 7, 1], ++ [32, 26, 20, 14, 8, 2], [33, 27, 21, 15, 9, 3], ++ [34, 28, 22, 16, 10, 4], [35, 29, 23, 17, 11, 5]], + [[5, 11, 17, 23, 29, 35], [4, 10, 16, 22, 28, 34], + [3, 9, 15, 21, 27, 33], [2, 8, 14, 20, 26, 32], + [1, 7, 13, 19, 25, 31], [0, 6, 12, 18, 24, 30]]]) +-- +2.7.4 + diff --git a/recipe/patches/0003-relax-tolerence-in-special_math_test.patch b/recipe/patches/0003-relax-tolerence-in-special_math_test.patch new file mode 100644 index 0000000000000000000000000000000000000000..340ac35702157c8e1c29f0916639a6cd961e7e37 --- /dev/null +++ b/recipe/patches/0003-relax-tolerence-in-special_math_test.patch @@ -0,0 +1,25 @@ +From b2944e66ace811cd2adf565277a00e78522effbd Mon Sep 17 00:00:00 2001 +From: Jonathan Helmus <jjhelmus@gmail.com> +Date: Tue, 20 Jun 2017 15:13:14 -0500 +Subject: [PATCH 3/8] relax tolerence in special_math_test + +--- + tensorflow/python/kernel_tests/distributions/special_math_test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tensorflow/python/kernel_tests/distributions/special_math_test.py b/tensorflow/python/kernel_tests/distributions/special_math_test.py +index d97fcfa..ea4b53c 100644 +--- a/tensorflow/python/kernel_tests/distributions/special_math_test.py ++++ b/tensorflow/python/kernel_tests/distributions/special_math_test.py +@@ -256,7 +256,7 @@ class LogNdtrTestUpper(NdtrTest): + min=sm.LOGNDTR_FLOAT64_UPPER, + max=35., # Beyond this, log_cdf(x) may be zero. + shape=[100]) +- _error32 = ErrorSpec(rtol=1e-6, atol=1e-14) ++ _error32 = ErrorSpec(rtol=1e-6, atol=1e-13) + _error64 = ErrorSpec(rtol=1e-6, atol=1e-14) + + +-- +2.7.4 + diff --git a/recipe/patches/0004-skip-read-only-debugger_cli_common-test.patch b/recipe/patches/0004-skip-read-only-debugger_cli_common-test.patch new file mode 100644 index 0000000000000000000000000000000000000000..3bb2a0a24594c0bdb42d4cec74d90e28a6da3399 --- /dev/null +++ b/recipe/patches/0004-skip-read-only-debugger_cli_common-test.patch @@ -0,0 +1,31 @@ +From 3146c288d1a3d1943911082ee013564d068a4344 Mon Sep 17 00:00:00 2001 +From: Jonathan Helmus <jjhelmus@gmail.com> +Date: Thu, 4 Jan 2018 17:17:23 -0600 +Subject: [PATCH 4/8] skip read only debugger_cli_common test + +If tensorflow is built as root the +debugger_cli_common::testCommandHistoryHandlesWritingIOErrorGracoiusly test +will fail as the log never becomes read only. Skip the portion of the test +that depends on the read-only behavior of the log. +--- + tensorflow/python/debug/cli/debugger_cli_common_test.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tensorflow/python/debug/cli/debugger_cli_common_test.py b/tensorflow/python/debug/cli/debugger_cli_common_test.py +index aba95e5..9c8bc60 100644 +--- a/tensorflow/python/debug/cli/debugger_cli_common_test.py ++++ b/tensorflow/python/debug/cli/debugger_cli_common_test.py +@@ -1057,7 +1057,9 @@ class CommandHistoryTest(test_util.TensorFlowTestCase): + + cmd_hist_3 = debugger_cli_common.CommandHistory( + limit=3, history_file_path=self._history_file_path) +- self.assertEqual(["help"], cmd_hist_3.most_recent_n(1)) ++ # when the test are run as root the log file is still writable and this ++ # test fails. ++ #self.assertEqual(["help"], cmd_hist_3.most_recent_n(1)) + + self._restoreFileReadWritePermissions(self._history_file_path) + +-- +2.7.4 + diff --git a/recipe/patches/0005-fix-lookup_ops-test.patch b/recipe/patches/0005-fix-lookup_ops-test.patch new file mode 100644 index 0000000000000000000000000000000000000000..ffdc155032b13b20233fcb95c141f22ee42d075c --- /dev/null +++ b/recipe/patches/0005-fix-lookup_ops-test.patch @@ -0,0 +1,30 @@ +From 908dba7dcc7d21e5479a37c5c1acccb6d0b90056 Mon Sep 17 00:00:00 2001 +From: Jonathan Helmus <jjhelmus@gmail.com> +Date: Thu, 11 Jan 2018 13:05:31 -0600 +Subject: [PATCH 5/8] fix lookup_ops test + +The order of the exported data is undefined, perform a valid sort before +comparing. +--- + tensorflow/contrib/lookup/lookup_ops_test.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tensorflow/contrib/lookup/lookup_ops_test.py b/tensorflow/contrib/lookup/lookup_ops_test.py +index 9b2c2dd..81d0648 100644 +--- a/tensorflow/contrib/lookup/lookup_ops_test.py ++++ b/tensorflow/contrib/lookup/lookup_ops_test.py +@@ -505,9 +505,9 @@ class MutableHashTableOpTest(test.TestCase): + msg="Saw shape %s" % exported_values.shape) + # exported data is in the order of the internal map, i.e. undefined + sorted_keys = np.sort(exported_keys.eval()) +- sorted_values = np.sort(exported_values.eval()) ++ sorted_values = np.sort(exported_values.eval(), axis=0) + self.assertAllEqual([b"brain", b"salad", b"surgery"], sorted_keys) +- self.assertAllEqual([[4, 5], [2, 3], [0, 1]], sorted_values) ++ self.assertAllEqual([[0, 1], [2, 3], [4, 5]], sorted_values) + + def testMutableHashTableExportInsert(self): + with self.cached_session(): +-- +2.7.4 + diff --git a/recipe/patches/0006-relax-precision-in-matrix_log_op_test.patch b/recipe/patches/0006-relax-precision-in-matrix_log_op_test.patch new file mode 100644 index 0000000000000000000000000000000000000000..1a1d1024adfa8e41f08da395ed4376525fe3563c --- /dev/null +++ b/recipe/patches/0006-relax-precision-in-matrix_log_op_test.patch @@ -0,0 +1,25 @@ +From cc7517cd6c0890ffd572c14001cdb9a259ec05b9 Mon Sep 17 00:00:00 2001 +From: Jonathan Helmus <jjhelmus@gmail.com> +Date: Mon, 20 Aug 2018 12:19:04 -0500 +Subject: [PATCH 6/8] relax precision in matrix_log_op_test + +--- + tensorflow/python/kernel_tests/matrix_logarithm_op_test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tensorflow/python/kernel_tests/matrix_logarithm_op_test.py b/tensorflow/python/kernel_tests/matrix_logarithm_op_test.py +index 682ac12..4c576a2 100644 +--- a/tensorflow/python/kernel_tests/matrix_logarithm_op_test.py ++++ b/tensorflow/python/kernel_tests/matrix_logarithm_op_test.py +@@ -45,7 +45,7 @@ class LogarithmOpTest(test.TestCase): + tf_ans = linalg_impl.matrix_exponential( + gen_linalg_ops.matrix_logarithm(inp)) + out = self.evaluate(tf_ans) +- self.assertAllClose(inp, out, rtol=1e-4, atol=1e-3) ++ self.assertAllClose(inp, out, rtol=1e-3, atol=1e-3) + + def _verifyLogarithmComplex(self, x): + for np_type in [np.complex64, np.complex128]: +-- +2.7.4 + diff --git a/recipe/patches/0007-Add-init-symbol-names-prefixed-with-an-underscore.patch b/recipe/patches/0007-Add-init-symbol-names-prefixed-with-an-underscore.patch new file mode 100644 index 0000000000000000000000000000000000000000..9f9a6fa488aaa24fdb9908b114497d43194eb21b --- /dev/null +++ b/recipe/patches/0007-Add-init-symbol-names-prefixed-with-an-underscore.patch @@ -0,0 +1,53 @@ +From 03d0d2bf4e47ac6b768d9f3371cdb941bf3d36e4 Mon Sep 17 00:00:00 2001 +From: Nehal J Wani <nehaljw.kkd1@gmail.com> +Date: Thu, 23 Aug 2018 11:34:00 -0500 +Subject: [PATCH 7/8] Add (init) symbol names prefixed with an underscore +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The command: `python -c 'from tensorflow.contrib import tensorrt as trt'` fails +with: + +File "/xxx/lib/python2.7/site-packages/tensorflow/contrib/tensorrt/wrap_conversion.py", line 24, in swig_import_helper + _mod = imp.load_module('_wrap_conversion', fp, pathname, description) +ImportError: dynamic module does not define init function (init_wrap_conversion) + +➜ 1534993632 nm /xxx/lib/python2.7/site-packages/tensorflow/contrib/tensorrt/_wrap_conversion.so | grep wrap_conversion +0000000000003670 t _init_wrap_conversion <---------- symbol defined, but local, not exposed + U init_wrap_conversion + I init_wrap_conversion (indirect for init_wrap_conversion) + +Happens because the linker version script has: `init_wrap_conversion` instead of `_init_wrap_conversion` + +xref: https://github.com/tensorflow/tensorflow/issues/21818 +xref: https://stackoverflow.com/a/37534357 +--- + tensorflow/tensorflow.bzl | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl +index b8438d2..f6850e3 100644 +--- a/tensorflow/tensorflow.bzl ++++ b/tensorflow/tensorflow.bzl +@@ -1594,7 +1594,7 @@ def _append_init_to_versionscript_impl(ctx): + template = ctx.file.template_file, + output = ctx.outputs.versionscript, + substitutions = { +- "global:": "global:\n init_%s;\n PyInit_*;" % (mod_name), ++ "global:": "global:\n init_%s;\n _init_%s;\n PyInit_*;\n _PyInit_*;"%(mod_name, mod_name), + }, + is_executable = False, + ) +@@ -1603,7 +1603,7 @@ def _append_init_to_versionscript_impl(ctx): + template = ctx.file.template_file, + output = ctx.outputs.versionscript, + substitutions = { +- "*tensorflow*": "*tensorflow*\ninit_%s\nPyInit_*\n" % (mod_name), ++ "*tensorflow*": "*tensorflow*\ninit_%s\n_init_%s\nPyInit_*\n_PyInit_*\n"%(mod_name, mod_name), + }, + is_executable = False, + ) +-- +2.7.4 + diff --git a/recipe/patches/0008-Add-alternate-clock_gettime-implementation-for-macOS.patch b/recipe/patches/0008-Add-alternate-clock_gettime-implementation-for-macOS.patch new file mode 100644 index 0000000000000000000000000000000000000000..8c04e0ff09d25a9758a34267dd3e43938e354ccd --- /dev/null +++ b/recipe/patches/0008-Add-alternate-clock_gettime-implementation-for-macOS.patch @@ -0,0 +1,55 @@ +From 2f0373b5f8ea3e1ab8708cb9c64c404922b96b81 Mon Sep 17 00:00:00 2001 +From: Nehal J Wani <nehaljw.kkd1@gmail.com> +Date: Sun, 30 Sep 2018 09:16:53 -0500 +Subject: [PATCH 8/8] Add alternate clock_gettime() implementation for macOS < + 10.12 + +clock_gettime is not available in macOS SDK < 10.12 +--- + tensorflow/core/platform/posix/env_time.cc | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/tensorflow/core/platform/posix/env_time.cc b/tensorflow/core/platform/posix/env_time.cc +index 59a67b1..88f8a6c 100644 +--- a/tensorflow/core/platform/posix/env_time.cc ++++ b/tensorflow/core/platform/posix/env_time.cc +@@ -18,6 +18,23 @@ limitations under the License. + + #include "tensorflow/core/platform/env_time.h" + ++// Slightly pruned version of https://gist.github.com/alfwatt/3588c5aa1f7a1ef7a3bb ++// Copyright (c) 2015-2018 Alf Watt - Open Source - https://opensource.org/licenses/MIT ++#if defined __APPLE__ ++#include <mach/clock.h> ++#include <mach/mach.h> ++int alt_clock_gettime (int clock_id, timespec *ts) { ++ clock_serv_t cclock; ++ mach_timespec_t mts; ++ host_get_clock_service (mach_host_self (), clock_id, &cclock); ++ clock_get_time (cclock, &mts); ++ mach_port_deallocate (mach_task_self (), cclock); ++ ts->tv_sec = mts.tv_sec; ++ ts->tv_nsec = mts.tv_nsec; ++ return 0; ++} ++#endif ++ + namespace tensorflow { + + namespace { +@@ -28,7 +45,11 @@ class PosixEnvTime : public EnvTime { + + uint64 NowNanos() override { + struct timespec ts; ++#if defined __APPLE__ ++ alt_clock_gettime(CALENDAR_CLOCK, &ts); ++#else + clock_gettime(CLOCK_REALTIME, &ts); ++#endif + return (static_cast<uint64>(ts.tv_sec) * kSecondsToNanos + + static_cast<uint64>(ts.tv_nsec)); + } +-- +2.7.4 + + diff --git a/recipe/patches/unbundle_llvm.patch b/recipe/patches/unbundle_llvm.patch new file mode 100644 index 0000000000000000000000000000000000000000..5c680bbe3d0ad425e081ca2f238f23466c6688cf --- /dev/null +++ b/recipe/patches/unbundle_llvm.patch @@ -0,0 +1,1464 @@ +commit 510c285f2ad0c4294a26730474e042742fd53454 +Author: Isuru Fernando <isuruf@gmail.com> +Date: Thu Aug 15 02:50:37 2019 +0000 + + Unbundle LLVM + +--- + tensorflow/workspace.bzl | 1 + + third_party/systemlibs/generate_llvm_build.py | 321 +++++ + third_party/systemlibs/llvm.BUILD | 1089 +++++++++++++++++ + third_party/systemlibs/syslibs_configure.bzl | 1 + + 4 files changed, 1412 insertions(+) + create mode 100644 third_party/systemlibs/generate_llvm_build.py + create mode 100644 third_party/systemlibs/llvm.BUILD + +diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl +index 262da77e..4f14f7b6 100755 +--- a/tensorflow/workspace.bzl ++++ b/tensorflow/workspace.bzl +@@ -612,6 +612,7 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""): + name = "llvm-project", + sha256 = LLVM_SHA256, + strip_prefix = "llvm-project-" + LLVM_COMMIT, ++ system_build_file = clean_dep("//third_party/systemlibs:llvm.BUILD"), + urls = LLVM_URLS, + additional_build_files = { + clean_dep("//third_party/llvm:llvm.autogenerated.BUILD"): "llvm/BUILD", +diff --git a/third_party/systemlibs/generate_llvm_build.py b/third_party/systemlibs/generate_llvm_build.py +new file mode 100644 +index 00000000..77070d3e +--- /dev/null ++++ b/third_party/systemlibs/generate_llvm_build.py +@@ -0,0 +1,321 @@ ++# Bazel BUILD file generator for system LLVM. ++ ++import os ++ ++llvm_libs = [ ++ "AArch64AsmParser", ++ "AArch64AsmPrinter", ++ "AArch64CodeGen", ++ "AArch64Desc", ++ "AArch64Disassembler", ++ "AArch64Info", ++ "AArch64Utils", ++ "AggressiveInstCombine", ++ "AMDGPUAsmParser", ++ "AMDGPUAsmPrinter", ++ "AMDGPUCodeGen", ++ "AMDGPUDesc", ++ "AMDGPUDisassembler", ++ "AMDGPUInfo", ++ "AMDGPUUtils", ++ "Analysis", ++ "ARMAsmParser", ++ "ARMAsmPrinter", ++ "ARMCodeGen", ++ "ARMDesc", ++ "ARMDisassembler", ++ "ARMInfo", ++ "ARMUtils", ++ "AsmParser", ++ "AsmPrinter", ++ "AVRAsmParser", ++ "AVRCodeGen", ++ "AVRDesc", ++ "AVRDisassembler", ++ "AVRInfo", ++ "BinaryFormat", ++ "BitReader", ++ "BitstreamReader", ++ "BitWriter", ++ "BPFAsmParser", ++ "BPFAsmPrinter", ++ "BPFCodeGen", ++ "BPFDesc", ++ "BPFDisassembler", ++ "BPFInfo", ++ "CodeGen", ++ "Core", ++ "Coroutines", ++ "Coverage", ++ "DebugInfoCodeView", ++ "DebugInfoDWARF", ++ "DebugInfoGSYM", ++ "DebugInfoMSF", ++ "DebugInfoPDB", ++ "Demangle", ++ "DlltoolDriver", ++ "ExecutionEngine", ++ "FuzzMutate", ++ "GlobalISel", ++ "HexagonAsmParser", ++ "HexagonCodeGen", ++ "HexagonDesc", ++ "HexagonDisassembler", ++ "HexagonInfo", ++ "InstCombine", ++ "Instrumentation", ++ "IntelJITEvents", ++ "Interpreter", ++ "ipo", ++ "IRReader", ++ "JITLink", ++ "LanaiAsmParser", ++ "LanaiAsmPrinter", ++ "LanaiCodeGen", ++ "LanaiDesc", ++ "LanaiDisassembler", ++ "LanaiInfo", ++ "LibDriver", ++ "LineEditor", ++ "Linker", ++ "LTO", ++ "MC", ++ "MCA", ++ "MCDisassembler", ++ "MCJIT", ++ "MCParser", ++ "MipsAsmParser", ++ "MipsAsmPrinter", ++ "MipsCodeGen", ++ "MipsDesc", ++ "MipsDisassembler", ++ "MipsInfo", ++ "MIRParser", ++ "MSP430AsmParser", ++ "MSP430AsmPrinter", ++ "MSP430CodeGen", ++ "MSP430Desc", ++ "MSP430Disassembler", ++ "MSP430Info", ++ "NVPTXAsmPrinter", ++ "NVPTXCodeGen", ++ "NVPTXDesc", ++ "NVPTXInfo", ++ "ObjCARCOpts", ++ "Object", ++ "ObjectYAML", ++ "Option", ++ "OptRemarks", ++ "OrcJIT", ++ "Passes", ++ "PowerPCAsmParser", ++ "PowerPCAsmPrinter", ++ "PowerPCCodeGen", ++ "PowerPCDesc", ++ "PowerPCDisassembler", ++ "PowerPCInfo", ++ "ProfileData", ++ "Remarks", ++ "RISCVAsmParser", ++ "RISCVCodeGen", ++ "RISCVDesc", ++ "RISCVDisassembler", ++ "RISCVInfo", ++ "RISCVUtils", ++ "RuntimeDyld", ++ "ScalarOpts", ++ "SelectionDAG", ++ "SparcAsmParser", ++ "SparcAsmPrinter", ++ "SparcCodeGen", ++ "SparcDesc", ++ "SparcDisassembler", ++ "SparcInfo", ++ "Support", ++ "Symbolize", ++ "SystemZAsmParser", ++ "SystemZAsmPrinter", ++ "SystemZCodeGen", ++ "SystemZDesc", ++ "SystemZDisassembler", ++ "SystemZInfo", ++ "TableGen", ++ "Target", ++ "TestingSupport", ++ "TextAPI", ++ "TransformUtils", ++ "Vectorize", ++ "WebAssemblyAsmParser", ++ "WebAssemblyAsmPrinter", ++ "WebAssemblyCodeGen", ++ "WebAssemblyDesc", ++ "WebAssemblyDisassembler", ++ "WebAssemblyInfo", ++ "WindowsManifest", ++ "X86AsmParser", ++ "X86AsmPrinter", ++ "X86CodeGen", ++ "X86Desc", ++ "X86Disassembler", ++ "X86Info", ++ "X86Utils", ++ "XCoreAsmPrinter", ++ "XCoreCodeGen", ++ "XCoreDesc", ++ "XCoreDisassembler", ++ "XCoreInfo", ++ "XRay" ++] ++ ++def process_name(name): ++ if name.endswith("Opts"): ++ return name[:-4].lower() ++ return name.lower() ++ ++llvm_libs_dict = dict((process_name(name), name) for name in llvm_libs) ++ ++llvm_libs_dict["scalar"] = "ScalarOpts" ++ ++ ++INIT_TEXT = """ ++# Bazel BUILD file for system LLVM ++# ++# Auto-generated by generate_llvm_build.py ++ ++licenses(["notice"]) ++ ++filegroup( ++ name = "LICENSE.TXT", ++ visibility = ["//visibility:public"], ++) ++ ++load( ++ "@org_tensorflow//third_party/llvm:llvm.bzl", ++ "cmake_var_string", ++ "expand_cmake_vars", ++ "gentbl", ++ "llvm_all_cmake_vars", ++ "llvm_copts", ++ "llvm_defines", ++ "llvm_linkopts", ++ "llvm_support_platform_specific_srcs_glob", ++) ++ ++# Binary targets used by Tensorflow. ++genrule( ++ name = "lnllvmtblgenlink", ++ outs = ["llvmtblgenlink"], ++ cmd = "ln -s $$(which llvm-tblgen) $@", ++) ++ ++sh_binary( ++ name = "llvm-tblgen", ++ srcs = ["llvmtblgenlink"], ++ visibility = ["//visibility:public"], ++) ++ ++genrule( ++ name = "lnfilecheck", ++ outs = ["filechecklink"], ++ cmd = "ln -s $$(which FileCheck) $@", ++) ++ ++sh_binary( ++ name = "FileCheck", ++ srcs = ["filechecklink"], ++ visibility = ["//visibility:public"], ++) ++ ++cc_library( ++ name = "config", ++ defines = llvm_defines, ++ visibility = ["//visibility:public"], ++) ++ ++cc_library( ++ name = "x86_defs", ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ] ++) ++""" ++ ++skipped_deps = [ ++ ":attributes_compat_gen", ++ ":attributes_gen", ++ ":intrinsic_enums_gen", ++ ":intrinsics_impl_gen", ++ ":aarch64_target_gen", ++ ":x86_target_gen", ++ ":arm_target_gen", ++ ":instcombine_transforms_gen", ++] ++ ++def cc_library(**kwargs): ++ name = kwargs.get("name") ++ if name in ["config", "x86_defs", "gtest", "gtest_main"]: ++ return ++ libname = name ++ if libname.startswith("arc_"): ++ libname = "sp" + libname ++ libname = llvm_libs_dict.get(libname.replace("_", ""), name) ++ deps = kwargs.get("deps", []) ++ deps = [d for d in deps if d not in skipped_deps] ++ if not deps: ++ print(f""" ++cc_library( ++ name = "{name}", ++ linkopts = ["-lLLVM{libname}"], ++ visibility = ["//visibility:public"], ++)""") ++ else: ++ deps_line = "\",\n \"".join(deps) ++ print(f""" ++cc_library( ++ name = "{name}", ++ linkopts = ["-lLLVM{libname}"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ "{deps_line}", ++ ], ++)""") ++ ++def glob(*args, **kwargs): # pylint: disable=unused-argument ++ return [] ++ ++ ++def genrule(*args, **kwargs): # pylint: disable=unused-argument ++ pass ++ ++llvm_support_platform_specific_srcs_glob = glob ++licenses = exports_files = load = package = expand_cmake_vars = genrule ++py_binary = template_rule = gentbl = cc_binary = filegroup = genrule ++llvm_copts = llvm_all_cmake_vars = llvm_defines = llvm_linkopts = [] ++ ++licenses(["notice"]) ++ ++exports_files(["LICENSE.TXT"]) ++ ++load( ++ "@org_tensorflow//third_party/llvm:llvm.bzl", ++ "cmake_var_string", ++ "expand_cmake_vars", ++ "gentbl", ++ "llvm_all_cmake_vars", ++ "llvm_copts", ++ "llvm_defines", ++ "llvm_linkopts", ++ "llvm_support_platform_specific_srcs_glob", ++) ++load( ++ "@org_tensorflow//third_party:common.bzl", ++ "template_rule", ++) ++ ++third_party_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) ++build_path = os.path.join(third_party_dir, "llvm", "llvm.autogenerated.BUILD") ++ ++print(INIT_TEXT) ++with open(build_path, "r") as f: ++ exec(f.read()) +diff --git a/third_party/systemlibs/llvm.BUILD b/third_party/systemlibs/llvm.BUILD +new file mode 100644 +index 00000000..c6e9b9b1 +--- /dev/null ++++ b/third_party/systemlibs/llvm.BUILD +@@ -0,0 +1,1089 @@ ++ ++# Bazel BUILD file for system LLVM ++# ++# Auto-generated by generate_llvm_build.py ++ ++licenses(["notice"]) ++ ++filegroup( ++ name = "LICENSE.TXT", ++ visibility = ["//visibility:public"], ++) ++ ++load( ++ "@org_tensorflow//third_party/llvm:llvm.bzl", ++ "cmake_var_string", ++ "expand_cmake_vars", ++ "gentbl", ++ "llvm_all_cmake_vars", ++ "llvm_copts", ++ "llvm_defines", ++ "llvm_linkopts", ++ "llvm_support_platform_specific_srcs_glob", ++) ++ ++# Binary targets used by Tensorflow. ++genrule( ++ name = "lnllvmtblgenlink", ++ outs = ["llvmtblgenlink"], ++ cmd = "ln -s $$(which llvm-tblgen) $@", ++) ++ ++sh_binary( ++ name = "llvm-tblgen", ++ srcs = ["llvmtblgenlink"], ++ visibility = ["//visibility:public"], ++) ++ ++genrule( ++ name = "lnfilecheck", ++ outs = ["filechecklink"], ++ cmd = "ln -s $$(which FileCheck) $@", ++) ++ ++sh_binary( ++ name = "FileCheck", ++ srcs = ["filechecklink"], ++ visibility = ["//visibility:public"], ++) ++ ++cc_library( ++ name = "config", ++ defines = llvm_defines, ++ visibility = ["//visibility:public"], ++) ++ ++cc_library( ++ name = "x86_defs", ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ] ++) ++ ++ ++cc_library( ++ name = "aarch64_asm_parser", ++ linkopts = ["-lLLVMAArch64AsmParser"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":aarch64_desc", ++ ":aarch64_info", ++ ":aarch64_utils", ++ ":config", ++ ":mc", ++ ":mc_parser", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "aarch64_asm_printer", ++ linkopts = ["-lLLVMAArch64AsmPrinter"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":aarch64_utils", ++ ":config", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "aarch64_code_gen", ++ linkopts = ["-lLLVMAArch64CodeGen"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":aarch64_asm_printer", ++ ":aarch64_desc", ++ ":aarch64_info", ++ ":aarch64_utils", ++ ":analysis", ++ ":asm_printer", ++ ":code_gen", ++ ":config", ++ ":core", ++ ":global_i_sel", ++ ":mc", ++ ":scalar", ++ ":selection_dag", ++ ":support", ++ ":target", ++ ], ++) ++ ++cc_library( ++ name = "aarch64_desc", ++ linkopts = ["-lLLVMAArch64Desc"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":aarch64_asm_printer", ++ ":aarch64_info", ++ ":config", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "aarch64_disassembler", ++ linkopts = ["-lLLVMAArch64Disassembler"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":aarch64_desc", ++ ":aarch64_info", ++ ":aarch64_utils", ++ ":config", ++ ":mc", ++ ":mc_disassembler", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "aarch64_info", ++ linkopts = ["-lLLVMAArch64Info"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":code_gen", ++ ":config", ++ ":support", ++ ":target", ++ ], ++) ++ ++cc_library( ++ name = "aarch64_utils", ++ linkopts = ["-lLLVMAArch64Utils"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "aggressive_inst_combine", ++ linkopts = ["-lLLVMAggressiveInstCombine"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":config", ++ ":core", ++ ":support", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "analysis", ++ linkopts = ["-lLLVMAnalysis"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":binary_format", ++ ":config", ++ ":core", ++ ":object", ++ ":profile_data", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "amdgpu_desc", ++ linkopts = ["-lLLVMAMDGPUDesc"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":amdgpu_asm_printer", ++ ":amdgpu_info", ++ ":amdgpu_utils", ++ ":config", ++ ":core", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "amdgpu_disassembler", ++ linkopts = ["-lLLVMAMDGPUDisassembler"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":amdgpu_desc", ++ ":amdgpu_info", ++ ":amdgpu_utils", ++ ":config", ++ ":mc", ++ ":mc_disassembler", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "amdgpu_info", ++ linkopts = ["-lLLVMAMDGPUInfo"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":amdgpu_r600_target_gen", ++ ":amdgpu_target_gen", ++ ":config", ++ ":core", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "amdgpu_utils", ++ linkopts = ["-lLLVMAMDGPUUtils"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":amdgpu_r600_target_gen", ++ ":amdgpu_target_gen", ++ ":config", ++ ":core", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "amdgpu_asm_parser", ++ linkopts = ["-lLLVMAMDGPUAsmParser"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":amdgpu_desc", ++ ":amdgpu_info", ++ ":amdgpu_utils", ++ ":config", ++ ":mc", ++ ":mc_parser", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "amdgpu_asm_printer", ++ linkopts = ["-lLLVMAMDGPUAsmPrinter"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":amdgpu_utils", ++ ":config", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "amdgpu_code_gen", ++ linkopts = ["-lLLVMAMDGPUCodeGen"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":amdgpu_asm_printer", ++ ":amdgpu_desc", ++ ":amdgpu_info", ++ ":amdgpu_utils", ++ ":analysis", ++ ":asm_printer", ++ ":code_gen", ++ ":config", ++ ":core", ++ ":global_i_sel", ++ ":ipo", ++ ":mc", ++ ":scalar", ++ ":selection_dag", ++ ":support", ++ ":target", ++ ":transform_utils", ++ ":vectorize", ++ ], ++) ++ ++cc_library( ++ name = "arm_asm_parser", ++ linkopts = ["-lLLVMARMAsmParser"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":arm_asm_printer", ++ ":arm_desc", ++ ":arm_info", ++ ":arm_utils", ++ ":config", ++ ":mc", ++ ":mc_parser", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "arm_asm_printer", ++ linkopts = ["-lLLVMARMAsmPrinter"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":arm_info", ++ ":arm_utils", ++ ":config", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "arm_code_gen", ++ linkopts = ["-lLLVMARMCodeGen"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":arm_asm_printer", ++ ":arm_desc", ++ ":arm_info", ++ ":arm_utils", ++ ":asm_printer", ++ ":code_gen", ++ ":config", ++ ":core", ++ ":global_i_sel", ++ ":mc", ++ ":scalar", ++ ":selection_dag", ++ ":support", ++ ":target", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "arm_desc", ++ linkopts = ["-lLLVMARMDesc"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":arm_asm_printer", ++ ":arm_info", ++ ":config", ++ ":mc", ++ ":mc_disassembler", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "arm_disassembler", ++ linkopts = ["-lLLVMARMDisassembler"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":arm_desc", ++ ":arm_info", ++ ":arm_utils", ++ ":config", ++ ":mc_disassembler", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "arm_info", ++ linkopts = ["-lLLVMARMInfo"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":support", ++ ":target", ++ ], ++) ++ ++cc_library( ++ name = "arm_utils", ++ linkopts = ["-lLLVMARMUtils"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "asm_parser", ++ linkopts = ["-lLLVMAsmParser"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":binary_format", ++ ":config", ++ ":core", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "asm_printer", ++ linkopts = ["-lLLVMAsmPrinter"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":binary_format", ++ ":code_gen", ++ ":config", ++ ":core", ++ ":debug_info_code_view", ++ ":debug_info_msf", ++ ":mc", ++ ":mc_parser", ++ ":support", ++ ":target", ++ ], ++) ++ ++cc_library( ++ name = "binary_format", ++ linkopts = ["-lLLVMBinaryFormat"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "bit_reader", ++ linkopts = ["-lLLVMBitReader"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":core", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "bit_writer", ++ linkopts = ["-lLLVMBitWriter"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":config", ++ ":core", ++ ":mc", ++ ":object", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "code_gen", ++ linkopts = ["-lLLVMCodeGen"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":bit_reader", ++ ":bit_writer", ++ ":config", ++ ":core", ++ ":instrumentation", ++ ":mc", ++ ":profile_data", ++ ":scalar", ++ ":support", ++ ":target", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "core", ++ linkopts = ["-lLLVMCore"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":binary_format", ++ ":config", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "debug_info_code_view", ++ linkopts = ["-lLLVMDebugInfoCodeView"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":binary_format", ++ ":config", ++ ":debug_info_msf", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "debug_info_msf", ++ linkopts = ["-lLLVMDebugInfoMSF"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "demangle", ++ linkopts = ["-lLLVMDemangle"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ], ++) ++ ++cc_library( ++ name = "execution_engine", ++ linkopts = ["-lLLVMExecutionEngine"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":core", ++ ":mc", ++ ":object", ++ ":runtime_dyld", ++ ":support", ++ ":target", ++ ], ++) ++ ++cc_library( ++ name = "global_i_sel", ++ linkopts = ["-lLLVMGlobalISel"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":code_gen", ++ ":config", ++ ":core", ++ ":mc", ++ ":support", ++ ":target", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "instrumentation", ++ linkopts = ["-lLLVMInstrumentation"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":config", ++ ":core", ++ ":mc", ++ ":profile_data", ++ ":support", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "inst_combine", ++ linkopts = ["-lLLVMInstCombine"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":config", ++ ":core", ++ ":support", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "ipo", ++ linkopts = ["-lLLVMipo"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":aggressive_inst_combine", ++ ":analysis", ++ ":bit_reader", ++ ":bit_writer", ++ ":config", ++ ":core", ++ ":inst_combine", ++ ":instrumentation", ++ ":ir_reader", ++ ":linker", ++ ":object", ++ ":profile_data", ++ ":scalar", ++ ":support", ++ ":transform_utils", ++ ":vectorize", ++ ], ++) ++ ++cc_library( ++ name = "ir_reader", ++ linkopts = ["-lLLVMIRReader"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":asm_parser", ++ ":bit_reader", ++ ":config", ++ ":core", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "linker", ++ linkopts = ["-lLLVMLinker"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":core", ++ ":support", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "mc", ++ linkopts = ["-lLLVMMC"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":binary_format", ++ ":config", ++ ":debug_info_code_view", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "mc_disassembler", ++ linkopts = ["-lLLVMMCDisassembler"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "mc_parser", ++ linkopts = ["-lLLVMMCParser"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "nvptx_asm_printer", ++ linkopts = ["-lLLVMNVPTXAsmPrinter"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ "nvptx_target_gen", ++ ":config", ++ ":mc", ++ ":nvptx_info", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "nvptx_code_gen", ++ linkopts = ["-lLLVMNVPTXCodeGen"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":asm_printer", ++ ":code_gen", ++ ":config", ++ ":core", ++ ":ipo", ++ ":mc", ++ ":nvptx_asm_printer", ++ ":nvptx_desc", ++ ":nvptx_info", ++ ":scalar", ++ ":selection_dag", ++ ":support", ++ ":target", ++ ":transform_utils", ++ ":vectorize", ++ ], ++) ++ ++cc_library( ++ name = "nvptx_desc", ++ linkopts = ["-lLLVMNVPTXDesc"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ "nvptx_target_gen", ++ ":config", ++ ":mc", ++ ":nvptx_asm_printer", ++ ":nvptx_info", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "nvptx_info", ++ linkopts = ["-lLLVMNVPTXInfo"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ "nvptx_target_gen", ++ ":config", ++ ":core", ++ ":support", ++ ":target", ++ ], ++) ++ ++cc_library( ++ name = "object", ++ linkopts = ["-lLLVMObject"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":binary_format", ++ ":bit_reader", ++ ":config", ++ ":core", ++ ":mc", ++ ":mc_parser", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "objc_arc", ++ linkopts = ["-lLLVMObjCARCOpts"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":config", ++ ":core", ++ ":support", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "orc_jit", ++ linkopts = ["-lLLVMOrcJIT"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":core", ++ ":execution_engine", ++ ":mc", ++ ":object", ++ ":runtime_dyld", ++ ":support", ++ ":target", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "powerpc_asm_parser", ++ linkopts = ["-lLLVMPowerPCAsmParser"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":mc_parser", ++ ":powerpc_desc", ++ ":powerpc_info", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "powerpc_asm_printer", ++ linkopts = ["-lLLVMPowerPCAsmPrinter"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":powerpc_info", ++ ":powerpc_target_gen", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "powerpc_code_gen", ++ linkopts = ["-lLLVMPowerPCCodeGen"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":asm_printer", ++ ":code_gen", ++ ":config", ++ ":core", ++ ":mc", ++ ":powerpc_asm_printer", ++ ":powerpc_desc", ++ ":powerpc_info", ++ ":scalar", ++ ":selection_dag", ++ ":support", ++ ":target", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "powerpc_desc", ++ linkopts = ["-lLLVMPowerPCDesc"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":powerpc_asm_printer", ++ ":powerpc_info", ++ ":powerpc_target_gen", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "powerpc_disassembler", ++ linkopts = ["-lLLVMPowerPCDisassembler"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc_disassembler", ++ ":powerpc_info", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "powerpc_info", ++ linkopts = ["-lLLVMPowerPCInfo"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":core", ++ ":powerpc_target_gen", ++ ":support", ++ ":target", ++ ], ++) ++ ++cc_library( ++ name = "profile_data", ++ linkopts = ["-lLLVMProfileData"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":core", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "runtime_dyld", ++ linkopts = ["-lLLVMRuntimeDyld"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":mc_disassembler", ++ ":object", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "scalar", ++ linkopts = ["-lLLVMScalarOpts"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":aggressive_inst_combine", ++ ":analysis", ++ ":config", ++ ":core", ++ ":inst_combine", ++ ":support", ++ ":target", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "selection_dag", ++ linkopts = ["-lLLVMSelectionDAG"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":code_gen", ++ ":config", ++ ":core", ++ ":mc", ++ ":support", ++ ":target", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "support", ++ linkopts = ["-lLLVMSupport"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":demangle", ++ "@zlib_archive//:zlib", ++ ], ++) ++ ++cc_library( ++ name = "table_gen", ++ linkopts = ["-lLLVMTableGen"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "target", ++ linkopts = ["-lLLVMTarget"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":config", ++ ":core", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "transform_utils", ++ linkopts = ["-lLLVMTransformUtils"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":config", ++ ":core", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "vectorize", ++ linkopts = ["-lLLVMVectorize"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":config", ++ ":core", ++ ":scalar", ++ ":support", ++ ":transform_utils", ++ ], ++) ++ ++cc_library( ++ name = "x86_asm_parser", ++ linkopts = ["-lLLVMX86AsmParser"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":mc_parser", ++ ":support", ++ ":x86_asm_printer", ++ ":x86_desc", ++ ":x86_info", ++ ], ++) ++ ++cc_library( ++ name = "x86_asm_printer", ++ linkopts = ["-lLLVMX86AsmPrinter"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":support", ++ ":x86_info", ++ ":x86_utils", ++ ], ++) ++ ++cc_library( ++ name = "x86_code_gen", ++ linkopts = ["-lLLVMX86CodeGen"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":analysis", ++ ":asm_printer", ++ ":code_gen", ++ ":config", ++ ":core", ++ ":global_i_sel", ++ ":mc", ++ ":profile_data", ++ ":selection_dag", ++ ":support", ++ ":target", ++ ":x86_asm_printer", ++ ":x86_defs", ++ ":x86_desc", ++ ":x86_info", ++ ":x86_utils", ++ ], ++) ++ ++cc_library( ++ name = "x86_desc", ++ linkopts = ["-lLLVMX86Desc"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":mc_disassembler", ++ ":object", ++ ":support", ++ ":x86_asm_printer", ++ ":x86_info", ++ ], ++) ++ ++cc_library( ++ name = "x86_disassembler", ++ linkopts = ["-lLLVMX86Disassembler"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc_disassembler", ++ ":support", ++ ":x86_info", ++ ], ++) ++ ++cc_library( ++ name = "x86_info", ++ linkopts = ["-lLLVMX86Info"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":config", ++ ":mc", ++ ":support", ++ ], ++) ++ ++cc_library( ++ name = "x86_utils", ++ linkopts = ["-lLLVMX86Utils"], ++ visibility = ["//visibility:public"], ++ deps = [ ++ ":code_gen", ++ ":config", ++ ":support", ++ ], ++) +diff --git a/third_party/systemlibs/syslibs_configure.bzl b/third_party/systemlibs/syslibs_configure.bzl +index 217c0131..9e895232 100644 +--- a/third_party/systemlibs/syslibs_configure.bzl ++++ b/third_party/systemlibs/syslibs_configure.bzl +@@ -30,6 +30,7 @@ VALID_LIBS = [ + "icu", + "jsoncpp_git", + "libjpeg_turbo", ++ "llvm", + "lmdb", + "nasm", + "nsync", +-- +2.17.1 + diff --git a/recipe/run_test.py b/recipe/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..25bee61cbabb1ef8109786274e8bcccf27abefa6 --- /dev/null +++ b/recipe/run_test.py @@ -0,0 +1,7 @@ +import tensorflow as tf +hello = tf.constant('Hello, TensorFlow!') +sess = tf.Session() +out = sess.run(hello) +a = tf.constant(10) +b = tf.constant(32) +sess.run(a+b) diff --git a/recipe/test_c.c b/recipe/test_c.c new file mode 100644 index 0000000000000000000000000000000000000000..b30c46fab695620c46827b0ffa128a392d17fa49 --- /dev/null +++ b/recipe/test_c.c @@ -0,0 +1,7 @@ +#include <stdio.h> +#include <tensorflow/c/c_api.h> + +int main() { + printf("Hello from TensorFlow C library version %s\n", TF_Version()); + return 0; +} diff --git a/recipe/test_cc.cc b/recipe/test_cc.cc new file mode 100644 index 0000000000000000000000000000000000000000..ec44f17d9047011b12804f7252a6433e3d29fd06 --- /dev/null +++ b/recipe/test_cc.cc @@ -0,0 +1,30 @@ +// test tensorflow_cc +// https://www.tensorflow.org/guide/extend/cc +#include "tensorflow/core/public/session.h" +#include "tensorflow/core/platform/env.h" +#include "tensorflow/core/framework/op.h" +#include "tensorflow/core/framework/op_kernel.h" +#include "tensorflow/core/framework/shape_inference.h" + +#include "tensorflow/cc/client/client_session.h" +#include "tensorflow/cc/ops/standard_ops.h" +#include "tensorflow/core/framework/tensor.h" + +int main() { + using namespace tensorflow; + using namespace tensorflow::ops; + Scope root = Scope::NewRootScope(); + // Matrix A = [3 2; -1 0] + auto A = Const(root, { {3.f, 2.f}, {-1.f, 0.f} }); + // Vector b = [3 5] + auto b = Const(root, { {3.f, 5.f} }); + // v = Ab^T + auto v = MatMul(root.WithOpName("v"), A, b, MatMul::TransposeB(true)); + std::vector<Tensor> outputs; + ClientSession session(root); + // Run and fetch v + TF_CHECK_OK(session.Run({v}, &outputs)); + // Expect outputs[0] == [19; -3] + LOG(INFO) << outputs[0].matrix<float>(); + return 0; +}