源码编译安装boost库,以及卸载boost库
【编译安装boost_1_77_0】
wget https://archives.boost.io/release/1.77.0/source/boost_1_77_0.tar.bz2 --no-check-certificate
tar xf boost_1_77_0.tar.bz2
cd boost_1_77_0
./bootstrap.sh
swapon /root/swapfile
./b2
./b2 install
swapoff /root/swapfile
cd ..
【卸载boost_1_77_0】
[方法1:生成安装文件包,然后使用uninstaller卸载器卸载。
swapon /root/swapfile
./b2 install --prefix=$(pwd)/_install/usr/local
swapoff /root/swapfile
cd _install
tar czf boost-binary.tar.gz usr
/root/uninstaller boost-binary.tar.gz
[方法2]
rm -r /usr/local/include/boost
rm -r /usr/local/lib/libboost*
rm -r /usr/local/lib/cmake/boost*
rm -r /usr/local/lib/cmake/Boost*
rm -r /usr/local/share/boost_predef
提示:编译安装mysql数据库,不用单独下载boost库,更不用编译安装boost库。
只要下载带boost-headers的mysql源码包(如mysql-boost-8.0.42.tar.gz),用-DWITH_BOOST指令指定一下源码包里面的boost文件夹路径就行了。mysql只在编译期间使用boost库,编译完成后,boost库就没用了。
cmake ../mysql-8.0.42 -DWITH_BOOST=../mysql-8.0.42/boost/boost_1_77_0 -DWITH_UNIT_TESTS=OFF -DCURSES_LIBRARY=/usr/lib/libncursesw.so