c_cpp:boost

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
c_cpp:boost [2020/08/27 03:34] ともやんc_cpp:boost [2021/07/05 02:02] (現在) ともやん
行 1: 行 1:
-<html> 
-  <style> 
-    #result pre, #mincode pre { 
-      overflow: hidden; 
-      font-size: 10px; 
-    } 
-    #result_long pre, #mincode_long pre  { 
-      height: 250px; 
-      overflow: scroll; 
-      overflow-x: hidden; 
-      font-size: 10px; 
-    } 
-    #mintbl table { 
-      font-size: 12px; 
-    } 
-    .dokuwiki .plugin_wrap table { 
-      width: auto; 
-    } 
-    #logo { 
-      background-color: white; 
-      padding: 10px; 
-      width: fit-content; 
-    } 
-    #logo p { 
-      margin: 0; 
-    } 
-  </style> 
-</html> 
 ====== Boost C++ Libraries ====== ====== Boost C++ Libraries ======
 {{c_cpp:boost_c_libraries.png?277|Boost C++ Libraries}}\\ {{c_cpp:boost_c_libraries.png?277|Boost C++ Libraries}}\\
-[[https://www.boost.org/|Boost C++ Libraries]]\\ +本家: [[https://www.boost.org/|Boost C++ Libraries]]\\ 
-[[https://github.com/boostorg|Boost.org · GitHub]]\\ +ソースコード: [[https://github.com/boostorg|Boost.org · GitHub]]\\
-\\ +
-Boost (ブースト)とは、C++の先駆的な開発者のコミュニティ、およびそのコミュニティによって公開されているオープンソースのソフトウェアライブラリのことを指す。コミュニティとしてのBoostはC++標準化委員会の委員により設立されており、現在でもその多くが構成員として留まっている。このような経緯もあり、BoostコミュニティはC++の標準化において大きな影響力を有している。実際に標準化委員会が発表した「TR1」の2/3以上がBoostライブラリを基にしている。Random, Regex, ThreadなどはいずれもC++11規格の標準ライブラリとして正式に導入・標準化されている。このことから、Boostは考案された新機能を標準化させる前の試験運用の場であるとも言える。\\ +
-\\ +
-Boostで公開されるライブラリはコミュニティの公開レビューによって精選されている。Boostを使用して作成したプログラムは、商用、非商用を問わず無償のBoost Software Licenseの下でライセンスされる。\\ +
-\\ +
-Boostはテンプレートなどを活用して積極的にメタプログラミングやジェネリックプログラミングの技法を取り入れて行く傾向がある。そのためBoostライブラリの利用者にはC++の現代的な記述に慣れていることを要求される。\\+
 \\ \\
 +**Boost** (ブースト) とは、C++ の先駆的な開発者のコミュニティ、およびそのコミュニティによって公開されているオープンソースのソフトウェアライブラリのことを指す。コミュニティとしての Boost は C++ 標準化委員会の委員により設立されており、現在でもその多くが構成員として留まっている。このような経緯もあり、Boost コミュニティは C++ の標準化において大きな影響力を有している。実際に標準化委員会が発表した「TR1」の2/3以上が Boost ライブラリを基にしている。Random, Regex, Thread などはいずれも C++11 規格の標準ライブラリとして正式に導入・標準化されている。このことから、Boost は考案された新機能を標準化させる前の試験運用の場であるとも言える。\\
 +
 +Boost で公開されるライブラリはコミュニティの公開レビューによって精選されている。Boost を使用して作成したプログラムは、商用、非商用を問わず無償の Boost Software License の下でライセンスされる。\\
 +
 +Boost はテンプレートなどを活用して積極的にメタプログラミングやジェネリックプログラミングの技法を取り入れて行く傾向がある。そのため Boost ライブラリの利用者には C++ の現代的な記述に慣れていることを要求される。\\
 +
 このライブラリは、先鋭的な技術を好むプログラマーが積極的に使用していることで有名である。\\ このライブラリは、先鋭的な技術を好むプログラマーが積極的に使用していることで有名である。\\
-\\+
 [[https://ja.wikipedia.org/wiki/Boost_C%2B%2B%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA|Boost C++ライブラリ - Wikipedia]] より\\ [[https://ja.wikipedia.org/wiki/Boost_C%2B%2B%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA|Boost C++ライブラリ - Wikipedia]] より\\
  
行 45: 行 17:
  
 ===== 利用する前にビルドの必要があるライブラリ ===== ===== 利用する前にビルドの必要があるライブラリ =====
- Boostに含まれる以下のライブラリを利用する場合は、事前にビルドを行う必要がある。それ以外は、ヘッダファイルを #include することで、そのまま利用することが可能である。\\+ Boost に含まれる以下のライブラリを利用する場合は、事前にビルドを行う必要がある。それ以外は、ヘッダファイルを #include することで、そのまま利用することが可能である。\\
 \\ \\
  ビルドが必要なライブラリ  ビルドが必要なライブラリ
行 86: 行 58:
   - Windows の場合は boost_1_74_0.7z を C:\Libraries\ などに解凍する。\\   - Windows の場合は boost_1_74_0.7z を C:\Libraries\ などに解凍する。\\
  
-===== Visual Studio へのインストール =====+===== Windows でのインストール ===== 
 + 
 +==== Visual Studio - Vcpkg 編 ====
 [[windows:visualstudio#vcpkg_コマンド|Visual Studio - Vcpkg コマンド]] をインストールする。\\ [[windows:visualstudio#vcpkg_コマンド|Visual Studio - Vcpkg コマンド]] をインストールする。\\
 PowerShell で以下のコマンドを実行する。\\ PowerShell で以下のコマンドを実行する。\\
行 2111: 行 2085:
 </WRAP> </WRAP>
  
-===== Linux でのインストル ===== +==== ースからビルド ==== 
-Fedora 29\\ +下記の内容正式対応前に **Visual Studio 2019 Preview** で、最新の **Boost** をスコードからビルドた。\\ 
-<WRAP prewrap 100%> +**Boost** が正式対応しているコンパイラでは、これほど苦労はしない。\\
-<code> +
-$ sudo dnf install boost boost-devel boost-date-time boost-filesystem boost-graph boost-iostreams boost-numpy3 boost-program-options boost-python3 boost-python3-devel boost-regex boost-serialization boost-signals boost-stacktrace boost-static boost-system boost-test boost-thread boost-timer boost-type_erasure boost-wave +
-</code> +
-</WRAP> +
- +
-以下の依存関係がインルされる。\\ +
-<WRAP prewrap 100%> +
-<code> +
-libquadmath-devel boost-container boost-context boost-coroutine boost-fiber boost-log boost-math python3-numpy +
-</code> +
-</WRAP> +
- +
-[[c_cpp:boost:fedora_29_boost_rpms|Fedora 29 でインストール可能な Boost の RPM 一覧]]\\ +
- +
-==== ソースからビルド ==== +
-<code> +
-$ cd boost +
-$ ./bootstrap.sh +
-$ PYTHON_ROOT=/usr/bin/python3 +
-$ PYTHON_VERSION=3.7 +
-$ echo "using gcc : 8.3 : /usr/bin/g++ ; " >> tools/build/src/user-config.jam +
-$ ./bjam --toolset=gcc-8.3 address-model=32 architecture=x86 variant=debug -j 3 --buildid=x32-d +
-$ ./bjam --toolset=gcc-8.3 address-model=64 architecture=x86 variant=debug -j 3 --buildid=x64-d +
-$ ./bjam --toolset=gcc-8.3 address-model=32 architecture=x86 variant=release -j 3 --buildid=x32 +
-$ ./bjam --toolset=gcc-8.3 address-model=64 architecture=x86 variant=release -j 3 --buildid=x64 +
-</code> +
-※**Name clash for xxx**エラーが発生する場合**address-model=64 architecture=x86**オプション回避できる。\\ +
-**-j N** は並列コンパイル数 N 指定する。\\ +
-※**variant=debug,release**にすると**address-model=64 architecture=x86**を指定しても**Name clash for xxx**エラが発生してビルドできなかった。\\ +
-**--buildid=d**はデバッグ版のラリ名に-dを付ける。\\ +
- +
-===== ビルド/インストール ===== +
- +
-==== Windows 上の Visual C++ 2019 Preview でビルドする場合 ====+
   - タスクバーの「ここに入力して検索」に sysdm.cpl を入力して Enter キーを押す。   - タスクバーの「ここに入力して検索」に sysdm.cpl を入力して Enter キーを押す。
   - 「システムのプロパティ」の「詳細設定」タブの[環境変数]ボタンを押して「環境変数」画面を開く。   - 「システムのプロパティ」の「詳細設定」タブの[環境変数]ボタンを押して「環境変数」画面を開く。
行 2183: 行 2123:
     http://www.boost.org/build/     http://www.boost.org/build/
 </code></WRAP> </code></WRAP>
-  - 現時点で bjam は Visual Studio 2019 に対応していないので msvc.jam を修正する。<WRAP prewrap 100% #mincode><file diff %BOOST%\tools\build\src\tools\msvc.jam.patch>+  - 現時点で bjam は **Visual Studio 2019 Preview** に対応していないので msvc.jam を修正する。<WRAP prewrap 100% mincode><file diff %BOOST%\tools\build\src\tools\msvc.jam.patch>
 24d23 24d23
 < * Visual Studio 2019—14.2 < * Visual Studio 2019—14.2
行 2223: 行 2163:
     - **if [ MATCH "(14.1)" : $(version) ]** を **if [ MATCH "(14.[12])" : $(version) ]** に修正。     - **if [ MATCH "(14.1)" : $(version) ]** を **if [ MATCH "(14.[12])" : $(version) ]** に修正。
     - **exact-version = [ MATCH "(14\.10\.[0-9\.]+)" : $(command) ] ;** を **exact-version = [ MATCH "(14\.[12]0\.[0-9\.]+)" : $(command) ] ;** に修正。     - **exact-version = [ MATCH "(14\.10\.[0-9\.]+)" : $(command) ] ;** を **exact-version = [ MATCH "(14\.[12]0\.[0-9\.]+)" : $(command) ] ;** に修正。
-    - **if [ MATCH "(MSVC\\14.1)" : $(command) ]** を <WRAP prewrap 100% #mincode><code autoconf>+    - **if [ MATCH "(MSVC\\14.1)" : $(command) ]** を <WRAP prewrap 100% mincode><code autoconf>
 if [ MATCH "(MSVC\\14.2)" : $(command) ] if [ MATCH "(MSVC\\14.2)" : $(command) ]
 { {
行 2233: 行 2173:
     - **.known-versions = 14.1 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1** を **.known-versions = 14.2 14.1 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1** に修正。     - **.known-versions = 14.1 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1** を **.known-versions = 14.2 14.1 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1** に修正。
     - **.version-alias-14.2 = 14.2 ;** を追記。     - **.version-alias-14.2 = 14.2 ;** を追記。
-    - <WRAP prewrap 100% #mincode><code autoconf>+    - <WRAP prewrap 100% mincode><code autoconf>
 .version-14.2-path = .version-14.2-path =
      "../../VC/Tools/MSVC/*/bin/Host*/*"      "../../VC/Tools/MSVC/*/bin/Host*/*"
行 2264: 行 2204:
 === auto_link.hpp の修正 === === auto_link.hpp の修正 ===
 現時点で boost は Visual Studio 2019 のオートリンクに対応していないので auto_link.hpp を修正する。 現時点で boost は Visual Studio 2019 のオートリンクに対応していないので auto_link.hpp を修正する。
-<WRAP prewrap 100% #mincode>+<WRAP prewrap 100% mincode>
 <file diff %BOOST%\boost\config\auto_link.hpp.patch> <file diff %BOOST%\boost\config\auto_link.hpp.patch>
 176c176 176c176
行 2279: 行 2219:
 </WRAP> </WRAP>
   - **#  elif defined(BOOST_MSVC)** を **#  elif defined(BOOST_MSVC) && (BOOST_MSVC < 1920)** に修正。   - **#  elif defined(BOOST_MSVC)** を **#  elif defined(BOOST_MSVC) && (BOOST_MSVC < 1920)** に修正。
-  - <WRAP prewrap 100% #mincode><code cpp>+  - <WRAP prewrap 100% mincode><code cpp>
 #  elif defined(BOOST_MSVC) #  elif defined(BOOST_MSVC)
    
行 2287: 行 2227:
  
 === 参考 === === 参考 ===
-<WRAP prewrap 100% #mintbl>+<WRAP prewrap 100% mintbl>
 ^  表記  ^  製品名  ^  VC++ Version  ^  _MSC_VER  ^  _MSC_FULL_VER  ^ ^  表記  ^  製品名  ^  VC++ Version  ^  _MSC_VER  ^  _MSC_FULL_VER  ^
 | 2019  | Visual Studio 2019\\ Version 16.1.2  |  14.21  |  1921 |  192127702 | | 2019  | Visual Studio 2019\\ Version 16.1.2  |  14.21  |  1921 |  192127702 |
行 2295: 行 2235:
 [[windows:visualstudio#visual_studio_と_vc_マクロ定義|Visual Studio と VC++ マクロ定義]]\\ [[windows:visualstudio#visual_studio_と_vc_マクロ定義|Visual Studio と VC++ マクロ定義]]\\
  
-===== 利用方法 ===== +===== Linux でのインストール ===== 
-[[c_cpp:boost:boost_python|Boost.Python]] - Boost Python Library は、Python と C++ を連携させるためのフレムワークです。Dave Abrahams の C++ コンパイラだけで、特別なツールを使用するなく、C++ クラスの関数やオブジェクトを Python に素早くシムレスに公開できる。\\+Fedora 29\\ 
 +<WRAP prewrap 100%> 
 +<code> 
 +$ sudo dnf install boost boost-devel boost-date-time boost-filesystem boost-graph boost-iostreams boost-numpy3 boost-program-options boost-python3 boost-python3-devel boost-regex boost-serialization boost-signals boost-stacktrace boost-static boost-system boost-test boost-thread boost-timer boost-type_erasure boost-wave 
 +</code> 
 +</WRAP> 
 + 
 +以下の依存関係がインストールされる。\\ 
 +<WRAP prewrap 100%> 
 +<code> 
 +libquadmath-devel boost-container boost-context boost-coroutine boost-fiber boost-log boost-math python3-numpy 
 +</code> 
 +</WRAP> 
 + 
 +[[c_cpp:boost:fedora_29_boost_rpms|Fedora 29 でインストール可能な Boost の RPM 一覧]]\\ 
 + 
 +==== ソースからのビルド ==== 
 +<code> 
 +$ cd boost 
 +$ ./bootstrap.sh 
 +$ PYTHON_ROOT=/usr/bin/python3 
 +$ PYTHON_VERSION=3.7 
 +$ echo "using gcc : 8.3 : /usr/bin/g++ ; " >> tools/build/src/user-config.jam 
 +$ ./bjam --toolset=gcc-8.3 address-model=32 architecture=x86 variant=debug -j 3 --buildid=x32-d 
 +$ ./bjam --toolset=gcc-8.3 address-model=64 architecture=x86 variant=debug -j 3 --buildid=x64-d 
 +$ ./bjam --toolset=gcc-8.3 address-model=32 architecture=x86 variant=release -j 3 --buildid=x32 
 +$ ./bjam --toolset=gcc-8.3 address-model=64 architecture=x86 variant=release -j 3 --buildid=x64 
 +</code> 
 +※**Name clash for xxx**エラが発生る場合は、**address-model=64 architecture=x86**オプションで回避できる\\ 
 +※**-j N** は並列コンパイル数 N 指定する。\\ 
 +※**variant=debug,release**にすると**address-model=64 architecture=x86**指定しても**Name clash for xxx**エラが発生してビルドできなかった。\\ 
 +※**--buildid=d**はデバッグ版のライブラリ名に-dを付ける。\\ 
 + 
 + 
 +===== ライブラリの利用方法 ===== 
 +[[c_cpp:boost:boost_python|Boost.Python - Boost Python Library]]\\
  
 ===== 参考文献 ===== ===== 参考文献 =====
 [[https://boostjp.github.io/howtobuild.html|Boostライブラリのビルド方法 - boostjp]]\\ [[https://boostjp.github.io/howtobuild.html|Boostライブラリのビルド方法 - boostjp]]\\
 +[[git>boost-ext/di|boost-ext/di: DI: C++14 Dependency Injection Library]]\\
  
 +==== 付録 ====
 +[[tw>tomoyan596/status/1404143924428480512|〇 DI (Dependency Injection) × PI(Pregnancy Injection) YouTubeの字幕がおかしいだけですねぇ😅💦 / Twitter]]\\
  
  • c_cpp/boost.1598466892.txt.gz
  • 最終更新: 2020/08/27 03:34
  • by ともやん