1. Requirements
Ubuntu16.04
2. Refference
https://docs.bazel.build/versions/master/install-ubuntu.html
https://docs.bazel.build/versions/master/tutorial/cpp.html
3. Install Bazel v0.18.1
sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python
wget https://github.com/bazelbuild/bazel/releases/download/0.18.1/ bazel-0.18.1-installer-linux-x86_64.sh
chmod +x bazel-0.18.1-installer-linux-x86_64.sh
./bazel-0.18.1-installer-linux-x86_64.sh --user
sed -i -e '$ a export PATH="$PATH:$HOME/bin"' .bash_profile
source .bash_profile
4. Build c++ sample code by using Bazel
git clone https://github.com/bazelbuild/examples/
cd examples/cpp-tutorial/stage1
bazel build //main:hello-world
./bazel-bin/main/hello-world
5. Result
Hello world
Sat May 18 13:53:53 2019
Thank you.
last-samurai