WRF-CMake / wrf

🌀 The Weather Research and Forecasting (WRF) model with CMake support
Other
44 stars 3 forks source link

Windows compilation with MSYS2 and gfortran10 #48

Open ToninoTarsi opened 4 years ago

ToninoTarsi commented 4 years ago

Hi,

I want to compile WRF on windows and I was following this wiki ( https://github.com/WRF-CMake/wrf/blob/wrf-cmake/doc/cmake/LIBS.md#windows ) for installing required libraries on a clean installation of MSYS2

I got a first error compiling netcdf-c but it was easy to solve using :

pacman -S m4

But when I compile netcdf-fortran-4.4.4

I got this error I really do not find a solution

$ make
[  2%] Building Fortran object fortran/CMakeFiles/netcdff.dir/netcdf4.f90.obj
netcdf4_func.f90:708:75:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/REAL(8)).
netcdf4_func.f90:698:75:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/REAL(8)).
netcdf4_func.f90:688:74:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
netcdf4_func.f90:678:73:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(2)/REAL(8)).
netcdf4_func.f90:668:73:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(1)/REAL(8)).
netcdf4_func.f90:648:75:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/REAL(8)).
netcdf4_func.f90:638:75:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/REAL(8)).
netcdf4_func.f90:628:74:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
netcdf4_func.f90:618:73:

......
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(2)/REAL(8)).
netcdf4_func.f90:608:73:

Any help is appreciated.

Regards

ToninoTarsi commented 4 years ago

I tried a second time and now it worked :-( Sorry :-)

ToninoTarsi commented 4 years ago

The problem is still there and I think it is related to my gfortran 10,2 compiler (current MSYS2 version) that makes type check as errors. I suppose it is possible to disable this error as warning in gfortran 10.2 but I have no idea how. Any hint ?

Thanks

dmey commented 4 years ago

This should be related to https://github.com/wrf-model/WRF/pull/1251/files

ToninoTarsi commented 4 years ago

Thanks. Thats will help. Regards.

ToninoTarsi commented 4 years ago

Setting ;:


export FCFLAGS="-w -fallow-argument-mismatch -O2"
export FFLAGS="-w -fallow-argument-mismatch -O2"

solves the netcdf compilation. But then I have similar issue also compiling WRF_Cmake and flags do not help there.

So I changed the issue title and reopened it . For the moment I solved avoiding updating the index in MSYS2 (pacman -Syu) and using old toolchain version. Thanks.