Issue building m3tools - undefined references

Hi all,

When I try to run make for m3tools, I have undefined references to “nf_put_vara_int64_” and “nf_get_vara_int64_”.

How do I determine if this is an issue with my netCDF build or with my IOAPI/m3tools build? If it is with my IOAPI/m3tools build, how can I fix it?

Looking at libnetcdff.a with the nm command, both “nf_put_vara_int64_” and “nf_get_vara_int64_” are undefined. libioapi.a seems to have built correctly, but I don’t know how to verify this.

I’m using netCDF-C version 4.7.0 and netCDF-Fortran version 4.4.5 with GNU 9.4.0 compilers.

I have tried the following, with no success:

  • I have added -DIOAPI_NCF4=1 to the Makeinclude file.
  • I added the output of nf-config --flibs and nc-config --libs to LIBS in the m3tools Makefile.

I have attached my Makeinclude file, the Makefiles for ioapi and m3tools, and the make logs for ioapi and m3tools.

ioapi_make.log.txt (5.7 KB)
m3tools_make.log.txt (1.3 KB)
Makefile-ioapi.txt (15.8 KB)
Makefile-m3tools.txt (11.6 KB)
Makeinclude.Linux2_x86_64gfort_openmpi_4.0.1_gcc_9.4.0.txt (1.6 KB)

Any help you can offer would be appreciated!

See https://cjcoats.github.io/ioapi/AVAIL.html#ncf4

These symbols indicate that you have built netCDF with netCDF-4 not enabled, but are trying to use a libioapi.a for which it is enabled.

The simplest solution for where you say you are would probably be to re-build your netCDF libraries with netCDF enabled, and then re-link (note the make relink option in the Makefile, which can save you a bit of work/time in that last step…)

Do you have any suggestions for disabling netCDF-4 when building libioapi.a?

For consistency with my research group’s CMAQ configuration, it’s important that I not enable netCDF-4 features.

Thanks again!

Do you have any suggestions for disabling netCDF-4 when building libioapi.a?
Follow the instructions in the I/O API Availability/Download/Installation document: the default installation is for netCDF with netCDF4 disabled. If you have an I/O API installation where you’ve modified the Makefiles, etc. as suggested by that so-called SMOKE Wiki, then blow them away first.

Actually, it is best to get the I/O API from GitHub, so that you can easily do updates without having to re-build the whole thing:

git clone GitHub - cjcoats/ioapi-3.2: I/O API Version 3.2: new, beta

I successfully built m3tools after cloning a fresh I/O API from GitHub–thank you for your suggestions!