Ifort compiles IOAPI-3.2 with netcdf4

I used ifort to compiled IOAPI-3.2. netcdf4 is used. When I typed “make BIN=Linux2_x86_64ifort”, I got the following error message. Any suggestions to solve the problem? Thanks!

ld: cannot find -lnetcdff
ld: cannot find -lnetcdf
make[1]: *** [airs2m3] Error 1
make[1]: Leaving directory `/home/kliao/ioapi-3.2/m3tools’
make: *** [all] Error 2

In my Makefile, NCFLIBS = -lnetcdff -lnetcdf.

See Paragraph 8 in the I/O API build instructions https://cjcoats.github.io/ioapi/AVAIL.html#build on the Availability/Download/Installation page:

Acquire and build the netCDF library, libnetcdf.a (and libnetcdff.a for netCDF-4.1 or later), for each configuration. The netCDF home page is https://www.unidata.ucar.edu/software/netcdf/ For each configuration,copy or link the resulting libnetcdf.a (and libnetcdff.a, if you’re building netCDF version 4.1 or later) to the appropriate object directory $BASEDIR/${BIN} .
See NOTES on netCDF-4 for configuring netCDF-4.

For I/O API-3.2 and netCDF-4: Some configurations of netCDF-4 have INTEGER*8 (64-bit integer) support, and some do not; the I/O API tries to make it possible to use this support if it is available, but needs to include “hacks” to cover for its absence when it isn’t. You can find out if it is included in netCDF using the command

nm libnetcdff.a | grep nf_get_var_int64_

If present, you need to add the definition -DIOAPI_NCF4=1 to the make-variable ARCHFLAGS in your MAKEINCLUDE.${BIN} . Otherewise, you will get “multiply defined symbol” errors when you attempt to compile programs.

For I/O API-3.2, if you are building the PnetCDF/MPI distributed-I/O version for CMAQ, then install the appropriate MPI development package, and download PnetCDF from https://trac.mcs.anl.gov/projects/parallel-netcdf/wiki/Download then build and install libpnetcdf.a and copy or link it to the appropriate object directory.
Note that to a very large extent, different MPI implementations are not compatible : Intel MPI does not play well with OpenMPI does not play well with MPICH does not play well with MVAPICH… ;-(

If you plan to build a coupling-mode configuration, do the same with PVM’s libpvm3.a. See http://www.csm.ornl.gov/pvm/pvm_home.html (Only the C interface to PVM is used; the resulting library tends to be more compiler-independent than for netCDF, where both C and Fortran interfaces are used.)