因为要用基于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. 【转】block一点也不神秘————如何利用block进行回调

    我们在开发中常常会用到函数回调,你可以用通知来替代回调,但是大多数时候回调是比通知方便的,所以何乐而不为呢?如果你不知道回调使用的场景,我们来假设一下: 1.我现在玩手机 2.突然手机没有电了 3.我 ...

  2. hdu1230火星A+B (大数题)

    Problem Description 读入两个不超过25位的火星正整数A和B,计算A+B.需要注意的是:在火星上,整数不是单一进制的,第n位的进制就是第n个素数.例如:地球上的10进制数2,在火星上 ...

  3. 对于IEnumerable的一点理解

    IEnumerable和IEnumerable<T>接口在.NET中是非常重要的接口,它允许开发人员定义foreach语句功能的实现并支持非泛型方法的简单的迭代,IEnumerable和I ...

  4. jQuery获取select、checkbox、radio的方法总结

    在进行网页的前后台交互的时候,经常需要获取单选框(radio).复选框(checkbox)以及下拉列表(select/dropdownlist)选中的值. 总结了一下,方便以后复习查看: 1.获取选中 ...

  5. Asp.Net Mvc: 浅析TempData机制(转发 作者: Tristan G )

    Asp.Net Mvc: 浅析TempData机制 环境: Windows 2008, VS 2008 SP1, Asp.Net Mvc 1.0 --------------------------- ...

  6. CodeForces 569A 第六周比赛C踢

    C - C Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Statu ...

  7. SqlServer 还原,备份 Sql脚本命令

    备份 USE master go ),); set @path='d:\backup\'; set @name=@path+'TsDb.bak'; Backup database TsDb To di ...

  8. 2016-12-14jq笔记

    1.在jq中声明一个数组的方法有两种: 1.var a=new  Array(): 2 var b=[]; (效果一致) 2.bind()和live()的区别 3.animate的用法 4.place ...

  9. COS访谈第十八期:陈天奇

    COS访谈第十八期:陈天奇 [COS编辑部按] 受访者:陈天奇      采访者:何通   编辑:王小宁 简介:陈天奇,华盛顿大学计算机系博士生,研究方向为大规模机器学习.他曾获得KDD CUP 20 ...

  10. 更改新建Asp.net WebForm的模板 的方法

    C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ItemTemplates\CSharp\Web\2052\WebFor ...