【发布时间】:2021-01-29 11:21:18
【问题描述】:
在使用 intel 编译器配置 64 位 openmpi 时,我收到此错误:
checking if sizeof(C int) == sizeof(Fortran INTEGER)... no
=========================================================================
ERROR ERROR ERROR
Configure has detected that the size of a C integer (4 bytes) is
different than the size of a Fortran INTEGER (8 bytes). In the
entire v3.x and v4.x series of Open MPI, this configuration is known
to cause data corruption with the mpi_f08 module (it does *not* cause
problems with mpif.h or the mpi module bindings).
You may either choose to change the C and/or Fortran compiler flags
(in order to have the size of a C int be the same as the size of a
Fortran INTEGER) and re-run configure, or you may specify the
--enable-mpi-fortran=usempi flag to configure to explicitly
disable building the mpi_f08 module.
(NOTE: this error has been fixed in Open MPI releases beyond v4.x)
必须包含哪些编译器标志才能将 C int 大小更改为 8 字节?
这是我使用的: ./configure CXX=icpc CC=icc F77=ifort FC=ifort FFLAGS=-i8 FCFLAGS=-i8
【问题讨论】:
-
您无法更改
Cint的大小。但您可以复制/粘贴完整的错误消息,阅读它,然后选择您要使用的解决方法。 -
@GillesGouaillardet 谢谢!我刚刚更新了完整的错误消息 - 有什么解决方法?
-
不要构建 Fortran 2008 绑定。
-
为什么要 Fortran 的 INTEGER 为 8 个字节? Linux 是 LP64,这意味着只有长整数和指针是 8 字节长。其他任何东西都是非标准的。如果您必须将 MPI 专门用于使用 8 字节长整数构建的其他 Fortran 代码,则只需使用
-i8构建。 -
@GillesGouaillardet 就像一个魅力,谢谢!
标签: linux mpi x86-64 openmpi icc