NCAR / hrldas

HRLDAS (High Resolution Land Data Assimilation System)
Other
50 stars 53 forks source link

gcc4.8.5 can not compile hrldas #65

Closed gydx6 closed 1 year ago

gydx6 commented 1 year ago

(1) configure option: 6.Linux gfortran compiler MPI (2) remove the "-fallow-argument-mismatch" of the "F90FLAGS" cause the gfortran 4.8.5 dosen't support this paramter. (3) change the netcdf and jasper path in user_build_options (this netcdf and jasper can compile WRF4.1 and WRF-hydro5.2 succeed). (4) "make all" and get the error:

cpp -P -traditional -DMPP_LAND -D_GFORTRAN_   create_forcing.F > create_forcing.f90
mpif90 -ffree-form  -ffree-line-length-none -g -fconvert=big-endian -fbounds-check -fno-range-check -c -I/home/user_name/project/wrf-hydro/source/netcdf_gcc485_hdf1.12/include -I./lib -I./lib create_forcing.f90
create_forcing.f90:14.40:

    character(len=:), allocatable :: str
                                        1
Error: Deferred-length character component 'str' at (1) is not yet supported
create_forcing.f90:25.6:

  use variables
      1
Fatal Error: Can't open module file 'variables.mod' for reading at (1): No such file or directory
make[2]: *** [Makefile:25: create_forcing.o] Error 1
make[2]: Leaving directory '/home/user_name/project/Noah/hrldas/hrldas/HRLDAS_forcing'
make[1]: *** [Makefile:13: default] Error 2
make[1]: Leaving directory '/home/user_name/project/Noah/hrldas/hrldas/HRLDAS_forcing'
make: *** [Makefile:14: all] Error 2

i will change the gcc version and then report the new situation

gydx6 commented 1 year ago

problems have been soloved after using gnu 10.2.0 compiler. Additional information: (1) you need to re-compile the netcdf using gnu 10.2.0 (2) netcdf-fortran compile may encounter the error using gnu 10.2.0 :" Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)", check this page to solve the problem: https://github.com/Unidata/netcdf-fortran/issues/212

grantfalvo commented 1 year ago

I'm having similar issues. I was able to compile and run the model with the single point tutorial on my university's HPC, but I can't seem to compile it on my local machine.

I'm using a 2021 Mac M1. It seems that the issues are coming from compiling and pointing to the right versions of 'netcdf', 'netcdf-fortran', 'jasper', 'gcc' and 'perl'. I've been trouble shooting for a while but don't seem to be making any progress. I looked through the model documentation and haven't been able to find resources on how to do a clean install of the dependencies and point the model to them. When I run 'make' I get errors like this:

21 warnings generated. gfortran -c -I. -I../../hrldas/Utility_routines \ -g -fconvert=big-endian -fbounds-check -fno-range-check -fallow-argument-mismatch -ffree-form -ffree-line-length-none -I/usr/local/include module_sf_bep_bem.f90

make[1]: *** No rule to make target ../../noahmp/drivers/hrldas/NoahmpIOVarType.o', needed byNoahmpUrbanDriverMainMod.o'. Stop.

My user_build_options file looks like this:

COMPILERF90 = gfortran FREESOURCE = -ffree-form -ffree-line-length-none F90FLAGS = -g -fconvert=big-endian -fbounds-check -fno-range-check -fallow-argument-mismatch MODFLAG = -I LDFLAGS = CPP = cpp CPPFLAGS = -P -traditional -DGFORTRAN # -DSPATIAL_SOIL LIBS = LIBJASPER = -ljasper INCJASPER = -I/usr/include/jasper NETCDFMOD = -I/usr/local/include NETCDFLIB = -L/usr/local/lib -lnetcdf -lnetcdff BZIP2 = NO RM = rm -f CC = cc

Any help would be appreciated. Thanks.

gydx6 commented 1 year ago

I'm having similar issues. I was able to compile and run the model with the single point tutorial on my university's HPC, but I can't seem to compile it on my local machine.

I'm using a 2021 Mac M1. It seems that the issues are coming from compiling and pointing to the right versions of 'netcdf', 'netcdf-fortran', 'jasper', 'gcc' and 'perl'. I've been trouble shooting for a while but don't seem to be making any progress. I looked through the model documentation and haven't been able to find resources on how to do a clean install of the dependencies and point the model to them. When I run 'make' I get errors like this:

21 warnings generated. gfortran -c -I. -I../../hrldas/Utility_routines -g -fconvert=big-endian -fbounds-check -fno-range-check -fallow-argument-mismatch -ffree-form -ffree-line-length-none -I/usr/local/include module_sf_bep_bem.f90

make[1]: *** No rule to make target ../../noahmp/drivers/hrldas/NoahmpIOVarType.o', needed byNoahmpUrbanDriverMainMod.o'. Stop.

My user_build_options file looks like this:

COMPILERF90 = gfortran FREESOURCE = -ffree-form -ffree-line-length-none F90FLAGS = -g -fconvert=big-endian -fbounds-check -fno-range-check -fallow-argument-mismatch MODFLAG = -I LDFLAGS = CPP = cpp CPPFLAGS = -P -traditional -DGFORTRAN # -DSPATIAL_SOIL LIBS = LIBJASPER = -ljasper INCJASPER = -I/usr/include/jasper NETCDFMOD = -I/usr/local/include NETCDFLIB = -L/usr/local/lib -lnetcdf -lnetcdff BZIP2 = NO RM = rm -f CC = cc

Any help would be appreciated. Thanks.

The problem may be caused by the M1 chip? Because it is arm architecture, and our common computer cpu are x86 architecture, netcdf library or other dependent libraries may be a little different from our x86 function, and eventually lead to the inability to compile

Shuaichen-He commented 1 year ago

Hi,@grantfalvo

gydx6 commented 1 year ago

the guy who compile wrf in Mac with M1 chip

https://forum.mmm.ucar.edu/threads/instruction-needed-to-install-wrf-v4-3-3-on-mac-with-m1-max-chip-and-version-13-0-1-ventura.12145/