数値計算ライブラリ:boost
This is an old revision of the document!
Table of Contents
概要
- C++のライブラリ群であるBoostを導入します。
- コンパイラには Intel oneAPI を使用します。
- ここでは必要最低限の方法をまとめたので、詳しいことは公式サイトを参照してください
ソースコードの入手
インストール
入手した boost_1_76_0.tar.bz2 をホーム・ディレクトリに置き、ターミナルで以下のように入力します。
$ tar --bzip2 -xf boost_1_76_0.tar.bz2 $ cd boost_1_76_0
Boostライブラリをビルドするためのb2およびbjamが生成します。
$ ./bootstrap.sh --with-toolset=intel
公式ではb2が推奨されていますので、こちらでBoostをビルドします。
$ sudo ./b2 install -j4 --prefix=/usr/local/boost_1_76_0 toolset=intel
- -j4 でビルドする時の並列数を指定します(この場合は4並列)
- toolsetは指定しなければGCCが使われます。
pyconfig.hがないと怒られる場合
oneAPIの中のIntel Pythonを使うと、次のようなエラーが出ます。
./boost/python/detail/wrap_python.hpp:57:11: fatal error: 'pyconfig.h' file not found # include <pyconfig.h> ^~~~~~~~~~~~ 1 error generated.
pyconfig.hを見つけることができていません。 この場合はproject-config.jamを開いて次のように変更します。
(略) # Python configuration import python ; if ! [ python.configured ] { using python : 3.7 : "/opt/intel/oneapi/intelpython/latest" : "/opt/intel/oneapi/intelpython/latest/include/python3.7m" ; } (略)
数値計算ライブラリ/boost.1623687166.txt.gz · Last modified: 2021/06/27 21:57 (external edit)