使用 icc 打开 MPI:"Open MPI requires a C99 compiler"

Open MPI with icc: "Open MPI requires a C99 compiler"

如果我运行

../configure CC=icc CXX=icpc F77=ifort FC=ifort

配置停止于

============================================================================
== Compiler and preprocessor tests
============================================================================

*** C compiler and preprocessor
checking for gcc... (cached) icc
checking whether we are using the GNU C compiler... (cached) yes
checking whether icc accepts -g... (cached) yes
checking for icc option to accept ISO C89... (cached) none needed
checking whether icc understands -c and -o together... (cached) yes
checking for icc option to accept ISO C99... unsupported
configure: WARNING: Open MPI requires a C99 compiler
configure: error: Aborting.

我正在尝试从源代码构建 Open MPI 3.0.0。我使用的是 Intel 编译器版本 18.0.0 20170811。环境是 Arch Linux.

为什么 Open MPI 会遇到 icc 不兼容 C99 的问题?

如果与 glibc 2.26 结合使用,最新的 ICC 似乎有问题。问题仍然存在于版本 18.0.0 中。目前,修复方法是包含标志 -D_Float128=__float128:

../configure CC=icc CXX=icpc FC=ifort CFLAGS="-D_Float128=__float128"

如果不需要使用经典的C++可以选择用C99编译

../configure C99=icc CXX=icpc FC=ifort