• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15# ==============================================================================
16
17# This shell script is used to build TensorFlow Lite Flex runtime for iOS.
18# It compiles TensorFlow Lite and TensorFlow codebases together, and enable a
19# route to use TensorFlow kernels in TensorFlow Lite.
20#
21# After the script is executed, the multi-architecture static libraries will be
22# created under: `tensorflow/contrib/makefile/gen/lib/`.
23
24set -e
25
26SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
27TOP_SRCDIR="${SCRIPT_DIR}/../../../"
28cd ${TOP_SRCDIR}
29
30# Exporting `WITH_TFLITE_FLEX`. The flag will be propagated all the way
31# down to Makefile.
32export WITH_TFLITE_FLEX="true"
33# Execute `build_all_ios.sh` and propagate all parameters.
34tensorflow/contrib/makefile/build_all_ios.sh $*
35
36# Copy all the libraries required for TFLite Flex runtime together.
37cd "${TOP_SRCDIR}/tensorflow/contrib/makefile"
38cp 'downloads/nsync/builds/lipo.ios.c++11/nsync.a' 'gen/lib/'
39cp 'gen/protobuf_ios/lib/libprotobuf.a' 'gen/lib/'
40cp 'gen/lib/libtensorflow-core.a' 'gen/lib/libtensorflow-lite.a'
41