Airs2m3 error in IOAOP m3tools compilation

Hi, I am trying to compile ioapi and m3tools on my university’s machine.

The loaded modules include intel-compilers netcdf-c netcdf-fortran hdf5.

I used nc-config --all and arch to check C compiler (CC), fortran compiler (FC), and machine type, and decide the BIN: BIN=uname -s``uname -r | cut -d. -f1_x86_64gfortmpi.

Compiling ioapi is successful, but the air2m3 error occur when compiling m3tools.

The lib flags in /m3tools/Makefile is

LIBS = -L${OBJDIR} -lioapi -L/spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/netcdf-c-4.8.1-7dwpqiw3lhygretuczntsfnug27ark67/lib -lnetcdf -L/spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/netcdf-fortran-4.5.3-slv6qm3skovi7vcwvnveuvliajniqovh/lib -lnetcdff -L/sw/isaac/applications/hdf5/1.10.8/rhel8_cascadelake_intel20.4.304/lib -lhdf5_hl -lhdf5 -L/sw/isaac/applications/zlib/1.2.11/rhel8_cascadelake_intel20.4.304/lib -lz (OMPLIBS) (ARCHLIB) $(ARCHLIBS)

I attach the error log here:

cd /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi; mpif90 -I/lustre/isaac/scratch/ckuo6/IOAPI3.2/ioapi -I/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -O3 -ffast-math -funroll-loops -m64 -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -c /lustre/isaac/scratch/ckuo6/IOAPI3.2/m3tools/airs2m3.f
cd /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi; mpif90 airs2m3.o -L/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi -lioapi -L/spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/netcdf-c-4.8.1-7dwpqiw3lhygretuczntsfnug27ark67/lib -lnetcdf -L/spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/netcdf-fortran-4.5.3-slv6qm3skovi7vcwvnveuvliajniqovh/lib -lnetcdff -L/sw/isaac/applications/hdf5/1.10.8/rhel8_cascadelake_intel20.4.304/lib -lhdf5_hl -lhdf5 -L/sw/isaac/applications/zlib/1.2.11/rhel8_cascadelake_intel20.4.304/lib -lz -fopenmp -dynamic -L/usr/lib64 -lm -lpthread -lc -o airs2m3
/usr/bin/ld: warning: libmpi.so.40, needed by /spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/netcdf-c-4.8.1-7dwpqiw3lhygretuczntsfnug27ark67/lib/libnetcdf.so, may conflict with libmpi.so.12
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(init3.o): In function init3_': init3.F90:(.text+0x2e8): undefined reference to nfmpi_inq_libvers_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(open3.o): In function open3_': open3.F90:(.text+0x12fc): undefined reference to nfmpi_close_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(opnlog3.o): In function opnlog3_': opnlog3.F90:(.text+0x1a79): undefined reference to nfmpi_get_att_text_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_crtfil3.o): In function pn_crtfil3_': pn_crtfil3.F90:(.text+0x74a): undefined reference to nfmpi_enddef_’
pn_crtfil3.F90:(.text+0x7f3): undefined reference to nfmpi_create_' pn_crtfil3.F90:(.text+0x873): undefined reference to nfmpi_close_’
pn_crtfil3.F90:(.text+0x9a9): undefined reference to nfmpi_put_att_text_' pn_crtfil3.F90:(.text+0xa56): undefined reference to nfmpi_put_att_text_’
pn_crtfil3.F90:(.text+0xacd): undefined reference to nfmpi_put_att_int_' pn_crtfil3.F90:(.text+0xb38): undefined reference to nfmpi_put_att_int_’
pn_crtfil3.F90:(.text+0xba1): undefined reference to nfmpi_put_att_int_' pn_crtfil3.F90:(.text+0xc08): undefined reference to nfmpi_put_att_int_’
pn_crtfil3.F90:(.text+0xc70): undefined reference to nfmpi_put_att_int_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_crtfil3.o):pn_crtfil3.F90:(.text+0xd2b): more undefined references to nfmpi_put_att_int_’ follow
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_crtfil3.o): In function pn_crtfil3_': pn_crtfil3.F90:(.text+0x1194): undefined reference to nfmpi_put_att_double_’
pn_crtfil3.F90:(.text+0x1210): undefined reference to nfmpi_put_att_double_' pn_crtfil3.F90:(.text+0x128e): undefined reference to nfmpi_put_att_double_’
pn_crtfil3.F90:(.text+0x130a): undefined reference to nfmpi_put_att_double_' pn_crtfil3.F90:(.text+0x1387): undefined reference to nfmpi_put_att_double_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_crtfil3.o):pn_crtfil3.F90:(.text+0x1404): more undefined references to nfmpi_put_att_double_' follow /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_crtfil3.o): In function pn_crtfil3_‘:
pn_crtfil3.F90:(.text+0x15e3): undefined reference to nfmpi_put_att_int_' pn_crtfil3.F90:(.text+0x165b): undefined reference to nfmpi_put_att_real_’
pn_crtfil3.F90:(.text+0x16d6): undefined reference to nfmpi_put_att_real_' pn_crtfil3.F90:(.text+0x17a0): undefined reference to nfmpi_put_att_text_’
pn_crtfil3.F90:(.text+0x182e): undefined reference to nfmpi_put_att_text_' pn_crtfil3.F90:(.text+0x1890): undefined reference to nfmpi_put_att_text_’
pn_crtfil3.F90:(.text+0x18d1): undefined reference to nfmpi_put_att_text_' pn_crtfil3.F90:(.text+0x1993): undefined reference to nfmpi_put_att_text_’
pn_crtfil3.F90:(.text+0x19f7): undefined reference to nfmpi_def_dim_' pn_crtfil3.F90:(.text+0x1a81): undefined reference to nfmpi_def_dim_’
pn_crtfil3.F90:(.text+0x1b0a): undefined reference to nfmpi_def_dim_' pn_crtfil3.F90:(.text+0x1b5e): undefined reference to nfmpi_def_dim_’
pn_crtfil3.F90:(.text+0x1c59): undefined reference to nfmpi_def_var_' pn_crtfil3.F90:(.text+0x1cc3): undefined reference to nfmpi_put_att_text_’
pn_crtfil3.F90:(.text+0x1d42): undefined reference to nfmpi_put_att_text_' pn_crtfil3.F90:(.text+0x1dad): undefined reference to nfmpi_put_att_text_’
pn_crtfil3.F90:(.text+0x1e44): undefined reference to nfmpi_def_dim_' pn_crtfil3.F90:(.text+0x1eb2): undefined reference to nfmpi_def_dim_’
pn_crtfil3.F90:(.text+0x2001): undefined reference to nfmpi_def_var_' pn_crtfil3.F90:(.text+0x2037): undefined reference to nfmpi_put_att_text_’
pn_crtfil3.F90:(.text+0x206d): undefined reference to nfmpi_put_att_text_' pn_crtfil3.F90:(.text+0x20a6): undefined reference to nfmpi_put_att_text_’
pn_crtfil3.F90:(.text+0x245b): undefined reference to nfmpi_abort_' pn_crtfil3.F90:(.text+0x2585): undefined reference to nfmpi_sync_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_opnfil3.o): In function pn_opnfil3_': pn_opnfil3.F90:(.text+0xa8): undefined reference to nfmpi_open_’
pn_opnfil3.F90:(.text+0xfd): undefined reference to nfmpi_get_att_int_' pn_opnfil3.F90:(.text+0x230): undefined reference to nfmpi_close_’
pn_opnfil3.F90:(.text+0x40e): undefined reference to nfmpi_get_att_int_' pn_opnfil3.F90:(.text+0x451): undefined reference to nfmpi_get_att_int_’
pn_opnfil3.F90:(.text+0x521): undefined reference to nfmpi_get_att_int_' pn_opnfil3.F90:(.text+0x582): undefined reference to nfmpi_get_att_int_’
pn_opnfil3.F90:(.text+0x5e5): undefined reference to nfmpi_get_att_int_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_opnfil3.o):pn_opnfil3.F90:(.text+0x648): more undefined references to nfmpi_get_att_int_’ follow
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_opnfil3.o): In function pn_opnfil3_': pn_opnfil3.F90:(.text+0x8ad): undefined reference to nfmpi_get_att_double_’
pn_opnfil3.F90:(.text+0x913): undefined reference to nfmpi_get_att_double_' pn_opnfil3.F90:(.text+0x97b): undefined reference to nfmpi_get_att_double_’
pn_opnfil3.F90:(.text+0x9e1): undefined reference to nfmpi_get_att_double_' pn_opnfil3.F90:(.text+0xa47): undefined reference to nfmpi_get_att_double_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_opnfil3.o):pn_opnfil3.F90:(.text+0xaaf): more undefined references to nfmpi_get_att_double_' follow /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_opnfil3.o): In function pn_opnfil3_‘:
pn_opnfil3.F90:(.text+0xc44): undefined reference to nfmpi_get_att_int_' pn_opnfil3.F90:(.text+0xcb9): undefined reference to nfmpi_get_att_real_’
pn_opnfil3.F90:(.text+0xd0f): undefined reference to nfmpi_get_att_real_' pn_opnfil3.F90:(.text+0xd77): undefined reference to nfmpi_get_att_text_’
pn_opnfil3.F90:(.text+0xdd5): undefined reference to nfmpi_inq_varid_' pn_opnfil3.F90:(.text+0xe2f): undefined reference to nfmpi_inq_dimid_’
pn_opnfil3.F90:(.text+0xe94): undefined reference to nfmpi_inq_dim_' pn_opnfil3.F90:(.text+0xf37): undefined reference to nfmpi_inq_varid_’
pn_opnfil3.F90:(.text+0xf78): undefined reference to nfmpi_inq_var_' pn_opnfil3.F90:(.text+0xfb5): undefined reference to nfmpi_get_att_text_’
pn_opnfil3.F90:(.text+0x1125): undefined reference to nfmpi_redef_' pn_opnfil3.F90:(.text+0x1194): undefined reference to nfmpi_get_att_text_’
pn_opnfil3.F90:(.text+0x11fc): undefined reference to nfmpi_put_att_text_' pn_opnfil3.F90:(.text+0x1260): undefined reference to nfmpi_put_att_text_’
pn_opnfil3.F90:(.text+0x12a5): undefined reference to nfmpi_enddef_' pn_opnfil3.F90:(.text+0x12c1): undefined reference to nfmpi_sync_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(shut3.o): In function shut3_': shut3.F90:(.text+0x686): undefined reference to nfmpi_close_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(syncfid.o): In function syncfid_': syncfid.F90:(.text+0x3a3): undefined reference to nfmpi_sync_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function __modatts3_MOD_pn_getcmaq': modatts3.F90:(.text+0x91): undefined reference to nfmpi_get_att_int_’
modatts3.F90:(.text+0xc2): undefined reference to nfmpi_get_att_text_' modatts3.F90:(.text+0xee): undefined reference to nfmpi_get_att_text_’
modatts3.F90:(.text+0x11a): undefined reference to nfmpi_get_att_text_' modatts3.F90:(.text+0x146): undefined reference to nfmpi_get_att_text_’
modatts3.F90:(.text+0x175): undefined reference to nfmpi_get_att_text_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o):modatts3.F90:(.text+0x1a4): more undefined references to nfmpi_get_att_text_’ follow
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function __modatts3_MOD_pn_getcmaq': modatts3.F90:(.text+0x312): undefined reference to nfmpi_get_att_real_’
modatts3.F90:(.text+0x33b): undefined reference to nfmpi_get_att_int_' modatts3.F90:(.text+0x364): undefined reference to nfmpi_get_att_int_’
modatts3.F90:(.text+0x38d): undefined reference to nfmpi_get_att_int_' modatts3.F90:(.text+0x3b9): undefined reference to nfmpi_get_att_int_’
modatts3.F90:(.text+0x3de): undefined reference to nfmpi_get_att_int_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o):modatts3.F90:(.text+0x407): more undefined references to nfmpi_get_att_int_’ follow
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function __modatts3_MOD_pn_getcmaq': modatts3.F90:(.text+0x488): undefined reference to nfmpi_get_att_text_’
modatts3.F90:(.text+0x4b7): undefined reference to nfmpi_get_att_text_' modatts3.F90:(.text+0x4e6): undefined reference to nfmpi_get_att_text_’
modatts3.F90:(.text+0x515): undefined reference to nfmpi_get_att_text_' modatts3.F90:(.text+0x544): undefined reference to nfmpi_get_att_text_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o):modatts3.F90:(.text+0x573): more undefined references to nfmpi_get_att_text_' follow /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function modatts3_MOD_pn_getcmaq’:
modatts3.F90:(.text+0xa62): undefined reference to nfmpi_get_att_int_' modatts3.F90:(.text+0xa8b): undefined reference to nfmpi_get_att_int

modatts3.F90:(.text+0xab4): undefined reference to nfmpi_get_att_int_' modatts3.F90:(.text+0xadd): undefined reference to nfmpi_get_att_int

modatts3.F90:(.text+0xb06): undefined reference to nfmpi_get_att_int_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o):modatts3.F90:(.text+0xb2f): more undefined references to nfmpi_get_att_int_’ follow
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function __modatts3_MOD_setcf1': modatts3.F90:(.text+0xba11): undefined reference to nfmpi_redef_’
modatts3.F90:(.text+0xbcb5): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0xbd7e): undefined reference to nfmpi_def_var_’
modatts3.F90:(.text+0xd585): undefined reference to nfmpi_inq_dimid_' modatts3.F90:(.text+0xd6fc): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0xdd56): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0xedda): undefined reference to nfmpi_def_var_’
modatts3.F90:(.text+0xf350): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0xf3ef): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0xf94c): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0xfc01): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0xfca5): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0xfebf): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0x101bd): undefined reference to nfmpi_put_att_text_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o):modatts3.F90:(.text+0x1025c): more undefined references to nfmpi_put_att_text_’ follow
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function __modatts3_MOD_setcf1': modatts3.F90:(.text+0x102b1): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x1047a): undefined reference to nfmpi_put_att_double_' modatts3.F90:(.text+0x10587): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x10626): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x10718): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0x10847): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x10928): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x10a39): undefined reference to nfmpi_put_att_double_' modatts3.F90:(.text+0x10bf2): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0x10cae): undefined reference to nfmpi_put_att_double_' modatts3.F90:(.text+0x10dbd): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x10ef1): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x10fad): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x11135): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x111fb): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x1127f): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x114ce): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0x115fe): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x1169d): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x11722): undefined reference to nfmpi_put_att_double_' modatts3.F90:(.text+0x1179f): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x1181a): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x1189a): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x11911): undefined reference to nfmpi_put_att_double_' modatts3.F90:(.text+0x11990): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x11a07): undefined reference to nfmpi_put_att_double_' modatts3.F90:(.text+0x11b0e): undefined reference to nfmpi_put_att_double_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o):modatts3.F90:(.text+0x11b86): more undefined references to nfmpi_put_att_double_' follow /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function modatts3_MOD_setcf1’:
modatts3.F90:(.text+0x11d85): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x11e0a): undefined reference to nfmpi_put_att_double

modatts3.F90:(.text+0x11f0b): undefined reference to nfmpi_put_att_double_' modatts3.F90:(.text+0x11f84): undefined reference to nfmpi_put_att_double

modatts3.F90:(.text+0x12005): undefined reference to nfmpi_put_att_double_' modatts3.F90:(.text+0x1208b): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0x1210c): undefined reference to nfmpi_put_att_double_' modatts3.F90:(.text+0x1220c): undefined reference to nfmpi_put_att_double_’
modatts3.F90:(.text+0x12329): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x1244d): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0x12572): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x12699): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0x12719): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x12778): undefined reference to nfmpi_enddef_’
modatts3.F90:(.text+0x12832): undefined reference to nfmpi_put_vara_double_all_' modatts3.F90:(.text+0x128e9): undefined reference to nfmpi_put_vara_double_all_’
modatts3.F90:(.text+0x129ac): undefined reference to nfmpi_put_vara_double_all_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function modatts3_MOD_setmtext’:
modatts3.F90:(.text+0x130f1): undefined reference to nfmpi_redef_' modatts3.F90:(.text+0x1313f): undefined reference to nfmpi_put_att_text

modatts3.F90:(.text+0x13157): undefined reference to nfmpi_enddef_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function modatts3_MOD_setcmaq2’:
modatts3.F90:(.text+0x1682a): undefined reference to nfmpi_redef_' modatts3.F90:(.text+0x16864): undefined reference to nfmpi_put_att_int

modatts3.F90:(.text+0x168a7): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x168e0): undefined reference to nfmpi_put_att_text

modatts3.F90:(.text+0x16919): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x16954): undefined reference to nfmpi_put_att_text

modatts3.F90:(.text+0x1698f): undefined reference to nfmpi_put_att_text_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o):modatts3.F90:(.text+0x169ca): more undefined references to nfmpi_put_att_text_’ follow
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function __modatts3_MOD_setcmaq2': modatts3.F90:(.text+0x16ba9): undefined reference to nfmpi_put_att_real_’
modatts3.F90:(.text+0x16be4): undefined reference to nfmpi_put_att_int_' modatts3.F90:(.text+0x16c1f): undefined reference to nfmpi_put_att_int_’
modatts3.F90:(.text+0x16c58): undefined reference to nfmpi_put_att_int_' modatts3.F90:(.text+0x16c91): undefined reference to nfmpi_put_att_int_’
modatts3.F90:(.text+0x16ccc): undefined reference to nfmpi_put_att_int_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o):modatts3.F90:(.text+0x16d07): more undefined references to nfmpi_put_att_int_’ follow
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function __modatts3_MOD_setcmaq2': modatts3.F90:(.text+0x16db4): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0x16def): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x16e2a): undefined reference to nfmpi_put_att_text_’
modatts3.F90:(.text+0x16e65): undefined reference to nfmpi_put_att_text_' modatts3.F90:(.text+0x16e9e): undefined reference to nfmpi_put_att_text_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o):modatts3.F90:(.text+0x16eda): more undefined references to nfmpi_put_att_text_' follow /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function modatts3_MOD_setcmaq2’:
modatts3.F90:(.text+0x1773c): undefined reference to nfmpi_put_att_int_' modatts3.F90:(.text+0x17776): undefined reference to nfmpi_put_att_int

modatts3.F90:(.text+0x177b1): undefined reference to nfmpi_put_att_int_' modatts3.F90:(.text+0x177eb): undefined reference to nfmpi_put_att_int

modatts3.F90:(.text+0x17824): undefined reference to nfmpi_put_att_int_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o):modatts3.F90:(.text+0x1785e): more undefined references to nfmpi_put_att_int_’ follow
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function __modatts3_MOD_setcmaq2': modatts3.F90:(.text+0x17b6c): undefined reference to nfmpi_enddef_’
modatts3.F90:(.text+0x1ceaa): undefined reference to nfmpi_enddef_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(modatts3.o): In function modatts3_MOD_iscmaq’:
modatts3.F90:(.text+0x27691): undefined reference to nfmpi_inq_attid_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(close3.o): In function close3
’:
close3.F90:(.text+0x847): undefined reference to nfmpi_close_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_wrvars.o): In function pn_wrverr
’:
pn_wrvars.F90:(.text+0x6a): undefined reference to nfmpi_strerror_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_wrvars.o): In function pn_wrint_‘:
pn_wrvars.F90:(.text+0xde1): undefined reference to nfmpi_put_vara_real_all_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_wrvars.o): In function pn_wrreal_’:
pn_wrvars.F90:(.text+0x22f1): undefined reference to nfmpi_put_vara_real_all_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_wrvars.o): In function pn_wrdble_‘:
pn_wrvars.F90:(.text+0x3801): undefined reference to nfmpi_put_vara_real_all_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(pn_wrvars.o): In function pn_wrint8_’:
pn_wrvars.F90:(.text+0x4d11): undefined reference to nfmpi_put_vara_int8_all_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(rdatt3.o): In function master.0.rdatt3_‘:
rdatt3.F90:(.text+0xaff): undefined reference to nfmpi_inq_att_' rdatt3.F90:(.text+0x1ebc): undefined reference to nfmpi_get_att_int_’
rdatt3.F90:(.text+0x1ee0): undefined reference to nfmpi_get_att_int8_' rdatt3.F90:(.text+0x1f04): undefined reference to nfmpi_get_att_real_’
rdatt3.F90:(.text+0x1f28): undefined reference to nfmpi_get_att_double_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(rdvars.o): In function rdvars_‘:
rdvars.F90:(.text+0x519): undefined reference to nfmpi_get_vara_int_' rdvars.F90:(.text+0x1514): undefined reference to nfmpi_get_vara_int8_’
rdvars.F90:(.text+0x153c): undefined reference to nfmpi_get_vara_int8_' rdvars.F90:(.text+0x1598): undefined reference to nfmpi_get_vara_int_’
rdvars.F90:(.text+0x15c8): undefined reference to nfmpi_get_vara_real_' rdvars.F90:(.text+0x15f8): undefined reference to nfmpi_get_vara_real_’
rdvars.F90:(.text+0x17f8): undefined reference to nfmpi_get_vara_double_' rdvars.F90:(.text+0x1828): undefined reference to nfmpi_get_vara_double_’
rdvars.F90:(.text+0x1858): undefined reference to nfmpi_get_vara_int8_' rdvars.F90:(.text+0x1988): undefined reference to nfmpi_get_vara_int8_’
rdvars.F90:(.text+0x1c63): undefined reference to nfmpi_get_vara_int_' rdvars.F90:(.text+0x1ca3): undefined reference to nfmpi_get_vara_int_’
rdvars.F90:(.text+0x1d16): undefined reference to nfmpi_get_vara_real_' rdvars.F90:(.text+0x1d3e): undefined reference to nfmpi_get_vara_real_’
rdvars.F90:(.text+0x1d8e): undefined reference to nfmpi_get_vara_double_' rdvars.F90:(.text+0x1db6): undefined reference to nfmpi_get_vara_double_’
rdvars.F90:(.text+0x1e0b): undefined reference to nfmpi_get_vara_int_' rdvars.F90:(.text+0x1e60): undefined reference to nfmpi_get_vara_real_’
rdvars.F90:(.text+0x1e8d): undefined reference to nfmpi_get_vara_double_' rdvars.F90:(.text+0x1eba): undefined reference to nfmpi_get_vara_int8_’
/lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(wratt3.o): In function master.0.wratt3_': wratt3.F90:(.text+0x16b6): undefined reference to nfmpi_redef_’
wratt3.F90:(.text+0x1cdb): undefined reference to nfmpi_put_att_text_' wratt3.F90:(.text+0x2019): undefined reference to nfmpi_put_att_real_’
wratt3.F90:(.text+0x2088): undefined reference to nfmpi_put_att_int_' wratt3.F90:(.text+0x2136): undefined reference to nfmpi_put_att_double_’
wratt3.F90:(.text+0x217b): undefined reference to nfmpi_put_att_int8_' /lustre/isaac/scratch/ckuo6/IOAPI3.2/Linux4_x86_64gfortmpi/libioapi.a(wrtflag.o): In function wrtflag_‘:
wrtflag.F90:(.text+0xb10): undefined reference to nfmpi_put_vara_int_' /spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/netcdf-c-4.8.1-7dwpqiw3lhygretuczntsfnug27ark67/lib/libnetcdf.so: undefined reference to H5Pset_dxpl_mpio’
/spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/netcdf-c-4.8.1-7dwpqiw3lhygretuczntsfnug27ark67/lib/libnetcdf.so: undefined reference to H5Pset_fapl_mpio' /spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/netcdf-fortran-4.5.3-slv6qm3skovi7vcwvnveuvliajniqovh/lib/libnetcdff.so: undefined reference to _gfortran_os_error_at@GFORTRAN_10’
/spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/netcdf-c-4.8.1-7dwpqiw3lhygretuczntsfnug27ark67/lib/libnetcdf.so: undefined reference to H5Pset_all_coll_metadata_ops' /spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/netcdf-c-4.8.1-7dwpqiw3lhygretuczntsfnug27ark67/lib/libnetcdf.so: undefined reference to H5Pset_coll_metadata_write’
collect2: error: ld returned 1 exit status
make: *** [Makefile:244: airs2m3] Error 1

See https://cjcoats.github.io/ioapi/AVAIL.html#build and https://cjcoats.github.io/ioapi/BUFFERED.html#pncf:
You have chosen to build a pnetCDF enabled libioapi.a. That means you need the pnetCDF library as part of your link-flags (-L*<somewhere>* -lnetcdf) : that’s where the nfmpi_* routines live. And you have to build it compatibly with your netCDF builds…

You need this flag-set for all programs linked against this *libioapi.*a.

Thanks for the reply, @cjcoats

I have a question before fixing pnetCDF issue. Since the netCDF was not built by myself, how should I decide the proper $BIN?
I used: nc-config --cc and nc-config --fc to check compiler of netcdf, and it shows
/spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/openmpi-4.1.1-l7d6jlppwumjp4xlay2536dulxhfkj3f/bin/mpicc
/spack/spack-0.17.2/apps/linux-rhel8-cascadelake/gcc-10.2.0/openmpi-4.1.1-l7d6jlppwumjp4xlay2536dulxhfkj3f/bin/mpif90

Next step, I found the Makeinclude.Linux4_x86_64gfortmpi has the same CC, CXX, and FC, so that’s why I choose Linux4_x86_64gfortmpi.
Is it the right step to choose the suitable BIN when the machine already has netCDF?

As the build-instructions indicate:

Vendor supplied netCDF libraries frequently cause problems, in part because they are compiled with compilers that are not link-compatible with the Fortran compilers used by the I/O API and the various models (CMAQ, SMOKE, etc.) that use it.

It is strongly recommended that you build all of your own libraries, using the compilers and flags you use with the I/O API. Then build all programs (M3Tools, SMOKE, CMAQ, …) using the same compilers and compatible compile-flags.