Skip to content

vixtor-qm/tf-cpp-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

tf-cpp-sample

A CMake Project For TF Inference

Build TF from source as shared lib on Ubuntu Linux

  1. Install bazel

  2. Clone TF from repository

git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow

The repo defaults to the master development branch. You can also checkout a release branch to build: git checkout branch_name # r1.9, r1.10, etc.

Configure the build Configure your system build by running the following at the root of your TensorFlow source tree:

./configure
  1. Build in C++ library mode:
bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=monolithic //tensorflow:libtensorflow_cc.so
  1. Download and build protocol buffers IMPORTANT: open tensorflow/workspace.bzl and check for protocol buffer version used in TF. Download and build the same version. It will conflict in other case. Install protobuf using checkinstall. Call
sudo ldconfig

to set update the library cache

  1. Build Eigen

  2. Build absl lib

  3. Set up headers and lib paths in CMakeLists.txt

  4. Build the project and have fun

About

A CMake Project For TF Inference

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published