1. My os environment
Centos 7.4
2. Install bazel and protobuf
bazel version 0.5.4
protobuf version 3.5.1
3. Install other dependencies
yum install python-pip python-devel python-numpy
4. get source code
git clone --recurse-submodules https://github.com/tensorflow/tensorflow
5. build source code
cd ./tensorflow
./configure
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package