====== 概要 ====== * C++のライブラリ群であるBoostを導入します。 * コンパイラには Intel oneAPI を使用します。 * ここでは必要最低限の方法をまとめたので、詳しいことは公式サイトを参照してください * http://www.boost.org/doc/libs/release/more/getting_started/unix-variants.html ====== ソースコードの入手 ====== 以下のサイトから入手できます。 * [[https://www.boost.org/users/download/|Boost Downloads]] 記事執筆時点での最新版は1.76.0です。 ====== インストール ====== 入手した boost_1_76_0.tar.bz2 をホーム・ディレクトリに置き、ターミナルで以下のように入力します。 $ tar --bzip2 -xf boost_1_76_0.tar.bz2 $ cd boost_1_76_0 Boostライブラリをビルドするためのb2およびbjamが生成します。 toolsetは指定しなければgccになります。 $ ./bootstrap.sh ./bootstrap.sh --with-toolset=intel-linux 公式ではb2が推奨されていますので、こちらでBoostをビルドします。 $ sudo ./b2 install -j4 --prefix=/usr/local/boost_1_76_0 toolset=intel * prefixでインストール先のディレクトリを指定します * -j4 でビルドする時の並列数を指定します(この場合は4並列) * toolsetは指定しなければGCCが使われます。 ====== Intel Pythonを使う場合 ====== oneAPIの中のIntel Pythonを使うと、b2実行時に次のようなエラーが出ることがあります。(エラーが出てもビルドは止まりません) ./boost/python/detail/wrap_python.hpp:57:11: fatal error: 'pyconfig.h' file not found # include ^~~~~~~~~~~~ 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" ; } (略)