因为要用基于GCC4.8.1的boost最新版本的库,默认apt-get install 安装的是boost1.53, 并且基于GCC4.7.3,不是我想要的。所以决定下载源代码自己编译。

下载(后面的路径可能会变,具体参考boost网站链接)

wget -O boost_1_54_0.tar.bz2 http://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.bz2?r=http%3A%2F%2Fwww.boost.org%2Fusers%2Fhistory%2Fversion_1_54_0.html&ts=1375162670&use_mirror=jaist

解压:

tar --bzip2 -xf ./boost_1_54_0.tar.bz2

开始编译,全部编译耗时太多,所以我仅选择我需要的库:

先用下面的命令查看有多少库可以编译:

./bootstrap.sh --show-libraries
Building Boost.Build engine with toolset gcc... tools/build/v2/engine/bin.linuxx86_64/b2 The following Boost libraries have portions that require a separate build
and installation step. Any library not listed here can be used by including
the headers only. The Boost libraries requiring separate building and installation are:
- atomic
- chrono
- context
- coroutine
- date_time
- exception
- filesystem
- graph
- graph_parallel
- iostreams
- locale
- log
- math
- mpi
- program_options
- python
- random
- regex
- serialization
- signals
- system
- test
- thread
- timer
- wave

然后就编译我要的库:

./bootstrap.sh --with-libraries=system,filesystem,log,thread
Building Boost.Build engine with toolset gcc... tools/build/v2/engine/bin.linuxx86_64/b2
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam... Bootstrapping is done. To build, run: ./b2 To adjust configuration, edit 'project-config.jam'.
Further information: - Command line help:
./b2 --help - Getting started guide:
http://www.boost.org/more/getting_started/unix-variants.html - Boost.Build documentation:
http://www.boost.org/boost-build2/doc/html/index.html

然后运行下面的命令完成编译。

./b2

耐心等待。不过因为不是编译所有库。时间会少很多。以后需要再来编译。很快看到结果:

The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    /usr/src/boost_1_54_0

The following directory should be added to linker library paths:

    /usr/src/boost_1_54_0/stage/lib

忘记安装了。再运行./b2 install 命令,默认安装在

/usr/local/lib目录下

头文件在

/usr/local/include/boost目录下

Ubuntu 13.04编译boost1.54的更多相关文章

  1. ubuntu 13.04 编译 安装 升级 gcc 4.9.0 address sanitizer

    @ 前记: 最近查一个线上项目的crash,review代码无果,crash几率低,不可在本地环境重现.之后在线上好几个服务器跑valgrind就不crash了.个人猜测可能是跑valgrind后性能 ...

  2. ubuntu 13.04编译安装xen4.4总结

    之前在ubuntu14.04上安装xen4.4失败,提示编译有问题,这次换了成了ubuntu13.04进行安装,成功完成xen4.4的安装 1. 安装环境 操作系统:ubuntu13.04 xen版本 ...

  3. vmware虚拟机下ubuntu 13.04使用zeranoe脚本交叉编译ffmpeg

    2013-07-01今天是建党节,习总书记指出,党的建设要以“照镜子.正衣冠.洗洗澡.治治病”为总要求.希望我们的党越来越纯洁,为人民谋福利.言归正传,每次项目中需要编译相应的ffmpeg,都很费时费 ...

  4. Ubuntu 13.04/CentOS 6.4 下C++开发时的相关设置

    Ubuntu 13.04/CentOS 6.4 下C++开发时的相关设置 一.基本设置 首先,为了可以使我们的c++ 可以找到 iostream类,std标准库,我们需要在C/C++ General- ...

  5. Fix catalyst driver in Ubuntu 13.04 / 13.10

    Fix catalyst driver in Ubuntu 13.04 / 13.10(墙外文章备份) 1. Introduction I found lots of people strugglin ...

  6. 64位win7硬盘安装64位ubuntu 13.04

    最近本来是准备通过升级的方式把ubuntu从12.04升级到12.10再升级到13.04的,但是升级到12.10之后,可能是因为某一步的操作不当,出现无法进入系统的情况.不过还好的是升级之前保存了主要 ...

  7. Ubuntu 13.04 双显卡安装NVIDIA GT 630M驱动

    [日期:2013-05-24]   Linux系统:Ubuntu 13.04 安装 bumblebee 以管理双显卡,下面命令会自动安装NVIDIA显卡驱动 sudo add-apt-reposito ...

  8. Ubuntu 13.04安装搜狗输入法

    Ubuntu 13.04安装搜狗输入法 [日期:2013-07-08] 来源:Linux公社  作者:LinuxIDC.com [字体:大 中 小]     目标:在Ubuntu 13.04以及基于U ...

  9. [转]win7+ubuntu 13.04双系统安装方法

    win7+ubuntu 13.04双系统安装方法 http://jingyan.baidu.com/article/60ccbceb18624464cab197ea.html 当需要频繁使用ubunt ...

随机推荐

  1. linux书籍推荐(转)

    ref: http://www.cnblogs.com/jiangjh/archive/2011/06/27/2091164.html#commentform 入门篇 <LINUX权威指南> ...

  2. oracle解析xml完成版第二次修改

    其实XML字符串就好像是ORACLE中的外部表,因此Oracle对 解析XML字符串一些规则要求非常严格.XML字符串提供的数据就是一张表,所以Oracle必须提供跟 xml数据一致的列头 示例一 S ...

  3. Hive学习之四 《Hive分区表场景案例应用案例,企业日志加载》 详解

    文件的加载,只需要三步就够了,废话不多说,来直接的吧. 一.建表 话不多说,直接开始. 建表,对于日志文件来说,最后有分区,在此案例中,对年月日和小时进行了分区. 建表tracktest_log,分隔 ...

  4. Java简介(3)-基本语法

    1.大小写敏感 2.类名 3.方法名. 4.源文件名

  5. Android 多线程:使用Thread和Handler

    当一个程序第一次启动时,Android会同时启动一个对应的主线程(Main Thread),主线程主要负责处理与UI相关的事件,如:用户的按键事件,用户接触屏幕的事件以及屏幕绘图事件,并把相关的事件分 ...

  6. 插入数据前设置字符编码为utf8

    xxx.php保存时选择utf8编码,页头最好加上 header('conten-type:text/html;charset=utf-8'); 在执行CRUD操作前先执行一下 mysql_query ...

  7. 或许是python yield最好的答案 ?

    地址:http://pyzh.readthedocs.org/en/latest/the-python-yield-keyword-explained.html#yield 译者: hit9 原文: ...

  8. 周赛D题

    D - D Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u   Description ...

  9. bzoj2487: Super Poker II

    Description I have a set of super poker cards, consisting of an infinite number of cards. For each p ...

  10. JLRoutes--处理复杂的URL schemes-备

    关键字:URL,URL schemes,Parse  代码类库:网络(Networking) GitHub链接:https://github.com/joeldev/JLRoutes   JLRout ...