Installing gflags from Source Code
- Go to the /home directory.
cd /home
- Obtain the source package.
wget https://github.com/gflags/gflags/archive/v2.2.2.tar.gz
mv v2.2.2.tar.gz gflags-2.2.2.tar.gz
- Decompress the source package.
tar -zxvf gflags-2.2.2.tar.gz
- Go to the source package directory.
cd gflags-2.2.2
- Create a directory.
mkdir build/
- Go to the new directory.
cd build/
- Configure the compilation.
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DINSTALL_HEADERS=ON -DINSTALL_SHARED_LIBS=ON -DINSTALL_STATIC_LIBS=ON ..

- Compile gflags.
make -j

- Install gflags.
make install

- Set environment variables.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/include/gflags
Parent topic: Configuring the Installation Environment