diff options
author | 2016-09-09 14:05:27 -0800 | |
---|---|---|
committer | 2016-09-09 15:22:58 -0700 | |
commit | c6fd14273ba51aeab699643066533046da86d8f0 (patch) | |
tree | 9dd39905311b9abf1a4f1cda8d41273b273b665f | |
parent | 663bc0048148fb42ebeae455c3e366245c4d292a (diff) |
Added convenience script to build the makefile for Linux
Change: 132721140
-rwxr-xr-x | tensorflow/contrib/makefile/build_all_linux.sh | 36 | ||||
-rwxr-xr-x | tensorflow/contrib/makefile/compile_linux_protobuf.sh | 56 |
2 files changed, 92 insertions, 0 deletions
diff --git a/tensorflow/contrib/makefile/build_all_linux.sh b/tensorflow/contrib/makefile/build_all_linux.sh new file mode 100755 index 0000000000..5f98063c97 --- /dev/null +++ b/tensorflow/contrib/makefile/build_all_linux.sh @@ -0,0 +1,36 @@ +#!/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. +# ============================================================================== +# Downloads and builds all of TensorFlow's dependencies for Linux, and compiles +# the TensorFlow library itself. Supported on Ubuntu 14.04 and 16.04. + +set -e + +# Make sure we're in the correct directory, at the root of the source tree. +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd ${SCRIPT_DIR}/../../../ + +# Remove any old files first. +make -f tensorflow/contrib/makefile/Makefile clean +rm -rf tensorflow/contrib/makefile/downloads + +# Pull down the required versions of the frameworks we need. +tensorflow/contrib/makefile/download_dependencies.sh + +# Compile protobuf. +tensorflow/contrib/makefile/compile_linux_protobuf.sh + +# Build TensorFlow. +make -f tensorflow/contrib/makefile/Makefile OPTFLAGS="-O3" -j 8 diff --git a/tensorflow/contrib/makefile/compile_linux_protobuf.sh b/tensorflow/contrib/makefile/compile_linux_protobuf.sh new file mode 100755 index 0000000000..db3b0fb345 --- /dev/null +++ b/tensorflow/contrib/makefile/compile_linux_protobuf.sh @@ -0,0 +1,56 @@ +#!/bin/bash -e +# Copyright 2015 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. +# ============================================================================== +# Builds protobuf 3 for Linux inside the local build tree. + +GENDIR="$(pwd)/gen/protobuf" +HOST_GENDIR="$(pwd)/gen/protobuf-host" +mkdir -p "${GENDIR}" +mkdir -p "${HOST_GENDIR}" + +if [[ ! -f "tensorflow/contrib/makefile/downloads/protobuf/autogen.sh" ]]; then + echo "You need to download dependencies before running this script." 1>&2 + echo "tensorflow/contrib/makefile/download_dependencies.sh" 1>&2 + exit 1 +fi + +cd tensorflow/contrib/makefile/downloads/protobuf + +./autogen.sh +if [ $? -ne 0 ] +then + echo "./autogen.sh command failed." + exit 1 +fi + +./configure --prefix="${GENDIR}" +if [ $? -ne 0 ] +then + echo "./configure command failed." + exit 1 +fi + +make clean + +make -j 8 +if [ $? -ne 0 ] +then + echo "make command failed." + exit 1 +fi + +make install + +echo "$(basename $0) finished successfully!!!" |