Centos compilation boost

Source: Internet
Author: User

1. download the latest boost

Http://www.boost.org/

2. decompress the file
Tar-xzvf boost_1_45_0.tar.gz
3. Compile bjam
Go to the boost_cmd45_0 directory and run./Bootstrap. Sh. Then, you will get a bjam
4. Compile boost
. /Bjam -- with-date_time -- With-System -- With-RegEx -- With-thread -- With-filesystem -- With-serialization -- With-iostreams -- With-math -- With-MPI -- with-program_options -- -Python -- With-math -- With-signals -- layout = tagged install variant = debug, release link = static
-- Runtime-link = static threading = multi stage
5. View boost
After compilation, the latest boost header file is available in/usr/local/include/boost, and The. A library file compiled in/usr/local/lib is available.
Although both usr/local/include and/usr/include have directories, GCC first accesses/usr/local/include. After compilation, boost can be used by default.
6. Test boost
VI testboost. cpp
# Include <iostream>
# Include <boost/version. HPP>
Int main ()
{
STD: cout <boost_version <STD: Endl;
Return 0;
}
Compile: G ++-O testboost. cpp

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.