Icon : Build CMAQ executables Error building ICON


desc3.F:(.text+0x35d): undefined reference to ncagtc_' desc3.F:(.text+0x39a): undefined reference toncagt_’
desc3.F:(.text+0x3ce): undefined reference to ncagt_' desc3.F:(.text+0x400): undefined reference toncagt_’
opnfil3.F:(.text+0x1d2): undefined reference to ncagt_' opnfil3.F:(.text+0x237): undefined reference toncagt_’
opnfil3.F:(.text+0x273): undefined reference to ncagt_' opnfil3.F:(.text+0x2ab): undefined reference toncagt_’
opnfil3.F:(.text+0x54d): undefined reference to ncvid_' opnfil3.F:(.text+0x5c2): undefined reference toncagtc_’
opnfil3.F:(.text+0x646): undefined reference to ncvinq_' opnfil3.F:(.text+0x69d): undefined reference toncagtc_’
opnfil3.F:(.text+0x6e7): undefined reference to ncvid_' opnfil3.F:(.text+0x7fd): undefined reference to
crdict3.f:(.text+0x178): undefined reference to ncvdef_' crdict3.f:(.text+0x1d4): undefined reference toncaptc_’
crdict3.f:(.text+0x226): undefined reference to ncaptc_' crdict3.f:(.text+0xdb0): undefined reference toncapt_’
crdict3.f:(.text+0xe1c): undefined reference to ncaptc_' crdict3.f:(.text+0xe71): undefined reference toncvdef_’
crdict3.f:(.text+0xee1): undefined reference to ncvdef_' crdict3.f:(.text+0xf3d): undefined reference toncvdef_’

make: *** [ICON_D502a_Linux3_x86_64gcc] Error 1
ERROR while running make command



Which I/O API version? Which netCDF version?

See https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#ncf4:
Evidently, starting with netCDF-Fortran 4.4.2, UCAR in their wisdom decided to silently eliminate the CALL NC*() Fortran interfaces in terms of which the I/O API was originally implemented. [If you can find any documentation indicating this intent on the web, I would enjoy seeing it; I can’t find it.]

I/O API Version 3.2 was tediously re-coded to replace all 943 of these calls by the newer IERR=NF_*() Fortran interfaces that are still supported. Prior editions of the I/O API will have link errors with netCDF-Fortran 4.4.2 or later, because routines such as NCCLOS() are no longer in that library.

…which is exactly what you’re seeing,

Carlie J. Coats, Jr., Ph.D.                    cjcoats@email.unc.edu
Senior Software Engineer                   I/O API Author/Maintainer
Center for Environmental Modeling for Policy Development,
UNC Institute for the Environment                     www.ie.unc.edu
100 Europa Dr., Suite 490 Rm 4051 / Campus Box 1105     919.843.5951
Chapel Hill, NC 27599-1105                          Fax 919.966.9920


netcdf-4.1.3 IOAPI 3.1



So (thanks to the fact that netCDF4 is not backwards compatible with its predecessors, you need to be using I/O API 3.2:

Start from a “new” directory, and
git clone https://github.com/cjcoats/ioapi-3.2.git
wget https://www.cmascenter.org/ioapi/download/ioapi-3.2.tar.gz ; tar xvfz ioapi-3.2.tar.gz
[etc.: see https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#build for build-instructions