【问题标题】:How can I compile OpenFoam with a custom MPI implementation?如何使用自定义 MPI 实现编译 OpenFoam?
【发布时间】:2020-03-11 14:42:56
【问题描述】:

我正在尝试在 CentOS 6.6 中安装 OpenFoam-19.06 我在/global/mpi/mympich 中有一个 MPI 版本。 在文件etc/bashrc 中,我创建了变量:

export WM_MPLIB=MYMPICH

> 在 etc/config.sh/mpi 文件中,我创建了一个新案例:

MYMPICH)
    export FOAM_MPI=mympich
    export MPI_ARCH_PATH=/global/mpi/mympich
    export MPICH_PATH=$MPI_ARCH_PATH

    _foamAddPath    $MPI_ARCH_PATH/bin
    _foamAddLib     $MPI_ARCH_PATH/lib
    ;;

然后我设置环境变量:

来源 etc/bashrc

并使用(在相应目录中)编译第三方软件:

./makeCGAL

最后,我用(在适当的目录中)编译 OpenFoam:

./Allwmake

似乎开局不错:

========================================
2019-11-15 13:24:03 +0100
Starting compile OpenFOAM-v1906 Allwmake
  Gcc system compiler
  linux64GccDPInt32Opt, with MYMPICH mympich
========================================

built wmake-bin (linux64Gcc)

========================================
Start ThirdParty Allwmake
========================================
using:  gcc -m64 -DOPENFOAM=1906 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -O3 -fPIC
using:  g++ -std=c++11 -m64 -DOPENFOAM=1906 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -Wno-unknown-pragmas -O3 -DNoRepository -ftemplate-depth-100 -fPIC

========================================
Build MPI libraries if required
    /global/mpi/mympich

但它以以下结果结束:

module.h:236:37: warning: ‘foldval’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define SCOTCH_NAME_PREFIX_INTERN   _SCOTCH
                                     ^
vdgraph_separate_ml.c:90:23: note: ‘foldval’ was declared here
   int                 foldval;
                       ^
cp: cannot stat `../bin/[agm]*': No such file or directory
make: [install] Error 1 (ignored)
cp: cannot stat `../bin/d[agm]*': No such file or directory
make: [install] Error 1 (ignored)
cp: cannot stat `../include/*esmumps*.h': No such file or directory
make: [install] Error 1 (ignored)
cp: cannot stat `../lib/*esmumps*.so': No such file or directory
make: [install] Error 1 (ignored)
    ln: OpenFOAM/lnInclude
    ln: OSspecific/POSIX/lnInclude
    ln: ./lnInclude
In file included from PstreamGlobals.C:28:0:
PstreamGlobals.H:42:17: fatal error: mpi.h: No such file or directory
compilation terminated.
make: *** [/home/OpenFOAM-v1906/build/linux64GccDPInt32OptMYMPICH/src/Pstream/mpi/PstreamGlobals.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from UPstream.C:32:0:
PstreamGlobals.H:42:17: fatal error: mpi.h: No such file or directory
compilation terminated.
make: *** [/home/OpenFOAM-v1906/build/linux64GccDPInt32OptMYMPICH/src/Pstream/mpi/UPstream.o] Error 1
In file included from UOPwrite.C:34:0:
PstreamGlobals.H:42:17: fatal error: mpi.h: No such file or directory
compilation terminated.
In file included from UIPread.C:34:0:
PstreamGlobals.H:42:17: fatal error: mpi.h: No such file or directory
compilation terminated.

到目前为止,我还没有找到一个很好的指南来做我的目标。

【问题讨论】:

  • 您可以将完整的编译日志添加为附件吗?另外,您能否重新访问 OpenFOAM gitlab wiki 中的构建指南(如果我可以通过我的 PC 访问,我将添加地址)。您是否在 $FOAM/etc/config.sh/* 文件中设置了配置?

标签: compiler-errors mpi openfoam


【解决方案1】:

在 OpenFOAM-1712 及更高版本中,可以满足您的需求。它被称为USERMPI。如果您指定此项,它将查找相应的 mplib 规则,该规则也由您负责创建。

最好在他们的 gitlab 跟踪器上作为文档问题/查询提出。

如果您想查看一个非常详细的示例,请查看 spack openfoam/package.py - 它由来自 spack 的值填充

【讨论】:

    【解决方案2】:

    不,我想你已经安装了 mpich?或者是其他东西。我们没有名为“mympi”的 mpi。

    【讨论】:

    • 我很确定这是一个答案。但这不是很明显。请edit改写。最好不要问任何问题,即使是夸夸其谈。
    猜你喜欢
    • 1970-01-01
    • 2012-07-03
    • 2013-12-25
    • 1970-01-01
    • 2012-03-07
    • 1970-01-01
    • 1970-01-01
    • 2014-06-26
    • 2023-03-12
    相关资源
    最近更新 更多