Install OpenMPI on Mac OS 10.13.3 with gfortran

0

I installed gfortran with the dmg file available here, downloaded and unpacked the tar file available here, and then ran ./configure --prefix=/usr/local/.

I get the following output when it tries to detect my Fortran compiler

*** Fortran compiler checking for gfortran... gfortran checking whether we are using the GNU Fortran compiler... no checking whether gfortran accepts -g... no checking whether ln -s works... yes checking if Fortran compiler works... no
**********************************************************************
* It appears that your Fortran compiler is unable to produce working
* executables.  A simple test application failed to properly
* execute.  Note that this is likely not a problem with Open MPI,
* but a problem with the local compiler installation.  More
* information (including exactly what command was given to the
* compiler and what error resulted when the command was executed) is
* available in the config.log file in the Open MPI build directory.
**********************************************************************
configure: error: Could not run a simple Fortran program.  Aborting.

It appears to find gfortran, but then it subsequently says that 'we are not using a GNU Fortran compiler', and then fails the compilation tests. Why is this happening?

user2582713

Posted 2018-05-10T09:18:42.980

Reputation: 101

Answers

0

I had this problem with Mojave for the first time (more or less!). The answer (after much messing about) is simple this: use FC=gfortran and NOT things like F90=gfortran, e.g. Hope that helps.

My full configure input was:

./configure --prefix=/Users/Shared/openmpi311 F77=gfortran FC=gfortran \
      CC=clang CXX=c++ --enable-static 2>&1 | tee openmpi-config.out

Tony Rollett

Posted 2018-05-10T09:18:42.980

Reputation: 1