0
0

More than 1 year has passed since last update.

新しめのintelコンパイラを使う場合のopenMXのコンパイルの注意点

Posted at

公式にインストールの方法が書かれているので殊更に細かく書く必要はないと思うし書かないが、詰まって半日使う羽目になったのでその部分だけメモ。
結論から言うとintelのコンパイラが新しくなった影響で、諸々のwarningがerrorになったせいで通らなかったようです。

インストールのコマンド自体はmakeしてmake installするだけですが、makefileのオプションが曲者です。
今回は産総研のABCI上でコンパイルするのでmklとかfftw3の場所が特殊ですが、適宜読み替えてください。

makefile
MKLROOT = /apps/intel/2023.0/mkl/2023.0.0
CC = mpicc -O3 -xHOST -qopenmp -I/apps/intel/2023.0/mkl/2023.0.0/include/fftw/ -I${MKLROOT}/include -Wno-implicit-function-declaration -fcommon
FC = mpiifort -O3 -xHOST -no-prec-div -qopenmp
LIB= -L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_intelmpi_lp64 -liomp5 -lpthread -lm -ldl -lifcore

問題なのはCCの部分で-Wno-implicit-function-declaration-fcommonを追加しています。
まず-Wno-implicit-function-declarationですが、これは暗黙の関数宣言を認めるというオプションになっています。昔からwarningは出ていたと思うのですが、それがerrorになったのでこのオプションをつけないと

ISO C99 and later do not support implicit function declarations

的な出力が出ます。
次に-fcommonですが、詳しくは知らないので他の記事を見ていただくとして、やはりC言語周りの変更の影響のようです。これも入れないと

multiple definition of ~~~

という感じの出力が大量に (数万行) 出ます。

南無三。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0