Ioapi 3.2-20200828 m3tools build error - "ld: cannot find" several libraries

Following instructions from here: CMAQ/CMAQ_UG_tutorial_build_library_intel.md at master · USEPA/CMAQ · GitHub

I was able to build the non-MPI version, i.e. Linux2_x86_64ifort, but am running into m3tools build errors with Linux2_x86_64ifortmpi

OS: RHEL 8.1
icc/ifort version: 19.1.3.304 (20200925)
Open MPI version: 4.1.0 (configured with --enable-static)
ioapi version: 3.2-20200828
netcdf-c version: 4.7.4
netcdf-fortran version: 4.5.3

netcdf-c configured with “–disable-netcdf4 --disable-netcdf-4 --disable-dap” Build and check succeeded

netcdf-fortran build and check succeeded.

ioapi

  • use BIN=Linux2_x86_64ifortmpi
  • in Makefile: DEFINEFLAGS = -DIOAPI_NCF4=1 (ARCHFLAGS) (PARFLAGS)

Build of libioapi.a succeeds. Partial output of “nm libioapi.a”:

m3utilio.o:
0000000000002220 C bdesc3_
000000000003a5f0 C cdesc3_
U for_adjustl
U for_cpstr
U for_cpystr
U for_f90_index
U for_len_trim
U for_trim
U gcd_
0000000000000000 T m3utilio._
0000000000000010 T m3utilio_mp_fixfield_
0000000000000000 D m3utilio_mp_id_
0000000000000160 T m3utilio_mp_keystr_
00000000000000c0 T m3utilio_mp_keyval_
00000000000002a0 T m3utilio_mp_lcm_
0000000000000048 D m3utilio_mp_m3types_
U str2real_
0000000000000000 r __STRLITPACK_1
0000000000000008 r __STRLITPACK_15
0000000000000004 r __STRLITPACK_6
0000000000000000 r __STRLITPACK_7

But building m3tools gives these errors:

make[1]: Entering directory ‘/ifs/opt/cmaq/5.3.2/src/ioapi-3.2-20200828/m3tools’
cd /ifs/opt/cmaq/5.3.2/src/ioapi-3.2-20200828/Linux2_x86_64ifortmpi; mpif90 -auto -warn notruncated_source -Bstatic -static-intel /ifs/opt/cmaq/5.3.2/src/ioapi-3.2-20200828/Linux2_x86_64ifortmpi/airs2m3.o -L/ifs/opt/cmaq/5.3.2/src/ioapi-3.2-20200828/Linux2_x86_64ifortmpi -lioapi -lnetcdff -lnetcdf -Bstatic -o airs2m3
ld: cannot find -lm
ld: cannot find -lucp
ld: cannot find -luct
ld: cannot find -lucm
ld: cannot find -lucs
ld: cannot find -levent_core
ld: cannot find -levent_pthreads
ld: cannot find -lpmix
ld: cannot find -lrt
ld: cannot find -lutil
ld: cannot find -lz
make[1]: *** [Makefile:243: airs2m3] Error 1
make[1]: Leaving directory ‘/ifs/opt/cmaq/5.3.2/src/ioapi-3.2-20200828/m3tools’
make: *** [Makefile:205: all] Error 2

All those “missing” libs are in /usr/lib64 as usual, though they are all shared libs. libpmix is in a non-standard location, but the lib directory is in LD_LIBRARY_PATH.

Would appreciate any pointers on where to look to get this build working. Thanks in advance.

Either install the static libraries, or remove the “-Bstatic” flag from the link-flags.