一、先决条件
Ubuntu 18.0x/20.0x/22.0x + 1C/2G RAM(至少),且目标平台编译,C/C++ 程式不要尝试在其它平台上交叉编译,在那个平台编译就寻找那个平台设备进行编译,例:Power PC、MIPS PLAT。
二、预备被编译的库代码
mkdir -p /opt/boost/
cd /opt/boost/
wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2
tar jxvf boost_1_80_0.tar.bz2
mv boost_1_80_0/ boost/
cd boost/
三、预备编译工具链及库依赖
apt-get update
apt-get install lrzsz zip unzip libkrb5-dev libicu-dev screen iftop openssl libssl-dev libunwind8 iftop net-tools gcc gdb cmake curl wget -y
apt-get install gcc gdb g++ cmake python-dev -y
四、 尝试编译 boost 框架及基础类库
./bootstrap.sh --with-libraries=all --with-toolset=gcc
./b2 toolset=gcc (多核编译,按当前系统默认CPU数量)
# ./b2 toolset=gcc -j1(单核编译,低配平台上面用这条)
./b2 install --prefix=/usr(安装头文件、编译库到系统的 /usr 目录下,建议不要尝试安装,工程内手动配置编译及连接环境)