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

- Compile gflags.
1make -j
- Install gflags.
1make 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