Ubuntu13.04 compile boost1.54

Source: Internet
Author: User
Because the latest boost Library Based on GCC4.8.1 is used, boost1.53 is installed by default with apt-getinstall, and GCC4.7.3 is not what I want. Therefore, we decided to download the source code and compile it in Ubuntu13.04. Download (the following parts can be changed, with reference to the boost )))wget-oboost_1_54_0.tar.bz2 http://downloads.sourceforge.n

Because the latest boost Library Based on GCC4.8.1 is used, boost1.53 is installed by default with apt-get install, and GCC4.7.3 is not what I want. Therefore, we decided to download the source code and compile it in Ubuntu 13.04.

Download (the following path may change. For details, refer to the boost website link)

Wget-O boost_000054_0.tar.bz2 http://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.bz2? Counter & ts = 1375162670 & use_mirror = jaist

Decompress:

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

Start to compile, all compilation takes too much time, so I only select the library I need:

Run the following command to check how many libraries can be compiled:

./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

Then compile the library I want:

./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

Then run the following command to complete the compilation.

./B2

Wait patiently. However, not all libraries are compiled. There will be much less time. Compile later. The result is displayed soon:

The Boost C ++ Libraries were successfully built!

The following directory shocould be added to compiler include paths:

/Usr/src/boost_000054_0

The following directory shocould be added to linker library paths:

/Usr/src/boost_000054_0/stage/lib

I forgot to install it. Run the./b2 install command, which is installed on

/Usr/local/lib directory

Header file in

/Usr/local/include/boost directory

Recommended reading:

Boost library full Development Guide-in-depth C ++ "quasi" standard library hd pdf version http://www.linuxidc.com/Linux/2013-07/87574.htm

Ubuntu compilation and installation of boost library http://www.linuxidc.com/Linux/2013-07/87573.htm

Ubuntu compiled boost 1.52b http://www.linuxidc.com/Linux/2013-02/79004.htm

Ubuntu build and install boost and use http://www.linuxidc.com/Linux/2011-04/34790.htm in eclipse C/C ++

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.