gfortran is called instead of mpif90
Asked Answered
L

2

5

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.

Luckless answered 1/9, 2015 at 15:30 Comment(4)
What does /usr/local/intel14/impi/4.1.3.048/intel64/bin/mpif90 -v return?Apostatize
Try using mpiifort instead of mpif90.Axenic
I think mpif90 and mpifort and so on are usually just wrappers for the relevant fortran compilers.Doubles
use '-cpp' option: #15898361Ingratiate
L
9

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
Luckless answered 2/9, 2015 at 7:26 Comment(2)
On supercomputers and clusters you can usually change between compilers and MPI libraries using the module system. Try typing module avail.Apostatize
A more permanent fix would be to replace mpif90 by mpiifort in the Makefile. The environment variable does the trick, but is error prone since one can forget to set it while re-loging.Doddered
P
0

You can just use the alternative

/usr/local/intel14/impi/4.1.3.048/intel64/bin/mpiifort
Prevention answered 10/12, 2021 at 12:56 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.