diff options
author | Patrick Nguyen <drpng@google.com> | 2017-01-16 22:23:02 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-01-16 22:45:02 -0800 |
commit | 97c893338ca9f89906632efd2ce5efd91d0f7eb7 (patch) | |
tree | d0087c723b88fe916ec64d12ff0dd6a02fa8d0fe /tensorflow/tools/lib_package | |
parent | cddb86ff7bedf1150b3be8e22a0cbf03f6c58de6 (diff) |
Automated rollback of change 144470928
Change: 144673014
Diffstat (limited to 'tensorflow/tools/lib_package')
-rw-r--r-- | tensorflow/tools/lib_package/BUILD | 75 | ||||
-rw-r--r-- | tensorflow/tools/lib_package/README.md | 31 | ||||
-rwxr-xr-x | tensorflow/tools/lib_package/concat_licenses.sh | 28 | ||||
-rw-r--r-- | tensorflow/tools/lib_package/libtensorflow_test.c | 28 | ||||
-rwxr-xr-x | tensorflow/tools/lib_package/libtensorflow_test.sh | 48 |
5 files changed, 0 insertions, 210 deletions
diff --git a/tensorflow/tools/lib_package/BUILD b/tensorflow/tools/lib_package/BUILD deleted file mode 100644 index d15db41ff4..0000000000 --- a/tensorflow/tools/lib_package/BUILD +++ /dev/null @@ -1,75 +0,0 @@ -# Packaging the TensorFlow C API into a small, standalone archive for use with -# language bindings and installations without Python. -# -# TODO(ashankar): Something similar for the JNI library for Java? -# TODO(ashankar): Something similar for the C++ API (caveat: ABI compatibility) - -package(default_visibility = ["//visibility:private"]) - -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") - -pkg_tar( - name = "libtensorflow", - extension = "tar.gz", - deps = [ - ":cheaders", - ":clib", - ":clicenses", - ], -) - -pkg_tar( - name = "cheaders", - files = ["//tensorflow/c:headers"], - package_dir = "include/tensorflow/c", -) - -pkg_tar( - name = "clib", - files = ["//tensorflow:libtensorflow.so"], - package_dir = "lib", -) - -pkg_tar( - name = "clicenses", - files = [":include/tensorflow/c/LICENSE"], - package_dir = "include/tensorflow/c", -) - -genrule( - name = "clicenses_generate", - srcs = [ - "//third_party/hadoop:LICENSE.txt", - "//third_party/eigen3:LICENSE", - "@boringssl//:LICENSE", - "@com_googlesource_code_re2//:LICENSE", - "@curl//:COPYING", - "@eigen_archive//:COPYING.MPL2", - "@farmhash_archive//:COPYING", - "@gemmlowp//:LICENSE", - "@gif_archive//:COPYING", - "@grpc//:LICENSE", - "@highwayhash//:LICENSE", - "@jemalloc//:COPYING", - "@jpeg//:LICENSE.md", - "@libxsmm_archive//:LICENSE", - "@local_config_sycl//sycl:LICENSE.text", - "@nanopb_git//:LICENSE.txt", - "@png_archive//:LICENSE", - "@protobuf//:LICENSE", - "@zlib_archive//:zlib.h", - ], - outs = ["include/tensorflow/c/LICENSE"], - cmd = "$(location :concat_licenses.sh) $(SRCS) >$@", - tools = [":concat_licenses.sh"], -) - -sh_test( - name = "libtensorflow_test", - size = "small", - srcs = ["libtensorflow_test.sh"], - data = [ - "libtensorflow_test.c", - ":libtensorflow.tar.gz", - ], -) diff --git a/tensorflow/tools/lib_package/README.md b/tensorflow/tools/lib_package/README.md deleted file mode 100644 index fbec0a067a..0000000000 --- a/tensorflow/tools/lib_package/README.md +++ /dev/null @@ -1,31 +0,0 @@ -Bazel rules to package the TensorFlow C-library and [header -files](https://www.tensorflow.org/code/tensorflow/c/c_api.h) -into an archive. - -## TensorFlow C library - -The TensorFlow [C -API](https://www.tensorflow.org/code/tensorflow/c/c_api.h) -is typically a requirement of TensorFlow APIs in other languages such as -[Go](https://www.tensorflow.org/code/tensorflow/go) -and [Rust](https://github.com/tensorflow/rust). - -The command: - -```sh -bazel build -c opt //tensorflow/tools/lib_package:libtensorflow -``` - -produces `bazel-bin/tensorflow/tools/lib_package/libtensorflow.tar.gz`, which -can be distributed and installed using something like: - -```sh -tar -C /usr/local -xzf libtensorflow.tar.gz -``` - -## Release - -Scripts to generate archives using these rules for release are in -[tensorflow/tools/ci_build/linux](https://www.tensorflow.org/code/tensorflow/tools/ci_build/linux) -and -[tensorflow/tools/ci_build/osx](https://www.tensorflow.org/code/tensorflow/tools/ci_build/osx) diff --git a/tensorflow/tools/lib_package/concat_licenses.sh b/tensorflow/tools/lib_package/concat_licenses.sh deleted file mode 100755 index 2070f64e9f..0000000000 --- a/tensorflow/tools/lib_package/concat_licenses.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2016 The TensorFlow 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. -# ============================================================================== -# -# Script aimed to combining multiple license files into a single one. - -for f in $@ -do - echo "--------------------------------------------------------------------------------" - echo "BEGIN LICENSE FOR $f" - echo "--------------------------------------------------------------------------------" - cat $f - echo "--------------------------------------------------------------------------------" - echo "END LICENSE FOR $f" - echo "--------------------------------------------------------------------------------" -done diff --git a/tensorflow/tools/lib_package/libtensorflow_test.c b/tensorflow/tools/lib_package/libtensorflow_test.c deleted file mode 100644 index dff6fb77ec..0000000000 --- a/tensorflow/tools/lib_package/libtensorflow_test.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2016 The TensorFlow 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. -==============================================================================*/ - -// Companion source file for libtensorflow_test.sh - -#include <tensorflow/c/c_api.h> - -int main() { - TF_Status* s = TF_NewStatus(); - TF_SetStatus(s, TF_UNKNOWN, "Some error"); - if (TF_GetCode(s) != TF_UNKNOWN) { - return 1; - } - TF_DeleteStatus(s); - return 0; -} diff --git a/tensorflow/tools/lib_package/libtensorflow_test.sh b/tensorflow/tools/lib_package/libtensorflow_test.sh deleted file mode 100755 index 6463ecea70..0000000000 --- a/tensorflow/tools/lib_package/libtensorflow_test.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2016 The TensorFlow 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. -# ============================================================================== - -set -ex - -# Sanity test for the package C-library archive. -# - Unarchive -# - Compile a trivial C file that uses the archive -# - Run it - -# Tools needed: A C-compiler and tar -CC="${CC}" -TAR="${TAR}" - -[ -z "${CC}" ] && CC="/usr/bin/gcc" -[ -z "${TAR}"] && TAR="tar" - -# bazel tests run with ${PWD} set to the root of the bazel workspace -TARFILE="${PWD}/tensorflow/tools/lib_package/libtensorflow.tar.gz" -CFILE="${PWD}/tensorflow/tools/lib_package/libtensorflow_test.c" - -cd ${TEST_TMPDIR} - -# Extract the archive into tensorflow/ -mkdir tensorflow -${TAR} -xzf ${TARFILE} -Ctensorflow - -# Compile the test .c file -${CC} ${CFILE} -Itensorflow/include -Ltensorflow/lib -ltensorflow -oa.out - -# Execute it, with the shared library available. -# DYLD_LIBRARY_PATH is used on OS X, LD_LIBRARY_PATH on Linux -export DYLD_LIBRARY_PATH=tensorflow/lib -export LD_LIBRARY_PATH=tensorflow/lib -./a.out |