Ubuntu 14.04 compilation Install boost 1.58

Source: Internet
Author: User

Brief introduction

Boost is a set of libraries for the C + + programming language that provide support for tasks and structures such a s linear algebra, pseudorandom number generation, multithreading, image processing,regular expressions, and unit testing. It contains over eighty individual libraries. (from Wiki)

Installation steps

: Http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.bz2/download

Libraries required prior to compilation

1 sudo install mpi-default-Dev # MPI related2sudoinstall libicu-Dev # Regular Expresion related3sudoinstall python-Dev # python dev related 4 sudo install Libbz2-dev # I Don't know

Compile and install boost

1 tar XF boost_1_58_0. Tar . GZ 2 cd boost_1_58_0/3 ./bootstrap. SH 4 ./b2-a-shave_icu=1  # The parameter means that it support ICU or Unicode5Sud oInstall

Test if boost is installed successfully

C + + code (TESTBOOST.CPP)

1#include <iostream>2#include <boost/timer.hpp>3 4 using namespaceboost;5 6 intMain ()7 {8 timer T;9Std::cout <<"Max TimeSpan:"<< T.elapsed_max ()/3600<<"h"<<Std::endl;TenStd::cout <<"min TimeSpan:"<< t.elapsed_min () <<"s"<<Std::endl; One  AStd::cout <<"Now itme Elapsed:"<< t.elapsed () <<"s"<<Std::endl; -  -         returnexit_success; the}

Compiling instructions

1 g++ testboost.cpp-lboost_system-lboost_filesystem-o testboost

Run results

Ubuntu 14.04 compile and install boost 1.58

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.