build tensorflow with cpp and how to use it in ubuntu
1. bazel
Installing using binary installer
The binary installers are on Bazel’s GitHub releases page.
The installer contains the Bazel binary1. Some additional libraries must also be installed for Bazel to work.
Step 1: Install required packages
First, install the prerequisites: pkg-config
, zip
, g++
, zlib1g-dev
, unzip
, and python
.
sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python
Step 2: Download Bazel
Next, download the Bazel binary installer named bazel-<version>-installer-linux-x86_64.sh
from the Bazel releases page on GitHub.
Step 3: Run the installer
Run the Bazel installer as follows:
chmod +x bazel-<version>-installer-linux-x86_64.sh
./bazel-<version>-installer-linux-x86_64.sh --user
The --user
flag installs Bazel to the $HOME/bin
directory on your system and sets the .bazelrc
path to $HOME/.bazelrc
. Use the --help
command to see additional installation options.