Bcon compilation

Hello,

I am trying to compile CMAQv5.2.1 benchmark, while building bcon, I get the following error, any clue to fix this highly appreciated.
MMS

terp.o -L/home/cmaq/T1/CMAQ_REPO/lib/x86_64/pgi/ioapi/lib -lioapi -L/home/cmaq/T1/CMAQ_REPO/lib/x86_64/pgi/netcdf/lib -lnetcdf -lnetcdff -o BCON_v52_profile.exe
/usr/bin/ld: cannot find -lnetcdff
Makefile:83: recipe for target ‘BCON_v52_profile.exe’ failed
make: *** [BCON_v52_profile.exe] Error 2
ERROR while running make command

FORTRAN STOP

Please take a look at Issue CMAQv5.2.1-i2 on the Known Issues page for v5.2.1 and let us know if the fix that is provided is able to resolve the error.

The issue I think you’re having does not seem to be properly reflected on the CMAQ “known issues” page;
instead, see the I/O API Installation Notes (https://cjcoats.github.io/ioapi/AVAIL.html#ncf4 or https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#ncf4):

…NetCDF Version 4.1 and later also split the Fortran interfaces into a separate library libnetcdff.a As a result, much compatiblity with the infrastructure (Makefiles, etc.) is broken: you must modify all Makefiles, replacing -lnetcdf with lnetcdff -lnetcdf

Carlie J. Coats, Jr., Ph.D. I/O API Author/Maintainer

@cjcoats Please, below is the response I got while trying to configure CMAQ:

ERROR: /home/catalyst/Desktop/Build_WRF/CMAQ-5.2.1/lib/x86_64/gcc/netcdf/lib/libnetcdf.a does not exist in your CMAQ_LIB directorysource config_cmaq.csh gcc! Check your installation before proceeding with CMAQ build.

Also, while compiling ICON and BCON:
rm: No match.
mpif90: Command not found.
mpif90: Command not found.
mpif90: Command not found.
mpif90: Command not found.
mpif90: No match.

ERROR BLDMAKE Compile failed

Kindly help, please.

You are missing required software that is required to build the code.
Please check with your system administrators.

If you are running on a linux server that has a module load command you may need to use

module avail

To determine what modules to load on your server to allow you to find the mpif90 command.

If you do not have system administrators, and need to install the software on your linux system on your own, you can try following these instructions.

Thanks for your response. But the problems still persist after installing netcdf-c-4.6.3 and netcdf-fortran-4.4.4 following your instructions.
The I/O API Version 3.2 couldn’t be installed on my system too. My system’s linux version is ‘‘x86_64-linux-gnu’’ and is not listed among the versions compatible with the I/0 API.

source config_cmaq.csh gcc 7.3.0
Compiler is set to gcc
ERROR: /home/catalyst/Desktop/Build_WRF/CMAQ-5.2.1/lib/x86_64/gcc7.3.0/netcdf/lib/libnetcdf.a does not exist in your CMAQ_LIB directorysource config_cmaq.csh gcc 7.3.0! Check your installation before proceeding with CMAQ build.

I’ll appreciate your further help. Thanks.

Did you follow the I/O API installation instructions, from the I/O API manual?

See https://cjcoats.github.io/ioapi/AVAIL.html#build

What you probably want is BIN=Linux2_x86_64gfort

Carlie J. Coats, Jr., Ph.D. I/O API Author/Maintainer
Senior Software Engineer cjcoats@email.unc.edu
UNC Institute for the Environment www.ie.unc.edu
100 Europa Dr., Suite 490 / Campus Box 1105 Tel 919.843.5951
Chapel Hill, NC 27599-1105 Fax 919.966.9920

Below is what I got:

Makefile:95: home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/ioapi/Makeinclude.Linux2_x86_64gfort: No such file or directory
make: *** No rule to make target ‘home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/ioapi/Makeinclude.Linux2_x86_64gfort’. Stop.

Hello Lizadams,
This is what I got:
catalyst-Precision-Tower-3620:~/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/ioapi% make
cd /home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/Linux2_x86_64gfort; ar rsv libioapi.a m3utilio.o modgctp.o modwrfio.o modmpasfio.o modatts3.o modncfio.o modpdata.o
/bin/sh: 1: cd: can’t cd to /home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/Linux2_x86_64gfort
r - m3utilio.o
r - modgctp.o
r - modwrfio.o
r - modmpasfio.o
r - modatts3.o
r - modncfio.o
r - modpdata.o
cd /home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/Linux2_x86_64gfort; ar rsv libioapi.a bilin.o bmatvec.o chkbuf3.o ckdesc3.o ckfile3.o ckgeom.o ckname.o crtbuf3.o currstep.o dble2real.o dbllist.o dmatvec.o dscgrid.o dt2str.o filchk3.o find1.o find2.o find3.o find4.o findc.o findr1.o findr2.o findr3.o findr4.o flush3.o gcd.o gctp.o getdble.o getmenu.o getnum.o getreal.o getstr.o getyn.o grdchk3.o gridops.o hhmmss.o index1.o initblk3.o intg2real.o intlist.o ioparms3.o lambert.o lblank.o len2.o ll2utm.o locat1.o locat2.o locat3.o locat4.o locatc.o locatr1.o locatr2.o locatr3.o locatr4.o lustr.o m3warn.o name2fid.o pcoef.o pgrdsum.o pmatvec.o poly.o promptdfile.o promptffile.o promptgrid.o promptmfile.o rdbndary.o rdbuf3.o rdcustom.o rdgrdded.o readsmet.o realist.o scanint.o setsphere.o sec2time.o str2dble.o skipl.o smatvec.o splitline.o str2int.o str2real.o strlist.o synchtao.o time2sec.o trimlen.o ungridb.o ungridi.o upcase.o utm2ll.o wrbndary.o wrbuf3.o wrcustom.o wrgrdded.o xtbuf3.o year4.o chkfil3.o cktflag3.o crdict3.o crtkf.o kfindx.o kfopen.o m3abort.o modgctp.o opnlist3.o rddict3.o rdiddata.o rdsmatrx.o runspec.o sync3.o wrdict3.o wriddata.o wrsmatrx.o xtract3.o
/bin/sh: 1: cd: can’t cd to /home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/Linux2_x86_64gfort
r - bilin.o
r - bmatvec.o
r - chkbuf3.o
r - ckdesc3.o
r - ckfile3.o
r - ckgeom.o
r - ckname.o
r - crtbuf3.o
r - currstep.o
r - dble2real.o
r - dbllist.o
r - dmatvec.o
r - dscgrid.o
r - dt2str.o
r - filchk3.o
r - find1.o
r - find2.o
r - find3.o
r - find4.o
r - findc.o
r - findr1.o
r - findr2.o
r - findr3.o
r - findr4.o
r - flush3.o
r - gcd.o
r - gctp.o
r - getdble.o
r - getmenu.o
r - getnum.o
r - getreal.o
r - getstr.o
r - getyn.o
r - grdchk3.o
r - gridops.o
r - hhmmss.o
r - index1.o
r - initblk3.o
r - intg2real.o
r - intlist.o
r - ioparms3.o
r - lambert.o
r - lblank.o
r - len2.o
r - ll2utm.o
r - locat1.o
r - locat2.o
r - locat3.o
r - locat4.o
r - locatc.o
r - locatr1.o
r - locatr2.o
r - locatr3.o
r - locatr4.o
r - lustr.o
r - m3warn.o
r - name2fid.o
r - pcoef.o
r - pgrdsum.o
r - pmatvec.o
r - poly.o
r - promptdfile.o
r - promptffile.o
r - promptgrid.o
r - promptmfile.o
r - rdbndary.o
r - rdbuf3.o
r - rdcustom.o
r - rdgrdded.o
r - readsmet.o
r - realist.o
r - scanint.o
r - setsphere.o
r - sec2time.o
r - str2dble.o
r - skipl.o
r - smatvec.o
r - splitline.o
r - str2int.o
r - str2real.o
r - strlist.o
r - synchtao.o
r - time2sec.o
r - trimlen.o
r - ungridb.o
r - ungridi.o
r - upcase.o
r - utm2ll.o
r - wrbndary.o
r - wrbuf3.o
r - wrcustom.o
r - wrgrdded.o
r - xtbuf3.o
r - year4.o
r - chkfil3.o
r - cktflag3.o
r - crdict3.o
r - crtkf.o
r - kfindx.o
r - kfopen.o
r - m3abort.o
r - modgctp.o
r - opnlist3.o
r - rddict3.o
r - rdiddata.o
r - rdsmatrx.o
r - runspec.o
r - sync3.o
r - wrdict3.o
r - wriddata.o
r - wrsmatrx.o
r - xtract3.o
cd /home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/Linux2_x86_64gfort; ar rsv libioapi.a cbarnes1.o cbarnesN.o check3.o crlf.o currec.o daymon.o ddtvar3.o ddtvar3v.o getdate.o getdfile.o getefile.o getffile.o initlog3.o interp3.o isdstime.o jstep3.o julian.o junit.o m3err.o m3exit.o m3msg2.o mmddyy.o nextime.o read3.o read4d.o secsdiff.o wkday.o write3.o write4d.o yr2day.o close3.o crtfil3.o desc3.o init3.o inqatt3.o kfread.o kfwrite.o open3.o opnfil3.o opnkf.o opnlog3.o pn_crtfil3.o pn_opnfil3.o pn_wrvars.o rdatt3.o rdgrnest.o rdprofil.o rdtflag.o rdvars.o shut3.o syncfid.o wratt3.o wrgrnest.o wrmpigrd.o wrpatch.o wrprofil.o wrtflag.o wrvars.o
/bin/sh: 1: cd: can’t cd to /home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/Linux2_x86_64gfort
r - cbarnes1.o
r - cbarnesN.o
r - check3.o
r - crlf.o
r - currec.o
r - daymon.o
r - ddtvar3.o
r - ddtvar3v.o
r - getdate.o
r - getdfile.o
r - getefile.o
r - getffile.o
r - initlog3.o
r - interp3.o
r - isdstime.o
r - jstep3.o
r - julian.o
r - junit.o
r - m3err.o
r - m3exit.o
r - m3msg2.o
r - mmddyy.o
r - nextime.o
r - read3.o
r - read4d.o
r - secsdiff.o
r - wkday.o
r - write3.o
r - write4d.o
r - yr2day.o
r - close3.o
r - crtfil3.o
r - desc3.o
r - init3.o
r - inqatt3.o
r - kfread.o
r - kfwrite.o
r - open3.o
r - opnfil3.o
r - opnkf.o
r - opnlog3.o
r - pn_crtfil3.o
r - pn_opnfil3.o
r - pn_wrvars.o
r - rdatt3.o
r - rdgrnest.o
r - rdprofil.o
r - rdtflag.o
r - rdvars.o
r - shut3.o
r - syncfid.o
r - wratt3.o
r - wrgrnest.o
r - wrmpigrd.o
r - wrpatch.o
r - wrprofil.o
r - wrtflag.o
r - wrvars.o
cd /home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/Linux2_x86_64gfort; ar rsv libioapi.a bufint3.o check3c.o close3c.o currstepc.o daymonc.o ddtvar3c.o desc3c.o dscgridc.o dt2strc.o envgets.o filchk3c.o findsc.o get_endian.o getdfilec.o getdttime.o getefilec.o hhmmssc.o init3c.o inqatt3c.o interp3c.o iobin3.o julianc.o locatsc.o m3errc.o m3exitc.o m3mesgc.o m3warnc.o mmddyyc.o nameval.o nextimec.o open3c.o rdatt3c.o read3c.o read4dc.o rmfile.o sec2timec.o secsdiffc.o shut3c.o sleep3.o sortic.o sortir.o sortis.o sync3c.o systemf.o time2secc.o wkdayc.o wratt3c.o write3c.o write4dc.o xtract3c.o iocpl.o iocplf2c.o
/bin/sh: 1: cd: can’t cd to /home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/Linux2_x86_64gfort
r - bufint3.o
r - check3c.o
r - close3c.o
r - currstepc.o
r - daymonc.o
r - ddtvar3c.o
r - desc3c.o
r - dscgridc.o
r - dt2strc.o
r - envgets.o
r - filchk3c.o
r - findsc.o
r - get_endian.o
r - getdfilec.o
r - getdttime.o
r - getefilec.o
r - hhmmssc.o
r - init3c.o
r - inqatt3c.o
r - interp3c.o
r - iobin3.o
r - julianc.o
r - locatsc.o
r - m3errc.o
r - m3exitc.o
r - m3mesgc.o
r - m3warnc.o
r - mmddyyc.o
r - nameval.o
r - nextimec.o
r - open3c.o
r - rdatt3c.o
r - read3c.o
r - read4dc.o
r - rmfile.o
r - sec2timec.o
r - secsdiffc.o
r - shut3c.o
r - sleep3.o
r - sortic.o
r - sortir.o
r - sortis.o
r - sync3c.o
r - systemf.o
r - time2secc.o
r - wkdayc.o
r - wratt3c.o
r - write3c.o
r - write4dc.o
r - xtract3c.o
r - iocpl.o
r - iocplf2c.o
catalyst-Precision-Tower-3620:~/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/ioapi%

In the README.txt that comes with the ioapi version 3.2, is step 4 to make the directory where the executable files will be created.

mkdir $BASEDIR/$BIN

I believe that you missed this step, and that is why you are getting the following message:

/bin/sh: 1: cd: can’t cd to /home/catalyst/Desktop/Build_WRF/LIBRARIES/ioapi-3.2/Linux2_x86_64gfort

Thanks for your response. The whole procedure is confusing. Can you please summarize the steps for me? Thanks a lot.

Hello lizadams,
Thanks a lot, I’ve been able to install ioapi and CMAQ as well. However, I’m still having issues with MCIP compilation. Below is what I got:

make[1]: Entering directory ‘/home/catalyst/Desktop/Build_WRF/CMAQ-5.2/PREP/mcip/src’
make[1]: ‘const_mod.o’ is up to date.
make[1]: ‘const_pbl_mod.o’ is up to date.
make[1]: ‘coord_mod.o’ is up to date.
make[1]: ‘date_time_mod.o’ is up to date.
make[1]: ‘date_pack_mod.o’ is up to date.
make[1]: ‘files_mod.o’ is up to date.
make[1]: ‘groutcom_mod.o’ is up to date.
make[1]: ‘luvars_mod.o’ is up to date.
gfortran -ffree-form -ffree-line-length-none -funroll-loops -finit-character=32 -I/home/catalyst/Desktop/Build_WRF/CMAQ-5.2/lib/x86_64/gcc7.3.0/netcdf/include -I/home/catalyst/Desktop/Build_WRF/CMAQ-5.2/lib/x86_64/gcc7.3.0/ioapi/include -c mcipparm_mod.f90
mcipparm_mod.f90:126:6:

USE m3utilio, ONLY: mxdesc3
1
Fatal Error: Can’t open module file ‘m3utilio.mod’ for reading at (1): No such file or directory
compilation terminated.
Makefile:136: recipe for target ‘mcipparm_mod.o’ failed
make[1]: *** [mcipparm_mod.o] Error 1
make[1]: Leaving directory ‘/home/catalyst/Desktop/Build_WRF/CMAQ-5.2/PREP/mcip/src’
Makefile:127: recipe for target ‘all’ failed
make: *** [all] Error 2

Kindly help me out. Thanks.

Catalyst

Please verify the location of the m3utilio.mod file. Once you have found it’s location use that path in your Makefile, after the -I
for instance, my version is available here:

ls /proj/ie/proj/staff/lizadams/ioapi-3.2/Linux3_x86_64_openmpi_3.0.0_gcc_6.3.0/*.mod
/proj/ie/proj/staff/lizadams/ioapi-3.2/Linux3_x86_64_openmpi_3.0.0_gcc_6.3.0/m3utilio.mod

for example I used the following setting in my Makefile

NETCDF = /proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0
IOAPI_ROOT = /proj/ie/proj/staff/lizadams/ioapi-3.2/Linux3_x86_64_openmpi_3.0.0_gcc_6.3.0
FFLAGS  = -m64 -O3 -I$(NETCDF)/include -I$(IOAPI_ROOT)