调用 gfortran 而不是 mpif90

sol*_*ito 4 fortran gfortran intel-fortran

我正在尝试使用 makefile 编译一个大型求解器。键入 make 时,将执行以下命令:

mpif90 -O2 -fpp -I/somePath/ -c precision.F90
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

gfortran: error: unrecognized command line option ‘-fpp’
Run Code Online (Sandbox Code Playgroud)

我输入which mpif90以查看它指向的位置:

/usr/local/intel14/impi/4.1.3.048/intel64/bin/mpif90
Run Code Online (Sandbox Code Playgroud)

我尝试手动输入命令以确保它与 没有任何关系,但makefile我遇到了同样的错误。为什么会gfortran被调用?这一定是一些链接错误,但我无法弄清楚。

sol*_*ito 5

这些评论让我走上了正轨。我不知道mpif90只是一个包装。

$ /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) 
Run Code Online (Sandbox Code Playgroud)

我要求代码的作者做同样的事情,输出指向一个英特尔编译器。所以剩下的就是链接ifort。这为我修复了它(bash shell):

export I_MPI_F90=ifort
Run Code Online (Sandbox Code Playgroud)