Problems building DWD ICON Tools

Hi,

I am trying to build the DWD ICON tools but the “make” step fails with the following error:

cdf_lazy_grid.c: In function ‘cdfLazyGridInitOnce’:
cdf_lazy_grid.c:401:29: error: assignment to ‘double (*)(grid_t , SizeType)’ {aka ‘double ()(grid_t , int)’} from incompatible pointer type ‘double ()(grid_t , size_t)’ {aka ‘double ()(grid_t *, long unsigned int)’} [-Wincompatible-pointer-types]
401 | cdfLazyGridVtable.inqXVal = cdfLazyGridInqXVal;
| ^
cdf_lazy_grid.c:192:1: note: ‘cdfLazyGridInqXVal’ declared here
192 | cdfLazyGridInqXVal(grid_t grid, size_t index)
| ^~~~~~~~~~~~~~~~~~
cdf_lazy_grid.c:402:29: error: assignment to ‘double (
)(grid_t , SizeType)’ {aka ‘double ()(grid_t , int)’} from incompatible pointer type ‘double ()(grid_t , size_t)’ {aka ‘double ()(grid_t *, long unsigned int)’} [-Wincompatible-pointer-types]
402 | cdfLazyGridVtable.inqYVal = cdfLazyGridInqYVal;
| ^
cdf_lazy_grid.c:202:1: note: ‘cdfLazyGridInqYVal’ declared here
202 | cdfLazyGridInqYVal(grid_t *grid, size_t index)

My configuration file is included below. Any help would be most appreciated!

Kind regards,

Demetris

#!/usr/bin/bash

set -e

module load ICON

HDF5DIR=${EBROOTHDF5}
NCDFDIR=${EBROOTNETCDF}
NCDFFDIR=${EBROOTNETCDFMINFORTRAN}
GRIBDIR=${EBROOTECCODES}
LAECDIR=${EBROOTLIBAEC}
UUIDDIR=${EBROOTUTILMINLINUX}

CC=‘gcc’
F77=‘gfortran’
FC=‘gfortran’
CXX=‘g++’

CXXFLAGS=’ -O2 -g -fopenmp -Wunused -DNOMPI’
CFLAGS=’ -O2 -g -fopenmp -Wunused -DNOMPI’
FCFLAGS=‘–std=f2008 -O2 -g -cpp -fopenmp -Wunused -DNOMPI’

LDFLAGS=“-L$HDF5DIR/lib -L$NCDFDIR/lib64 -L$NCDFFDIR/lib64 -L$LAECDIR/lib64 -L$GRIBDIR/lib64 -L$UUIDDIR/lib64”
LIBS=“-lhdf5 -lnetcdff -lnetcdf -leccodes -laec -lgfortran -luuid”

./configure CC=“{CC}" F77="{F77}” FC=“{FC}" CXX="{CXX}”
CXXFLAGS=“{CXXFLAGS}" CFLAGS="{CFLAGS}”
FCFLAGS=“{FCFLAGS}" LDFLAGS="{LDFLAGS}” LIBS=“${LIBS}”
–enable-static --disable-shared --disable-silent-rules
–enable-iso-c-interface --with-netcdf=${NCDFDIR}
–enable-grib2 --with-eccodes=${GRIBDIR}

Further to the above, we are also unable to properly process the .tex documentation of the DWD ICON tools! Is a PDF version available?

Thank you!

You seem to use non-standard quotation marks. Is this a copy-paste artifact? Are you sure, that compiler and flags are recognized correctly in this case?

To avoid things like \ not showing up in a rendered version, you may also use markdown code block highlighting

I will send you the PDF via e-mail.

Since this seems to be a problem with a mismatch between header files and cpp files, could it be the CPP-Flags missing? If some default is used that differs from your choice in LDFLAGS, there could be a mismatch.

Hello Demetris,

the “-Wincompatible-pointer-types” occurs with newer GCC versions, which do a more thorough check of such things. Newer versions of CDI already have been adapted I guess, but the ICON Tools still use an older version. You can avoid that an error is raised by adding this compiler option to the CFLAGS command: -Wno-error=incompatible-pointer-types
You have to reconfigure with a modified configuration file now, then it should work.

I also would include the CPPFLAGS, even if it works for you without them. But as Daniel said, if something is changed in the default settings, you can get problems: I always have:

CPPFLAGS=“-I${NCDFDIR}/include -I${NCDFFDIR}/include -I${GRIBDIR}/include”

and

FCFLAGS="$CPPFLAGS … etc

Dear Uli & Daniel,

the -Wno-error=incompatible-pointer-types really helped and things are looking way more promising now! I am using GCC version 15.2.0, which is fairly new.

I will update my configuration script and do a clean build & install, hopefully all should be OK.

Thank you very much for all your help!

Best wishes,
Demetris