Install the boost library in Linux

Source: Internet
Author: User
In Linux, the boost library has been installed recently because C ++'s boost library has been used to compile a program. However, some minor problems are encountered. So record it for your reference. First of all, let's talk about my environment: Ubuntu12.0432bit, gcc4... Linux boost library installation. recently, this library was installed because a program was compiled to use the C ++ boost library. However, some minor problems are encountered. So record it for your reference. First, let's talk about my environment: Ubuntu 12.04 32bit, gcc 4.6.3 is actually in ubuntu. you can run the following command to directly install sudo apt-get install libboost-dev. However, after I install sudo apt-get, many errors occur during program compilation, and they are all system file errors. I started to think that my boost library version was incorrect. later I changed several versions, and all of them encountered the same problem. Later, I compiled a boost.1.42. Then the program passes smoothly. Later I thought about the reason, probably because the boost installed by default from the above Command did not enable the mpi function during compilation and packaging. My program needs this function. The following describes the brief installation steps (I have compiled boost1.42 and boost1.50. The two are installed in the same way, for example, later): www.2cto.com 1. download the boost1.53 Source File (93.56 M) http://sourceforge.net/projects/boost/files/latest/download?source=dlp 2. after decompression, enter the boost_000053_0 directory and execute :. /bootstrap. sh 3. (important) modify the tools/build/v2/user-config.jam file, add a line "using mpi;" (note that there is a space behind mpi, then a semicolon) 4. run :. /b2 5. run: sudo. /b2 install and above are all the installation processes, because there are many mentioned on the Internet, so here is omitted. The key point is the third step, which must be remembered. However, if your program does not need the mpi function, it will not matter. The default setting of the application is enough. In addition, the fourth step can be followed by the prefix parameter. If this parameter is not added, the default header file is in the/usr/local/include/boost directory. The library file is in the/usr/local/lib/directory. You do not need to modify it by default. After the program is compiled, the system prompts that a library file cannot be loaded at runtime, then, you can mv all the boost library files under/usr/local/lib to the/usr/lib directory.
 
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.