用虚拟机安装WRF,gfortran、gcc、cpp都有安装并更新至最新,但是在安装mpich-3.0.4库的时候开始报错
configure: error: The Fortran compiler gfortran will not compile files that call the same routine with arguments of different types.
尝试过更新fort77和fortran,都没有解决这个错误,求解如何解决这个问题
我也遇到了同样的问题,于是我选择wget https://www.mpich.org/downloads/mpich-4.0.2.tar.gz
然后进行安装,安装时也会遇到fortran相关问题,我选择 ./configure --disable-fortran --prefix=$DIR/mpich,mpicc安装成功了。但是后面安装wrf不知道能不能正常使用,我还在安装。
按照提示configure: error: The Fortran compiler /home/ljh/Package/gcc/10.4/bin/gfortran does not accept programs that call the same routine with arguments of different types without the option -fallow-argument-mismatch. Rerun configure with FFLAGS=-fallow-argument-mismatch and FCFLAGS=-fallow-argument-mismatch
设置这两个变量:
export FCFLAGS=-fallow-argument-mismatch
export FFLAGS=-fallow-argument-mismatch
./configure --prefix=xxxxxxxxxxxxxxxx
后面又出来这个问题:
configure: error: F90 and F90FLAGS are replaced by FC and FCFLAGS respectively in this configure, please unset F90/F90FLAGS and set FC/FCFLAGS instead and rerun configure again.
configure: error: ./configure failed for test/mpi
设置这三个变量:
unset F90
unset F90FLAGS
set FC=gfortran
配置成功:
*** device : ch4:ofi (embedded libfabric)
*** shm feature : auto
*** gpu support : disabled
MPICH is configured with device ch4:ofi, which should work
for TCP networks and any high-bandwidth interconnect
supported by libfabric. MPICH can also be configured with
"--with-device=ch4:ucx", which should work for TCP networks
and any high-bandwidth interconnect supported by the UCX
library. In addition, the legacy device ch3 (--with-device=ch3)
is also available.
Configuration completed.
这个问题看起来是代码问题,不好解决。你可以尝试用其他mpi库,比如 openmpi, intel mpi。
我也遇到了同样的问题,请问您解决了吗?
您好,问题解决了么?
请使用低于gcc10.1.0版本的gcc编译安装,或者选择 --disable-fortran选项忽略
export FFLAGS="-w -fallow-argument-mismatch -O2"