日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

(原)ubuntu16中编译boost1.61.0库

發布時間:2024/4/13 Ubuntu 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 (原)ubuntu16中编译boost1.61.0库 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

轉載請注明出處:

http://www.cnblogs.com/darkknightzh/p/5797940.html

參考網址:

http://www.boost.org/doc/libs/1_61_0/more/getting_started/unix-variants.html

http://blog.csdn.net/tedious/article/details/6793544

說明:boost庫包含兩部分:無需編譯的頭文件,及單獨編譯的庫。單獨編譯的庫如下:

Boost.Chrono

Boost.Context

Boost.Filesystem

Boost.GraphParallel

Boost.IOStreams

Boost.Locale

Boost.MPI

Boost.ProgramOptions

Boost.Python (see the Boost.Python build documentation before building and installing it)

Boost.Regex

Boost.Serialization

Boost.Signals

Boost.System

Boost.Thread

Boost.Timer

Boost.Wave

?

A few libraries have optional separately-compiled binaries:

Boost.DateTime has a binary component that is only needed if you're using its to_string/from_string or serialization features, or if you're targeting Visual C++ 6.x or Borland.

Boost.Graph also has a binary component that is only needed if you intend to parse GraphViz files.

Boost.Math has binary components for the TR1 and C99 cmath functions.

Boost.Random has a binary component which is only needed if you're using random_device.

Boost.Test can be used in “header-only” or “separately compiled” mode, although separate compilation is recommended for serious use.

Boost.Exception provides non-intrusive implementation of exception_ptr for 32-bit _MSC_VER==1310 and _MSC_VER==1400 which requires a separately-compiled binary. This is enabled by #define BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR.

?

安裝步驟(首先下載并解壓縮文件,并cd到該文件夾內):

1. 運行bootstrap.sh:后面加上需要編譯的庫(如果不加的話,貌似只會編譯最小的庫,即包含基本功能的庫)需要編譯的自己選(可以見參考網址2里面完全編譯)。

./bootstrap.sh --with-libraries= system,filesystem, thread,python

經過上命令后,可以看到,會編譯哪些庫:

2. 運行./b2。直接這樣用,提示權限不夠,所以使用如下命令就可以成功:

sudo ./b2

成功編譯了這些文件(和上圖對應的庫):

3. 將編譯好的文件使用cp命令拷貝到系統的目錄:

sudo cp -a stage/lib /usr/local sudo cp -a boost /usr/local/include/boost

ps. 貌似這些目錄不是ubuntu默認的庫目錄。ubuntu默認庫目錄是/usr/lib。所以上面拷貝時,可以使用:

sudo cp -a stage/lib /usr sudo cp -a boost /usr/include

說明:

1. 使用--show-libraries查看哪些需要單獨編譯:

./bootstrap.sh --show-libraries

2. 全編譯(沒試過):

./bootstrap.sh --with-libraries= atomic,chrono,container,context,coroutine,coroutine2,date_time,exception,filesystem,graph,graph_parallel,iostreams,locale,with-log,math,metaparse,mpi,program_options,python,random,regex,serialization,signals,system,test,thread,timer,type_erasure,wave

在另一臺電腦上,使用./bootstrap.sh --with-libraries= system,filesystem, thread,python,結果全編譯出來了。。。

總結

以上是生活随笔為你收集整理的(原)ubuntu16中编译boost1.61.0库的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。