Skip to content

Commit

Permalink
Merge pull request #144 from FloopCZ/tf-mastert
Browse files Browse the repository at this point in the history
Update to tensorflow v1.12.0
  • Loading branch information
FloopCZ authored Nov 15, 2018
2 parents 3bd71f7 + c772b46 commit 91997b1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tensorflow_cc
[![Build Status](http://ash.floop.cz:8080/buildStatus/icon?job=tensorflow_cc)](http://ash.floop.cz:8080/job/tensorflow_cc/)
[![TF version](https://img.shields.io/badge/TF%20version-1.9.0-brightgreen.svg)]()
[![TF version](https://img.shields.io/badge/TF%20version-1.12.0-brightgreen.svg)]()

This repository makes possible the usage of the [TensorFlow C++](https://www.tensorflow.org/api_docs/cc/) API from the outside of the TensorFlow source code folders and without the use of the [Bazel](https://bazel.build/) build system.

Expand Down
6 changes: 4 additions & 2 deletions tensorflow_cc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(
"tensorflow_cc"
VERSION 1.9.0
VERSION 1.12.0
)

# Static library with no GPU support is built by default.
Expand All @@ -10,7 +10,7 @@ project(
option(TENSORFLOW_SHARED "Build shared library (required for GPU support)." OFF)
option(ALLOW_CUDA "When building the shared library, try to find and use CUDA." ON)
option(TENSORFLOW_STATIC "Build static library." ON)
set(TENSORFLOW_TAG "v1.9.0" CACHE STRING "The tensorflow release tag to be checked out (default v1.9.0).")
set(TENSORFLOW_TAG "v1.12.0" CACHE STRING "The tensorflow release tag to be checked out (default v1.12.0).")
option(SYSTEM_PROTOBUF "Use system protobuf instead of static protobuf from contrib/makefile." OFF)

# -------------
Expand Down Expand Up @@ -72,6 +72,7 @@ if(TENSORFLOW_SHARED)
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/bazel-genfiles"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/bazel-genfiles/genfiles"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/downloads"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/downloads/absl"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/downloads/eigen"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/downloads/gemmlowp"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/downloads/nsync/public"
Expand Down Expand Up @@ -121,6 +122,7 @@ if(TENSORFLOW_STATIC)
"${CMAKE_INSTALL_PREFIX}/include/tensorflow"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/gen/host_obj"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/downloads"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/downloads/absl"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/downloads/eigen"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/downloads/gemmlowp"
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/tensorflow/contrib/makefile/downloads/nsync/public"
Expand Down
9 changes: 9 additions & 0 deletions tensorflow_cc/cmake/TensorflowBase.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
include(ExternalProject)

# TODO This is a patch for 1.12.0.
set(OLD_PROTOBUF "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz")
set(FIXED_PROTOBUF "https://github.com/protocolbuffers/protobuf/releases/download/v3.6.0/protobuf-all-3.6.0.tar.gz")

ExternalProject_Add(
tensorflow_base
GIT_REPOSITORY https://github.com/tensorflow/tensorflow.git
Expand All @@ -12,6 +16,11 @@ ExternalProject_Add(
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
CONFIGURE_COMMAND make -f tensorflow/contrib/makefile/Makefile clean

# TODO This is a patch for 1.12.0.
COMMAND git checkout master -- tensorflow/tf_version_script.lds
COMMAND sed -i "s#${OLD_PROTOBUF}#${FIXED_PROTOBUF}#g" tensorflow/contrib/makefile/download_dependencies.sh

COMMAND tensorflow/contrib/makefile/download_dependencies.sh
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
9 changes: 6 additions & 3 deletions tensorflow_cc/cmake/build_tensorflow.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@ export TF_NEED_HDFS=${TF_NEED_HDFS:-0}
export TF_NEED_OPENCL=${TF_NEED_OPENCL:-0}
export TF_NEED_OPENCL_SYCL=${TF_NEED_OPENCL_SYCL:-0}
export TF_NEED_TENSORRT=${TF_NEED_TENSORRT:-0}
export TF_NEED_NGRAPH=${TF_NEED_NGRAPH:-0}
export TF_NEED_JEMALLOC=${TF_NEED_JEMALLOC:-1}
export TF_NEED_VERBS=${TF_NEED_VERBS:-0}
export TF_NEED_MKL=${TF_NEED_MKL:-1}
export TF_DOWNLOAD_MKL=${TF_DOWNLOAD_MKL:-1}
export TF_NEED_MPI=${TF_NEED_MPI:-0}
export TF_ENABLE_XLA=${TF_ENABLE_XLA:-1}
export TF_NEED_S3=${TF_NEED_S3:-0} # TODO: Remove when replaced by the next line.
export TF_NEED_AWS=${TF_NEED_AWS:-0}
export TF_NEED_GDR=${TF_NEED_GDR:-0}
export TF_CUDA_CLANG=${TF_CUDA_CLANG:-0}
export TF_SET_ANDROID_WORKSPACE=${TF_SET_ANDROID_WORKSPACE:-0}
export TF_NEED_KAFKA=${TF_NEED_KAFKA:-0}
export TF_DOWNLOAD_CLANG=${TF_DOWNLOAD_CLANG:-0}
export TF_NCCL_VERSION=${TF_NCCL_VERSION:-1.3} # _DEFAULT_NCCL_VERSION from configure.py
export TF_NEED_IGNITE=${TF_NEED_IGNITE:-0}
export TF_NEED_ROCM=${TF_NEED_ROCM:-0}
export TF_NCCL_VERSION=${TF_NCCL_VERSION:-2.3} # _DEFAULT_NCCL_VERSION from configure.py
export NCCL_INSTALL_PATH=${NCCL_INSTALL_PATH:-/usr}
export PYTHON_BIN_PATH=${PYTHON_BIN_PATH:-"$(which python3)"}
export PYTHON_LIB_PATH="$($PYTHON_BIN_PATH -c 'import site; print(site.getsitepackages()[0])')"

Expand Down Expand Up @@ -59,7 +62,7 @@ if [ "@ALLOW_CUDA@" = "ON" ] && [ -n "${CUDA_TOOLKIT_PATH}" ]; then
echo "CUDA support enabled"
cuda_config_opts="--config=cuda"
export TF_NEED_CUDA=1
export TF_CUDA_COMPUTE_CAPABILITIES=${TF_CUDA_COMPUTE_CAPABILITIES:-"3.5,5.2,6.1,6.2"}
export TF_CUDA_COMPUTE_CAPABILITIES=${TF_CUDA_COMPUTE_CAPABILITIES:-"3.5,7.0"} # default from configure.py
export TF_CUDA_VERSION="$($CUDA_TOOLKIT_PATH/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p')"
export TF_CUDNN_VERSION="$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' $CUDNN_INSTALL_PATH/include/cudnn.h)"

Expand Down

0 comments on commit 91997b1

Please sign in to comment.