Closed stackjohn closed 5 months ago
Looks like a compiler problem. FILL is defined as C_DOUBLE in the calling routine, and FILL is defined as REAL in gdswzd_mod.f90. However, REAL is defined as real*8 by the compiler option -fdefault-real-8 . Is C_DOUBLE not a 8 byte real on the ARM? Does -fdefault-real-8 not work? I use the CLANG from the AOCC build. Is this different from the clang for the ARM?
The routine gdswiz_c.F90 is not called by wgrib2, Change (whatever)/grib2/ip2lib_d/make.filelist from "FPP_FILES = gdswzd_c.F90" to "FPP_FILES =". Then you can build by "make clean; make" from the (whatever)/grib2 directory.
Wgrib2 is transitioning to the stock version of ip2lib_d which is maintained by the NCEPlibs group. (Wgrib2 took the stock version of ip2lib_d, added many parallelizations and were later added to the stock version. Since then, wgrib2 hasn't updated ip2lib_d.) After wgrib2 is using the stock version of ip2lib, this issue can be addressed by the NCEPlibs group.
@webisu thank you for coming back to me so quickly. I was eventually able to get -fdefault-real-8
to work, I had to run a make clean
inside ip2lib_d for it to be picked up. But anyhow I eventually went down a few other rabbit holes with proj4 and ended up checking the makefile out and starting again to clean it up. Now it looks as follows:
diff --git a/makefile b/makefile
index 1ec5699..6e4f820 100644
--- a/makefile
+++ b/makefile
@@ -133,7 +133,7 @@
# export FC=xlf_r
#
# for AOCC (AMD Optimizing C Compiler, version of clang)
-# export CC=clang
+ export CC=clang
# export FC=flang
# export COMP_SYS=clang_linux
#
@@ -151,8 +151,8 @@
#
# Main development platform: linux with gcc/gfortran
#
-# export CC=gcc
-# export FC=gfortran
+export CC=gcc
+export FC=gfortran
#
SHELL=/bin/sh
# SHELL=/bin/ksh
@@ -164,9 +164,9 @@ SHELL=/bin/sh
# if USE_NETCDF3=1, then USE_NETCDF4 must 0
#
# USE_NETCDF3=0
-USE_NETCDF3=1
+USE_NETCDF3=0
#
-USE_NETCDF4=0
+USE_NETCDF4=1
# USE_NETCDF4=compile
# USE_NETCDF4=system
#USE_NETCDF4=${NETCDF_INCLUDES}:${NETCDF_LIBRARIES}
@@ -182,7 +182,7 @@ USE_IPOLATES=3
USE_SPECTRAL=1
USE_UDF=0
USE_OPENMP=1
-USE_PROJ4=1
+USE_PROJ4=0
USE_WMO_VALIDATION=0
USE_NAMES=NCEP
MAKE_FTN_API=1
@@ -192,7 +192,7 @@ MAKE_SHARED_LIB=0
USE_G2CLIB=0
USE_PNG=1
-USE_JASPER=1
+USE_JASPER=0
USE_OPENJPEG=0
USE_AEC=1
@@ -1038,7 +1038,7 @@ ${proj4lib}:
gunzip -f tmpproj4.tar.gz
tar -xvf tmpproj4.tar
rm tmpproj4.tar
- cd ${proj4dir} && export CFLAGS="${wCPPFLAGS}" && ./configure --disable-shared --prefix=${cwd} && ${MAKE} -j 1 check install
+ cd ${proj4dir} && export CFLAGS="${wCPPFLAGS}" && ./configure --build=aarch64-unknown-linux-gnu --disable-shared --prefix=${cwd} && ${MAKE} -j 1 check install
Perhaps this was the main fix:
export CC=clang
Perhaps I had fiddled with that trying to get proj4 to compile, as it does not auto detect the arch correct so I added the --build=aarch64-unknown-linux-gnu
above, and then it is able to compile. The issue then is the proj4 tests fail.
I eventually just disabled proj4 and got it all to compile, and wgrib2 seems to function fine for my needs without it.
All is working 🎉 Thanks again for responding, much appreciated!
The Proj4 option is having problems with some builds, and needs to be disabled in order to build wgrib2. This only affects determining the lat-lon of grid points for an aspherical equal-area Lambert projection. The build issues will be addressed by replacing Proj4 by Proj9.x.x. This is necessary for integrating wgrib2 with the EMC build framework.
Hello!
I'm trying to compile this on a raspberry pi 5, but I'm getting the following:
makefile contains:
I've tried to make use of
FTN_REAL8:="-fdefault-real-8
But still the same issue. Is there a work around that someone knows of?