# IOAPI 3.2 installation

**URL:** <https://forum.cmascenter.org/t/ioapi-3-2-installation/914>\
**Category:** I/O API\
**Created:** [September 5, 2019, 6:49pm UTC](https://forum.cmascenter.org/t/ioapi-3-2-installation/914 "2019-09-05T18:49:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![huangj1311](https://avatars.discourse-cdn.com/v4/letter/h/8edcca/32.png) [@huangj1311](https://forum.cmascenter.org/u/huangj1311)\
**Post date:** [September 5, 2019, 6:49pm UTC](https://forum.cmascenter.org/t/ioapi-3-2-installation/914/1 "2019-09-05T18:49:28Z")

</div>

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

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/1X/b1b819caf95e0b1ce39ed3a5d3f4747965b42678.png)  
Detailed error messages can be found:  

> <https://github.com/JiaoyanHuang/Testing-codes/blob/master/IOAPI3.2_make.log>

Any suggestion will be helpful,

Thank you  
Joey Huang

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [September 5, 2019, 7:51pm UTC](https://forum.cmascenter.org/t/ioapi-3-2-installation/914/2 "2019-09-05T19:51:03Z")

</div>

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

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

```

to

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

```

---

<div class="post-metadata">

**Author:** ![huangj1311](https://avatars.discourse-cdn.com/v4/letter/h/8edcca/32.png) [@huangj1311](https://forum.cmascenter.org/u/huangj1311)\
**Post date:** [September 5, 2019, 8:10pm UTC](https://forum.cmascenter.org/t/ioapi-3-2-installation/914/3 "2019-09-05T20:10:49Z")

</div>

Liz,

It works.

Thank you!  
Joey

---

<div class="post-metadata">

**Author:** ![CMAQ\_user](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@CMAQ\_user](https://forum.cmascenter.org/u/CMAQ_user)\
**Post date:** [September 11, 2019, 8:20pm UTC](https://forum.cmascenter.org/t/ioapi-3-2-installation/914/4 "2019-09-11T20:20:26Z")

</div>

###### 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 of`nf\_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 of`nf\_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 of`nf\_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

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [September 12, 2019, 2:22pm UTC](https://forum.cmascenter.org/t/ioapi-3-2-installation/914/5 "2019-09-12T14:22:09Z")

</div>

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:

> <https://github.com/USEPA/CMAQ/blob/master/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_build_library_intel.md>

  
Building with gcc compiler:  

> <https://github.com/USEPA/CMAQ/blob/master/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_build_library_gcc.md>

---

<div class="post-metadata">

**Author:** ![CMAQ\_user](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@CMAQ\_user](https://forum.cmascenter.org/u/CMAQ_user)\
**Post date:** [September 13, 2019, 9:04pm UTC](https://forum.cmascenter.org/t/ioapi-3-2-installation/914/6 "2019-09-13T21:04:07Z")

</div>

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](https://forum.cmascenter.org/t/installing-netcdf-classic-for-cmaq-isnt-working/941))  
Thank you.
