gfortran is called instead of mpif90

10,538

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
Share:
10,538
solalito
Author by

solalito

Graduate student in Computational Fluid Dynamics.

Updated on June 21, 2022

Comments

  • solalito
    solalito almost 2 years

    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.

  • Vladimir F Героям слава
    Vladimir F Героям слава over 8 years
    On supercomputers and clusters you can usually change between compilers and MPI libraries using the module system. Try typing module avail.
  • Gilles
    Gilles over 8 years
    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.