CMAQ_5.4 CCTM compile error

Hi,
I am getting errors while compiling the CCTM. I am attaching my log file for reference. And here is my errors:

/home/hanlu_sun/CMAQ-main/lib/x86_64/intel/ioapi/lib/libnetcdf.a (libnchdf5_la-hdf5attr.o): in function 'NC4_HDF5_rename_att ’ in:
hdf5attr.c:(.text+0x29f): undefined reference to ‘H5Adelete’
hdf5attr.c:(.text+0x377): undefined reference to ‘H5Adelete’
/home/hanlu_sun/CMAQ-main/lib/x86_64/intel/ioapi/lib/libnetcdf.a (libnchdf5_la-hdf5attr.o): in function 'NC4_HDF5_del_att ’ in:
hdf5attr.c:(.text+0x5ce): undefined reference to ‘H5Adelete’
/home/hanlu_sun/CMAQ-main/lib/x86_64/intel/ioapi/lib/libnetcdf.a (libnchdf5_la-hdf5create.o): in function 'NC4_create ':
hdf5create.c:(.text+0x76): undefined reference to ‘H5Pclose’
hdf5create.c:(.text+0x1bb): undefined reference to ‘H5check_version’
hdf5create.c:(.text+0x1e1): undefined reference to ‘H5check_version’
hdf5create.c:(.text+0x23e): undefined reference to ‘H5open’
hdf5create.c:(.text+0x245): undefined reference to ‘H5P_CLS_FILE_ACCESS_g’
hdf5create.c:(.text+0x24c): undefined reference to ‘H5Pcreate’
hdf5create.c:(.text+0x276): undefined reference to ‘H5Pset_fclose_degree’
hdf5create.c:(.text+0x2c6): undefined reference to ‘H5Pset_cache’
hdf5create.c:(.text+0x2e3): undefined reference to ‘H5Pset_libver_bounds’
hdf5create.c:(.text+0x2f6): undefined reference to ‘H5open’
hdf5create.c:(.text+0x2fd): undefined reference to ‘H5P_CLS_FILE_CREATE_g’
hdf5create.c:(.text+0x304): undefined reference to ‘H5Pcreate’
hdf5create.c:(.text+0x321): undefined reference to ‘H5Pset_obj_track_times’
hdf5create.c:(.text+0x33f): undefined reference to ‘H5Pset_link_creation_order’
hdf5create.c:(.text+0x35d): undefined reference to ‘H5Pset_attr_creation_order’
hdf5create.c:(.text+0x41d): undefined reference to ‘H5Pset_fapl_core’
hdf5create.c:(.text+0x444): undefined reference to ‘H5Fcreate’
hdf5create.c:(.text+0x48c): undefined reference to ‘H5Gopen2’
hdf5create.c:(.text+0x4ab): undefined reference to ‘H5Pclose’
hdf5create.c:(.text+0x4ba): reference to ‘H5Pclose’ undefined
hdf5create.c:(.text+0x4f9): reference to ‘H5Fcreate’ undefined
make: *** [CCTM_v54.exe] error 1
ERROR while running make command

if ( ! 0 ) then
mv Makefile Makefile.intel
mv: “Makefile” and “Makefile.intel” are the same file.
if ( -e Makefile.intel && -e Makefile ) rm Makefile
rm Makefile
ln -s Makefile.intel Makefile
endif
if ( 0 != 0 ) then
if ( -e /home/hanlu_sun/CMAQ-main/CCTM/scripts/BLD_CCTM_v54_intel/CCTM_v54.cfg ) then
echo >>> previous CCTM_v54.cfg exists, re-naming to CCTM_v54.cfg.old <<<

previous CCTM_v54.cfg exists, re-naming to CCTM_v54.cfg.old <<<
mv /home/hanlu_sun/CMAQ-main/CCTM/scripts/BLD_CCTM_v54_intel/CCTM_v54.cfg /home/hanlu_sun/CMAQ-main/CCTM/scripts/BLD_CCTM_v54_intel/CCTM_v54.cfg.old
endif
mv CCTM_v54.cfg.bld /home/hanlu_sun/CMAQ-main/CCTM/scripts/BLD_CCTM_v54_intel/CCTM_v54.cfg
if ( 0 ) then
exit

And i used:
hdf5-1.10.6
zlib-1.2.8
netcdf-c-4.7.4
netcdf-fortran-4.5.3
ioapi-3.2
intel 2022 compiler

And here is the environment settings in my config_cmaq.csh script:

#> Intel fortran compiler…
case intel:

    #> I/O API, netCDF Library Locations -- used in WRF-CMAQ
    setenv NETCDF /home/hanlu_sun/CMAQ_models/tools/netcdf4 # Note please combine netCDF-C & Fortran Libraries 
    setenv IOAPI /home/hanlu_sun/CMAQ_models/tools/ioapi32
    setenv WRF_ARCH # [1-75]  

    #> I/O API, netCDF, and MPI Library Locations -- used in CMAQ
    setenv IOAPI_INCL_DIR   /home/hanlu_sun/CMAQ_models/tools/ioapi32/ioapi/fixed_src    #> I/O API include header files
    setenv IOAPI_LIB_DIR    /home/hanlu_sun/CMAQ_models/tools/ioapi32/Linux2_x86_64ifort       #> I/O API libraries
    setenv NETCDF_LIB_DIR   /home/hanlu_sun/CMAQ_models/tools/netcdf4/lib         #> netCDF C directory path
    setenv NETCDF_INCL_DIR  /home/hanlu_sun/CMAQ_models/tools/netcdf4/include       #> netCDF C directory path
    setenv NETCDFF_LIB_DIR  /home/hanlu_sun/CMAQ_models/tools/netcdf4/lib  #> netCDF Fortran directory path
    setenv NETCDFF_INCL_DIR /home/hanlu_sun/CMAQ_models/tools/netcdf4/include      #> netCDF Fortran directory path
    setenv MPI_INCL_DIR     /apps/intel/oneapi/mpi/2021.6.0/include             #> MPI Include directory path
    setenv MPI_LIB_DIR      /apps/intel/oneapi/mpi/2021.6.0/lib            #> MPI Lib directory path

    #> Compiler Aliases and Flags
    #> set the compiler flag -qopt-report=5 to get a model optimization report in the build directory with the optrpt extension
    setenv myFC mpiifort
    setenv myCC icc       
    setenv myFSTD "-O3 -fno-alias -mp1 -fp-model source -ftz -simd -align all -xHost -vec-guard-write -unroll-aggressive"
    setenv myDBG  "-O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback"
    setenv myLINK_FLAG "" #-simd" openMP not supported w/ CMAQ
    setenv myFFLAGS "-fixed -132"
    setenv myFRFLAGS "-free"
    setenv myCFLAGS "-O2"
    setenv extra_lib ""

It is worth noting that setting setenv myLINK_FLAG to “-qopenmp” still gives the same error.

We need to see the entire line in which the error occurred, in order to answer the following: are all of the directories for the extra libraries (HDF, ZLIB)_ correctly specified in this line, together with the correct libraries themselves?

By the way, did you build your own netCDF using the Intel compilers? (as the I/O API build-document says, vendor-supplied netCDF libraries rarely work with non-GNU compilers). If so, why did you not follow the documented recommendations to build netCDF with --disable-netcdf4 --disable-dap ?

Thank you so much for your response.
All libraries are compiled with intel.
I used "CPPFLAGS=-I${hdf_dir}/include LDFLAGS=-L${hdf_dir}/lib . /configure --prefix=${netcdf_dir} --enable-netcdf-4 --enable-largefile --disable-dap"when compiling netcdf.

I see the documentation suggests that " If you build netCDF-4 without the [–disable-netcdf4], you will also need to add [-DIOAPI_NCF4=1] either to the [ARCHFLAGS] in your Makeinclude.${BIN}".
So I used [-DIOAPI_NCF4=1] to compile ioapi.

When I compile netcdf-c with “–disable-netcdf-4 --disable-dap”, I get multiple errors when compiling netcdf-fortran.

… /fortran/.libs/libnetcdff.so: undefined reference to `nc_set_log_level’
make[3]: *** [nf_test] error 1
make[3]: Leaving directory “/home/hanlu_sun/CMAQ_downloads/netcdf-fortran-4.5.3/nf_test”.
make[2]: *** [check-am] error 2
make[2]: leaving directory “/home/hanlu_sun/CMAQ_downloads/netcdf-fortran-4.5.3/nf_test”.
make[1]: *** [check] error 2
make[1]: leaving directory “/home/hanlu_sun/CMAQ_downloads/netcdf-fortran-4.5.3/nf_test”.
make: *** [check-recursive] error 1

Hi, thanks for your answer, I installed netcdf with the new compile command and have successfully compiled CCTM so far.