Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gfortran is called instead of mpif90

I am trying to compile a big solver using a makefile. When typing make, the following command gets executed:

mpif90 -O2 -fpp -I/somePath/ -c precision.F90

I get the following error:

gfortran: error: unrecognized command line option ‘-fpp’

I typed which mpif90 to see where it is pointing to:

/usr/local/intel14/impi/4.1.3.048/intel64/bin/mpif90

I tried to manually enter the command to make sure it did not have anything to do with the makefile and I got the same error. Why is gfortran being called? It must be some linking error but I can't figure it out.

like image 391
solalito Avatar asked Sep 01 '15 15:09

solalito


People also ask

What is mpif90?

Description. This command can be used to compile and link MPI programs written in Fortran 90. It provides the options and any special libraries that are needed to compile and link MPI programs. This command is still under development, as is support in MPICH for Fortran 90.

What is difference between Ifort and GFortran?

gfortran auto-vectorization isn't implied until -O3, while ifort -O2 implies it. auto-vectorization of sum reductions generally improves accuracy, more so with ifort than with gfortran, as ifort uses more partial sums. The options quoted above turn off vector sum reduction for both compilers.

Is GFortran part of GCC?

GNU Fortran or GFortran is the GNU Fortran compiler, which is part of the GNU Compiler Collection (GCC). It includes full support for the Fortran 95 language, and supports large parts of the Fortran 2003 and Fortran 2008 standards.

Is there a free Fortran compiler?

GNU Fortran Compiler (gfortran) is a mature free and open source compiler, part of the GNU Compiler Collection.


1 Answers

The comments put me on the right track. I did not know mpif90 was just a wrapper.

$ /usr/local/inter14/impi/4.1.3.048/intel64/bin/mpif90 -v
mpif90 for the Intel(R) MPI Library 4.1 for Linux*
Copyright(C) 2003-2014, Intel Corporation.  All rights reserved.
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gcc5.2/libexec/gcc/x86_64-unknown-linux-gnu/5.2.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/usr/local/gcc5.2 --disable-multilib
Thread model: posix
gcc version 5.2.0 (GCC) 

I asked the code's author to do the same, the output pointed to an intel compiler. So what remains is to link ifort. This fixed it for me (bash shell):

export I_MPI_F90=ifort
like image 193
solalito Avatar answered Sep 30 '22 03:09

solalito