1. 到官网下载最新版的boost,Boost C++ Libraries - Browse /boost at SourceForge.net
环境安装
yum install python-devel bzip2 bzip2-devel mpi mpi-devel -y
2. 解压:
tar zxvf boost_1_55_0.tar.gz
3. 进入解压后的目录boost_1_55_0,执行:
sudo ./bootstrap.sh --prefix=/usr/local/include/boost
4. 安装:
sudo ./b2 install
上面安装看上去正常, 但生成的库里始终找不到能支持多线程的 libboost_thread-mt.so.1.55.0库
网上查找资料, 测试了以下方试, 还是不能生成想要的库.
1156 ./bootstrap.sh --with-libraries=all --with-toolset=gcc --prefix=/usr/local/boost
1157 ./bootstrap.sh --with-libraries=all --with-toolset=gcc threading=multi --prefix=/usr/local/boost
1158 ./bootstrap.sh --show-libraries
1159 sudo ./b2 install --prefix=/usr/local/boost
1160 history
1161 ls /usr/local/boost/lib/*mt*
1162 ./b2 --help
1163 sudo ./b2 install threading=multi --prefix=/usr/local/boost
1164 ls /usr/local/boost/lib/*mt*
1165 ls /usr/local/boost/lib/
1166 ./b2 install --with-system --with-thread --with-date_time --with-regex --with-serialization --with-python link=shared runtime-link=shared threading=multi debug
1167 ls /usr/local/boost/lib/*mt*
1168 find / -name libboost_thread*
1169 ls
1170 ./bootstrap.sh
1171 ./b2 install --with-system --with-thread --with-date_time --with-regex --with-serialization --with-python link=shared runtime-link=shared threading=multi
1172 find / -name libboost_thread*
1173 yum install python-devel
1174 pwd
1175 sudo ./b2 install threading=multi --prefix=/usr/local/boost
1176 history
1177 ./bootstrap.sh --with-libraries=all --with-toolset=gcc --prefix=/usr/local/boost
1178 ./b2 install --with-system --with-thread --with-date_time --with-regex --with-serialization --with-python link=shared runtime-link=shared threading=multi debug
1179 ./b2 install --with-python link=shared runtime-link=shared threading=multi debug
1180 ./b2 install --with-libraries=all link=shared runtime-link=shared threading=multi debug
1181 ./b2 install link=shared runtime-link=shared threading=multi debug
1182 find / -name libboost_thread*
1183 history
1184 yum install python-devel bzip2 bzip2-devel mpi mpi-devel -y
1185 ./b2 install link=shared runtime-link=shared threading=multi debug
1186 find / -name libboost_thread*
1187 history
1188 vim boost/mpl/assert.hpp
1189 ./bootstrap.sh --with-libraries=all --with-toolset=gcc --prefix=/usr/local/boost
1190 ./b2
1191 ls /home/boost_55/boost_1_55_0/stage/lib
1192 ./bootstrap.sh --prefix=/usr/local/boost
1193 ./b2 install
1194 ./b2 --help
1195 ./b2 threading=multi install
1196 find / -name libboost_thread*
1197 ./bootstrap.sh --with-libraries=all threading=multi --with-toolset=gcc --prefix=/usr/local/boost
1198 ./b2 threading=multi install
1199 find / -name libboost_thread*
1200 ./b2 --build-type=complete --layout=tagged install
1201 pwd
最后根据: Linux下编译boost库生成 libboost_thread-mt.a 的方法_jiaoyongqing134的专栏-CSDN博客
执行如下命令:
./bjam --build-type=complete --layout=tagged
终于生成成功!!! 感谢