Please see this link:https://blog.csdn.net/calvinpaean/article/details/99761765
1. GFlags Installation
git clone https://github.com/gflags/gflags.git
cd gflags
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON -DGFLAGS_NAMESPACE=gflags ../
make -j4
sudo make install
2. GFlogs Installation
sudo apt-get install autoconf automake libtool
git clone https://github.com/google/glog
./autogen.sh
./configure
make -j8
sudo make install