NCAR / wrf_hydro_nwm_public

WRF-Hydro model code
https://ral.ucar.edu/projects/wrf_hydro
Other
181 stars 139 forks source link

Make failing due to unrecognized command line option ‘-fallow-argument-mismatch’ #788

Open ksampson-aso opened 2 weeks ago

ksampson-aso commented 2 weeks ago

Expected Behavior

Cmake and make both succeed.

Current Behavior

Cmake succeeds, but make does not.

Cmake:

[ec2-user@ip-10-0-2-171 build]$ cmake .. -DWRF_HYDRO=1 -DHYDRO_D=0 -DSPATIAL_SOIL=1 -DNWM_META=1 > cmake_log.txt
-- NetCDF Include Dir: /home/ec2-user/Build/include
-- Setting LSM to: NoahMP
=============================================================
-- Start of WRF-Hydro Env VARIABLES
WRF_HYDRO = 1
HYDRO_D = 0
WRF_HYDRO_RAPID = 0
SPATIAL_SOIL = 1
WRFIO_NCD_LARGE_FILE_SUPPORT = 0
NCEP_WCOSS = 0
NWM_META = 1
WRF_HYDRO_NUDGING = 0
OUTPUT_CHAN_CONN = 0
PRECIP_DOUBLE = 0
WRF_HYDRO_NUOPC = 0
=============================================================
-- Using gfortran
-- Building NoahMP LSM

Compile:

[ec2-user@ip-10-0-2-171 build]$ make
[  1%] Building Fortran object MPP/CMakeFiles/hydro_mpp.dir/CPL_WRF.F.o
gfortran: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’?
make[3]: *** [MPP/CMakeFiles/hydro_mpp.dir/CPL_WRF.F.o] Error 1
make[2]: *** [MPP/CMakeFiles/hydro_mpp.dir/CPL_WRF.F.o.provides] Error 2
make[1]: *** [MPP/CMakeFiles/hydro_mpp.dir/all] Error 2
make: *** [all] Error 2

Possible Solution

N/A

Steps to Reproduce (for bugs)

  1. clone the repo
  2. mkdir build
  3. cmake .. -DWRF_HYDRO=1 -DHYDRO_D=0 -DSPATIAL_SOIL=1 -DNWM_META=1 > cmake_log.txt
  4. make -j 4

Your Environment

This netCDF 4.9.2 has been built with the following features:

--cc -> gcc --cflags -> -I/home/ec2-user/Build/include -I/home/ec2-user/Build/include --libs -> -L/home/ec2-user/Build/lib -lnetcdf --static -> -lhdf5_hl -lhdf5 -lm -lz -ldl -lbz2 -lxml2 -lcurl --has-dap -> yes --has-dap2 -> yes --has-dap4 -> yes --has-nc2 -> yes --has-nc4 -> yes --has-hdf5 -> yes --has-hdf4 -> no --has-logging -> no --has-pnetcdf -> no --has-szlib -> no --has-cdf5 -> yes --has-parallel4 -> no --has-parallel -> no --has-nczarr -> yes --has-zstd -> no --has-benchmarks -> no --has-multifilters -> yes --has-stdfilters -> deflate bz2 --has-quantize -> yes

--prefix -> /home/ec2-user/Build --includedir -> /home/ec2-user/Build/include --libdir -> /home/ec2-user/Build/lib --plugindir -> --version -> netCDF 4.9.2

ksampson-aso commented 1 week ago

Adding to this thread that I applied the changes found in the recent commit #785 , but still get the same error as before:

[ec2-user@ip-10-0-2-171 build]$ make  
[  1%] Building Fortran object MPP/CMakeFiles/hydro_mpp.dir/CPL_WRF.F.o  
gfortran: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’?  
make[3]: *** [MPP/CMakeFiles/hydro_mpp.dir/CPL_WRF.F.o] Error 1  
make[2]: *** [MPP/CMakeFiles/hydro_mpp.dir/CPL_WRF.F.o.provides] Error 2  
make[1]: *** [MPP/CMakeFiles/hydro_mpp.dir/all] Error 2  
make: *** [all] Error 2
rcabell commented 1 week ago

Hi Kevin -- it looks like you have a very old version of gfortran. The -fallow-argument-mismatch was added in gfortran 10.

However, we'd strongly recommend you update to a newer version of WRF-Hydro as this CMake issue was addressed/fixed in February of 2023 (https://github.com/NCAR/wrf_hydro_nwm_public/pull/680), allowing older versions of gfortran to continue to work.

ksampson-aso commented 1 week ago

Thank you for your response, @rcabell . I will look at updating to a more recent version of WRF-Hydro for compatibility with our system.