-2

I am installing Open MPI on my Amazon EC2 server. After I installed the latest gcc-7.3 compiler, I tried to install openmpi-3.0.1 from their official website.

Here is the code that I've typed in:

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" 

following the instruction guide here http://lsi.ugr.es/jmantas/pdp/ayuda/datos/instalaciones/Install_OpenMPI_en.pdf

The result says C and C++ compiler not link compatible (see the picture) enter image description here

Problem revised. First, following @Gilles Gouaillardet's thought, if I type dpkg --list | grep compiler, it shows

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

Second, here is the config.log following @Zulan's suggestion

 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         
Woodpecker Wang
  • 49
  • 3
  • 10

1 Answers1

1

If you want to use GNU 7 compilers, you first have to install g++-7, and then tell Open MPI to use them

./configure --prefix=/home/ubuntu/.openmpi CC=gcc-7 CXX=g++-7 FC=gfortran-7
Gilles Gouaillardet
  • 8,193
  • 11
  • 24
  • 30
  • Got you! Thanks – Woodpecker Wang Apr 26 '18 at 02:45
  • `./configure ... CC=gcc-7 CXX=g++-7 FC=gfortran-7` ?? If the latter, result is `configure: WARNING: you should use --build, --host, --target checking for perl... perl ============================================================================ == Configuring Open MPI ============================================================================ *** Startup tests checking build system type... Invalid configuration `...': machine `...' not recognized configure: error: /bin/bash config/config.sub ... failed` – Woodpecker Wang Apr 26 '18 at 03:00
  • did you replace `...` with your configure options ? – Gilles Gouaillardet Apr 26 '18 at 04:01
  • check my edited version. note it is not wise to install Open MPI in `$HOME/.openmpi` since this directory is used to store per user configuration. – Gilles Gouaillardet Apr 26 '18 at 06:14