Errors compiling m3tools

Trying to compile ioapi3.2 on cluster running two 64-core AMD Epyc “Milan” processors. Im using Intel compiler and admin. installed netCDF C and netCDF fortran also compiled with intel (and curl and MPI) with netCDF4. Following the CMAS install instructions I used DEFINEFLAGS = -DIOAPI_NCF4=1 (since netCDF4 was not disabled) and comment out OMPFLAGS = #-qopenmp, OMPLIBS = #-qopenmp in Makeinclude.Linux2_x86_64ifort.

ioapi looks to compile fine, but error chain pops up once m3tools starts to compile. I read and tried the fixes for the same problem to no avail. ChatGPT says the error are do to a linkage problem with netCDF, but all AI suggested fixes failed

Partial make.log when the trouble starts

make[1]: Leaving directory ‘/depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/ioapi’
(cd /depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/m3tools ; make BIN=Linux2_x86_64ifort all)
make[1]: Entering directory ‘/depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/m3tools’
cd /depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/Linux2_x86_64ifort; ifort -auto -warn notruncated_source /depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/Linux2_x86_64ifort/airs2m3.o -L/depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/Linux2_x86_64ifort -lioapi “nf-config --flibs nc-config --libs” -o airs2m3
/depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/Linux2_x86_64ifort/libioapi.a(init3.o): In function init3_': init3.F90:(.text+0x6a): undefined reference to nf_inq_libvers_’
/depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/Linux2_x86_64ifort/libioapi.a(open3.o): In function open3_': open3.F90:(.text+0xc01): undefined reference to nf_close_’
/depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/Linux2_x86_64ifort/libioapi.a(opnfil3.o): In function opnfil3_': opnfil3.F90:(.text+0xb0): undefined reference to nf_open_’
opnfil3.F90:(.text+0xe9): undefined reference to nf_get_att_int_' opnfil3.F90:(.text+0x117): undefined reference to nf_get_att_int_’
opnfil3.F90:(.text+0x16a): undefined reference to nf_get_att_int_' opnfil3.F90:(.text+0x198): undefined reference to nf_get_att_int_’
opnfil3.F90:(.text+0x1c6): undefined reference to nf_get_att_int_' /depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/Linux2_x86_64ifort/libioapi.a(opnfil3.o):opnfil3.F90:(.text+0x1f4): more undefined references to nf_get_att_int_’ follow

Are nf-config and nc-config in your PATH? (They need to be – or else do these commands “by hand” and put in the results here.).

And where did the double-quote come from? This needs to be a back-quote. Or else the result of this pair of commands

yes they are in my path. even tried explicit paths in the Makefile

include /depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/ioapi/Makeinclude.${BIN}

Manually setting NetCDF paths and libraries

NETCDF_C_LIB_DIR = /apps/spack/negishi/apps/netcdf-c/4.9.0-intel-19.1.3-lnodl34/lib
NETCDF_FORTRAN_LIB_DIR = /apps/spack/negishi/apps/netcdf-fortran/4.6.0-intel-19.1.3-lxhp25h/lib
NETCDF_INCLUDE_DIR = /apps/spack/negishi/apps/netcdf-c/4.9.0-intel-19.1.3-lnodl34/include

Setting CURL library path

CURL_LIB_DIR = /apps/spack/negishi/apps/curl/7.85.0-gcc-8.5.0-xsntqgd/lib

Set environment variables

export CRAYPE_LINK_TYPE=static
export LIBRARY_PATH=$$LIBRARY_PATH:$(CURL_LIB_DIR)

Compiler flags

FFLAGS = -I$(IODIR) -I$(NETCDF_INCLUDE_DIR) {MODI} (OBJDIR) -DIOAPI_NCF4 (ARCHFLAGS) (PARFLAGS) (FOPTFLAGS) (ARCHFLAGS)
LDFLAGS = -I$(IODIR) (DEFINEFLAGS) (ARCHFLAGS)

Libraries to link

LIBS = -L${OBJDIR} -L$(NETCDF_C_LIB_DIR) -L$(NETCDF_FORTRAN_LIB_DIR) -lioapi -lnetcdff -lnetcdf -lm (OMPLIBS) (ARCHLIB) $(ARCHLIBS)

VPATH = ${OBJDIR}

So what does that entire line that generates the error look like ??

full make log
logfile.txt (39.7 KB)

I repeat: why those damned double-quotes ???

Found them in the ioapi3.2 Makefile not in m3tools Makefile looks to have been the problem! Thanks ive come to loathe the plethora of Makefiles, Makefile.seds over the past 3 days!