1.安装必备工具m4, autoconf, automake, libtool
安装m4
cd temp wget http://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz tar zxvf m4-1.4.18.tar.gz cd m4-1.4.18 ./configure --prefix=/your_root_path/local make make install
安装autoconf
cd temp wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz tar zxvf autoconf-2.69.tar.gz cd autoconf-2.69 ./configure --prefix=/your_root_path/local make make install
安装automake
cd temp wget http://ftp.gnu.org/gnu/automake/automake-1.16.1.tar.gz tar zxvf automake-1.16.1.tar.gz cd automake-1.16.1 ./configure --prefix=/your_root_path/local make make install
安装libtool
cd temp wget http://mirror.csclub.uwaterloo.ca/gnu/libtool/libtool-2.4.6.tar.gz cd libtool-2.4.6 tar zxvf libtool-2.4.6.tar.gz ./configure --prefix=/your_root_path/local make make install
将它们的可执行程序路径写入环境变量中:
vim ~/.bashrc
点击i进入输入模式
将下列代码复制粘贴到文件最后:
export PATH="/your_root_path/local/bin:$PATH" export LIBRARY_PATH="/your_root_path/local/lib:$LIBRARY_PATH" export LD_LIBRARY_PATH="/your_root_path/local/lib:$LD_LIBRARY_PATH"
点ESC退出输入模式,输入:wq进行保存并退出。
命令行输入source ~/.bashrc激活环境变量。
可分别使用下面的命令进行版本查询并验证是否安装成功:
m4 --version autoconf --version automake --version libtool --version
2.安装boost库
源码下载地址:https://www.boost.org/users/history/version_1_67_0.html
或使用wget下载。
cd temp wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz tar zxvf boost_1_67_0.tar.gz cd boost_1_67_0 ./bootstrap.sh --prefix=/your_root_path/local ./b2 -j32 ./b2 install
将boost库头文件路径写入环境变量:
vim ~/.bashrc
插入以下代码
export BOOST_INCLUDEDIR="/your_root_path/local/include:$BOOST_INCLUDEDIR"
点ESC退出输入模式,输入:wq进行保存并退出。
命令行输入source ~/.bashrc激活环境变量。
3.安装Glog
git clone https://github.com/google/glog.git cd glog ./autogen.sh ./configure --prefix=/your_root_path/local make make install
ps1:可能会遇到bug: 执行bash./ autogen时报错“没有这个文件”
解决:https://blog.csdn.net/qq_42921511/article/details/120604942
ps2:./configure --prefix=/your_root_path/local 中your_root_path要修改为自己的路径。
4.安装Gflags
git clone https://github.com/gflags/gflags cd gflags mkdir build cd build CXXFLAGS="-fPIC" cmake -D CMAKE_INSTALL_PREFIX=/your_root_path/local .. make -j4 make install
ps:第五行代码中your_root_path要修改为自己的路径。



