我要评分
获取效率
正确性
完整性
易理解

Installing gflags from Source Code

  1. Go to the /home directory.
    cd /home
  2. 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
  3. Decompress the source package.
    tar -zxvf gflags-2.2.2.tar.gz
  4. Go to the source package directory.
    cd gflags-2.2.2
  5. Create a directory.
    mkdir build/
  6. Go to the new directory.
    cd build/ 
  7. Configure the compilation.
    cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DINSTALL_HEADERS=ON -DINSTALL_SHARED_LIBS=ON -DINSTALL_STATIC_LIBS=ON ..

  8. Compile gflags.
    make -j

  9. Install gflags.
    make install

  10. Set environment variables.
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/include/gflags