3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Intel C++, Intel MPIでOpenFOAM 8をビルド

Last updated at Posted at 2021-05-07

環境

IntelコンパイラとMPIが無料で使えるようになったので(詳細は検索してください),この組み合わせでOpenFOAM 8をビルドします。OSはCent OS 7です。

設定

Intelコンパイラとかはインストールしたとします。ここではホームの下に入れてます。
OpenFOAMのソースはGithubからクローンしてきます。
git clone https://github.com/OpenFOAM/OpenFOAM-8.git

ThirdPartyは公式からダウンロードします。
http://dl.openfoam.org/third-party/8

etc/bashrc

コンパイラとMPIを変更。

 #- Compiler:
 #    WM_COMPILER = Gcc | Gcc48 ... Gcc62 | Clang | Icc
-export WM_COMPILER=Gcc
+export WM_COMPILER=Icc

#- Memory addressing:
@@ -86,7 +86,7 @@ export WM_COMPILE_OPTION=Opt
 #- MPI implementation:
 #    WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI
 #               | MPI | FJMPI | QSMPI | SGIMPI | INTELMPI
-export WM_MPLIB=SYSTEMOPENMPI
+export WM_MPLIB=INTELMPI

etc/config.sh/compiler

Iccの情報を追加。

@@ -63,6 +63,12 @@ OpenFOAM | ThirdParty)
         export WM_CXX='clang++'
         clang_version=llvm-3.7.0
         ;;
+    Icc)
+    export WM_CC='icc'
+    export WM_CXX='icpc'
+    ;;
+
     *)

etc/config.sh/mpi

MPI_ROOTをインストールしたMPIに設定。

@@ -232,7 +232,9 @@ INTELMPI)
     # No trailing slash
     [ "${MPI_ROOT%/}" = "${MPI_ROOT}" ] || MPI_ROOT="${MPI_ROOT%/}"

+    export MPI_ROOT=$HOME/intel/oneapi/mpi/2021.2.0
     export FOAM_MPI="${MPI_ROOT##*/}"

これで./Allwmakeすればビルドできるはず。

Paraviewは環境によって,新しいバージョンが起動しなかったりするので,古いやつにしたりするほうがいいかもしれません。その場合はParaviewのソースをThirdPartyにダウンロードします。バージョンはetc/config.sh/paraviewで設定します。

エラーしたとき

Catastrophic error: could not set locale "" to allow processing of multibyte characters ってなったとき

https://www.cdslab.org/paramonte/notes/troubleshooting/catastrophic-error-could-not-set-locale/
これによると,コンパイルオプションに-no-multibyte-charsをつければいいとある。
wmake/rules/linux64IccのなかのcOpt, c++Optをそれぞれ以下のようにする。

cOpt
cDBUG       =
cOPT        = -O3 -no-multibyte-chars
c++Opt
c++DBUG     =
c++OPT      = -O3 -no-multibyte-chars
3
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
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?