我正在尝试使用 makefile 编译一个大型求解器。键入 make 时,将执行以下命令:
mpif90 -O2 -fpp -I/somePath/ -c precision.F90
我收到以下错误:
gfortran: error: unrecognized command line option ‘-fpp’
我输入了
which mpif90
查看它指向的位置:/usr/local/intel14/impi/4.1.3.048/intel64/bin/mpif90
我尝试手动输入命令以确保它与
makefile
没有任何关系。我得到了同样的错误。为什么是 gfortran
被叫?这一定是一些链接错误,但我无法弄清楚。
最佳答案
这些评论让我走上了正轨。我不知道 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)
我要求代码的作者做同样的事情,输出指向一个英特尔编译器。所以剩下的就是链接
ifort
.这为我修复了它(bash shell):export I_MPI_F90=ifort
关于fortran - 调用 gfortran 而不是 mpif90,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32335519/