You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装OpenCAEPoro时PETSC编译报错:mpi_init()无法定位

安装OpenCAEPoro时PETSc-3.19.3编译错误排查

正在安装OpenCAEPoro,在编译第4个依赖包PETSc-3.19.3时出现错误。

以下是用于编译PETSc的build-petsc.sh脚本(其中$ROOT_DIR为OpenCAEPoro的根目录):

export PETSC_DIR=$ROOT_DIR/petsc-3.19.3
export PETSC_ARCH=petsc_install

./configure CC=mpiicc CXX=mpiicpc \
    --with-fortran-bindings=0 \
    --with-hypre-dir=$ROOT_DIR/hypre-2.28.0/install \
    --with-debugging=0 \
    COPTFLAGS="-O3" \
    CXXOPTFLAGS="-O3" \


make -j 20 PETSC_DIR=$ROOT_DIR/petsc-3.19.3 PETSC_ARCH=petsc_install all
make all check  

MPI环境检查结果如下:

$ which mpiicc
/opt/intel/oneapi/mpi/2021.11/bin/mpiicc
$ which mpiicpc
/opt/intel/oneapi/mpi/2021.11/bin/mpiicpc
$ which icc
/opt/intel/oneapi/compiler/2023.0.0/linux/bin/intel64/icc
$ which icpc
/opt/intel/oneapi/compiler/2023.0.0/linux/bin/intel64/icpc
$ which mpiifort
/opt/intel/oneapi/mpi/2021.11/bin/mpiifort
$ which ifort
/opt/intel/oneapi/compiler/2023.0.0/linux/bin/intel64/ifort

可能的问题排查方向:

  • 配置命令语法错误:configure命令最后一行的CXXOPTFLAGS="-O3" \后面存在空行,反斜杠会将后续空行视为命令的一部分,导致configure解析失败。需删除该行末尾的反斜杠,或者确保反斜杠后紧跟下一个配置参数。
  • Hypre依赖兼容性:确认hypre-2.28.0是否使用相同的Intel编译器编译完成,且$ROOT_DIR/hypre-2.28.0/install路径下存在正确的头文件(include目录)和库文件(lib目录)。
  • Intel组件版本不匹配:当前使用的Intel MPI(2021.11)与Intel编译器(2023.0.0)版本跨度较大,可能存在兼容性问题。建议使用同版本的Intel oneAPI MPI和编译器组件。
  • 编译命令冗余:脚本中连续执行两次make命令,第一次make -j20 all完成后,直接执行make check即可,无需重复make all。
  • 环境变量生效问题:确认PETSC_DIR和PETSC_ARCH环境变量在configure执行时已正确设置,可在configure前添加echo $PETSC_DIR $PETSC_ARCH验证。

内容的提问来源于stack exchange,提问作者Moonny

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 04:27:18