IOAPI 3.2 installation

I’ve built netcdf using
ifort 17
netcdf-c-4.4.0
netcdf-fortran-4.4.3

for c: ./configure --disable-shared --enable-parallel-tests --disable-netcdf4 --disable-dap --prefix=$NCDIR
for fortran: ./configure --prefix=$NCDIR

I soft linked all files under /storage/highspeed/apps/netcdf_4.4.x_ifc17/lib to /storage/highspeed/apps/ioapi-3.2_ifc17/Linux2_x86_64ifort

[jhuang@ncaqc2017 bin] nc-config --libs -L/storage/highspeed/apps/netcdf_4.4.x_ifc17/lib -L/storage/highspeed/apps/hdf5-1.8.18_ifc17/lib -lnetcdf -lm [jhuang@ncaqc2017 bin] nf-config --libs
unknown option: --libs

I also changed -lnetcdff -lnetcdf to -lnetcdf in all IOAPI makefiles, I am not sure should I do this or change opposite way in netcdf makefiles.

I am using nocpl for ioapi make file with Linux2_x86_64ifort
I searched the questions on the forum, and tried all suggestions I learnt, but still it returned some undefined reference errors related to netcdf


Detailed error messages can be found:

Any suggestion will be helpful,

Thank you
Joey Huang

Please check the Makefile in the m3tools directory and change it from

LIBS = -L${OBJDIR} -lioapi -lnetcdf  $(OMPLIBS) $(ARCHLIB) $(ARCHLIBS)

to

 LIBS = -L${OBJDIR} -lioapi -lnetcdff -lnetcdf $(OMPLIBS) $(ARCHLIB) $(ARCHLIBS)
1 Like

Liz,

It works.

Thank you!
Joey

1 Like
lizadams, I am installing IOAPI 3.2 with netcdfs configured with disable-dap but has netcdf-4 enabled in gcc9.2. But I am getting this error at the end, please help. Thanks.

cd /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort; gfortran -c -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -O3 -ffast-math -funroll-loops -m64 -fopenmp -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -I/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/ioapi /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/ioapi/modgctp.f90
cd /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort; gfortran -c -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -O3 -ffast-math -funroll-loops -m64 -fopenmp -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -I/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/ioapi /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/ioapi/modwrfio.f90
cd /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort; gfortran -c -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -O3 -ffast-math -funroll-loops -m64 -fopenmp -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -I/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/ioapi /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/ioapi/modmpasfio.f90
make[1]: Leaving directory /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/ioapi' (cd /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/m3tools ; make BIN=Linux2_x86_64gfort all) make[1]: Entering directory/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/m3tools’
cd /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort; gfortran -I/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/ioapi -I/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort -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 /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/m3tools/airs2m3.f
cd /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort; gfortran airs2m3.o -L/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort -lioapi -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz -fopenmp -dynamic -L/usr/lib64 -lm -lpthread -lc -o airs2m3
/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort/libnetcdff.a(nf_var1io.o): In function nf_put_var1_int64_': /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/netcdf-fortran-4.5.1/fortran/nf_var1io.F90:354: multiple definition ofnf_put_var1_int64_’
/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort/libioapi.a(modncfio.o):modncfio.F90:(.text+0xbb050): first defined here
/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort/libnetcdff.a(nf_var1io.o): In function nf_get_var1_int64_': /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/netcdf-fortran-4.5.1/fortran/nf_var1io.F90:784: multiple definition ofnf_get_var1_int64_’
/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort/libioapi.a(modncfio.o):modncfio.F90:(.text+0xbb070): first defined here
/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort/libnetcdff.a(nf_varaio.o): In function nf_put_vara_int64_': /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/netcdf-fortran-4.5.1/fortran/nf_varaio.F90:440: multiple definition ofnf_put_vara_int64_’
/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort/libioapi.a(modncfio.o):modncfio.F90:(.text+0xbb0b0): first defined here

/usr/bin/ld: /home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/Linux2_x86_64gfort/libhdf5.a(H5PLint.o): undefined reference to symbol ‘dlclose@@GLIBC_2.2.5

//usr/lib64/libdl.so.2: error adding symbols: DSO missing from command line

collect2: error: ld returned 1 exit status

make[1]: *** [airs2m3] Error 1

make[1]: Leaving directory `/home/somedir/cmaq_user/softwares/cmaq_libsgcc9.2.0/ioapi-3.2/m3tools’

make: *** [all] Error 2

NCFLIBS = -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz

Dear CMAQ_user,

Please do not add to another person’s resolved post. Create a new issue, and post this comment there.
Regarding building the netcdf and ioapi libraries - please follow the instructions here:
Building with intel compiler:


Building with gcc compiler:

sorry for that. But, the method doesn’t work! I have created another topic (https://forum.cmascenter.org/t/installing-netcdf-classic-for-cmaq-isnt-working/941)
Thank you.