安装 OpenMPI:C C++ 编译器不 link 兼容

Install OpenMPI: C C++ Compilers not link compatible

我正在我的 Amazon EC2 服务器上安装 Open MPI。安装最新的 gcc-7.3 编译器后,我尝试从他们的官方网站安装 openmpi-3.0.1

这是我输入的代码:

wget "https://www.open-mpi.org/software/ompi/v3.0/downloads/openmpi-3.0.1.tar.gz" 
tar -xvf openmpi-3.0.1.tar.gz
cd openmpi-3.0.1
./configure --prefix="/home/ubuntu/.openmpi" 

按照此处的说明指南进行操作http://lsi.ugr.es/jmantas/pdp/ayuda/datos/instalaciones/Install_OpenMPI_en.pdf

结果说 C 和 C++ 编译器不 link 兼容(见图)

问题已修改。首先,按照@Gilles Gouaillardet 的想法,如果我输入 dpkg --list | grep compiler,它会显示

ii  g++                                  4:5.3.1-1ubuntu1                                                                                                                                        
amd64        GNU C++ compiler
ii  g++-5                                5.5.0-12ubuntu1~16.04                                                                                                                                   
amd64        GNU C++ compiler
i  gcc                                  4:5.3.1-1ubuntu1                                                                                                                                        
amd64        GNU C compiler
ii  gcc-5                                5.5.0-12ubuntu1~16.04                                                                                                                                   
amd64        GNU C compiler
ii  gcc-5-multilib                       5.5.0-12ubuntu1~16.04                                                                                                                                   
amd64        GNU C compiler (multilib support)
ii  gcc-7                                7.3.0-16ubuntu3~16.04.1                                                                                                                                 
amd64        GNU C compiler
ii  gcc-multilib                         4:5.3.1-1ubuntu1                                                                                                                                        
amd64        GNU C compiler (multilib files)
ii  gfortran-7                           7.3.0-16ubuntu3~16.04.1                                                                                                                                 
amd64        GNU Fortran compiler
ii  libecj-java                          3.10.1-2ubuntu1                                                                                                                                         
all          Eclipse Java compiler (library)
ii  libllvm5.0:amd64                     1:5.0-3~16.04.1                                                                                                                                         
amd64        Modular compiler and toolchain technologies, runtime library
ii  libxkbcommon0:amd64                  0.5.0-1ubuntu2                                                                                                                                          
amd64        library interface to the XKB compiler - shared library

其次,这里是config.log@Zulan的建议

 It was created by Open MPI configure 3.0.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was

$ ./configure --prefix=/home/ubuntu/.openmpi

## --------- ##
## Platform. ##
## --------- ##

hostname = ip-172-31-11-138
uname -m = x86_64
uname -r = 4.4.0-1052-aws
uname -s = Linux
uname -v = #61-Ubuntu SMP Mon Feb 12 23:05:58 UTC 2018

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /home/ubuntu/bin
PATH: /home/ubuntu/.local/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin 
PATH: /usr/games
PATH: /usr/local/games
PATH: /snap/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:5774: checking for perl
configure:5790: found /usr/bin/perl
"config.log" 16382L, 526563C         

如果你想使用 GNU 7 编译器,你首先必须安装 g++-7,然后告诉 Open MPI 使用它们

./configure --prefix=/home/ubuntu/.openmpi CC=gcc-7 CXX=g++-7 FC=gfortran-7