# CCTM compilation

**URL:** <https://forum.cmascenter.org/t/cctm-compilation/594>\
**Category:** CMAQ\
**Created:** [April 2, 2019, 4:44pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594 "2019-04-02T16:44:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maria](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Maria](https://forum.cmascenter.org/u/Maria)\
**Post date:** [April 2, 2019, 4:44pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/1 "2019-04-02T16:44:24Z")

</div>

Hi all

I am trying to compile CCTM but an error comes up:

mpiifort -qopenmp se\_bndy\_copy\_info\_ext.o se\_pe\_info\_ext.o se\_comm\_info\_ext.o se\_data\_send\_module.o se\_domain\_info\_ext.o se\_internal\_util\_module.o se\_data\_recv\_module.o se\_disp\_info\_ext.o se\_subgrid\_info\_ext.o se\_global\_sum\_module.o se\_global\_max\_module.o se\_global\_min\_module.o se\_slice\_module.o se\_init\_module.o se\_bndy\_copy\_module.o se\_comm\_module.o se\_reconfig\_grid\_info\_ext.o se\_reconfig\_grid\_module.o se\_gather\_module.o se\_data\_copy\_module.o se\_term\_module.o se\_twoway\_comm\_module.o se\_util\_module.o se\_modules.o swap\_sandia.o swap\_sandia\_routines.o alloc\_data\_mod.o pinterpb\_mod.o parutilio.o piomaps\_mod.o boundary.o get\_write\_map.o growbuf.o gtndxhdv.o interpol.o pinterpb.o pio\_init.o pm3err.o pm3exit.o pm3warn.o pshut3.o ptrwrite3.o pwrgrdd.o pwrite3.o readbndy.o subdmap.o wrsubdmap.o UTILIO\_DEFN.o HGRD\_DEFN.o VGRD\_DEFN.o GRID\_CONF.o CGRID\_SPCS.o PA\_DEFN.o PCGRID\_DEFN.o AVG\_CONC.o DEPVVARS.o BIDI\_MOD.o LSM\_MOD.o ASX\_DATA\_MOD.o HGSIM.o MOSAIC\_MOD.o RXNS\_DATA\_MODULE.o BIOG\_EMIS.o BEIS\_DEFN.o LUS\_DEFN.o LTNG\_DEFN.o AEROMET\_DATA.o AERO\_DATA.o UDTYPES.o STK\_EMIS.o STK\_PRMS.o PTMAP.o PTBILIN.o SSEMIS.o bmatvec.o PTMET.o DEPV\_DEFN.o STD\_CONC.o CSQY\_DATA.o CLOUD\_OPTICS.o PHOT\_MET\_DATA.o DUST\_EMIS.o RXNS\_FUNC\_MODULE.o PRECURSOR\_DATA.o MGEMIS.o PT3D\_DEFN.o SOA\_DEFN.o AERO\_EMIS.o AEROSOL\_CHEMISTRY.o PAGRD\_DEFN.o EMIS\_DEFN.o WVEL\_DEFN.o distr\_env.o mpcomm\_init.o advstep.o driver.o hveloc.o sciproc.o wr\_aconc.o wr\_cgrid.o wr\_conc.o wr\_init.o diffmsg.o flcheck.o grdcheck.o initscen.o load\_cgrid.o opaconc.o opconc.o couplewrf.o advbc\_map.o hadvyppm.o hcontvel.o hppm.o rdbcon.o x\_ppm.o x\_yamo.o y\_ppm.o y\_yamo.o zfdbc.o vppm.o zadvppmwrf.o deform.o hcdiff3d.o hdiff.o rho\_j.o VDIFF\_DIAG.o VDIFF\_MAP.o SEDIMENTATION.o aero\_sedv.o conv\_cgrid.o eddyx.o matrix1.o opddep.o opddep\_fst.o opddep\_mos.o rddepv.o tri.o vdiffacmx.o vdiffproc.o ABFLUX\_MOD.o cgrid\_depv.o gas\_depv\_map.o m3dry.o opdepv\_diag.o opdepv\_fst.o opdepv\_mos.o cropcal.o opemis.o tfabove.o tfbelow.o beis3.o checkmem.o chkgrid.o czangle.o getfline.o getparb.o hrno.o parsline.o tmpbeis.o wrdaymsg.o delta\_zs.o fire\_plmris.o openlayout.o oppt3d\_diag.o plmris.o plsprd.o preplm.o ungridb2.o write3\_distr.o complex\_number\_module.o twoway\_rrtmg\_aero\_optics.o AERO\_PHOTDATA.o PHOT\_MOD.o SEAS\_STRAT\_O3\_MIN.o PHOTOLYSIS\_ALBEDO.o o3totcol.o opphot.o phot.o DEGRADE\_SETUP\_TOX.o hrdata\_mod.o degrade\_data.o degrade.o final\_degrade.o find\_degraded.o hrdriver.o hrg1.o hrg2.o hrg3.o hrg4.o hrinit.o hrprodloss.o hrrates.o hrsolver.o init\_degrade.o AOD\_DEFN.o PMDIAG\_DATA.o aero\_depv.o aero\_driver.o aero\_subs.o coags.o getpar.o isocom.o isofwd.o isorev.o opapmdiag.o opavis.o oppmdiag.o opvis.o AQ\_DATA.o acmcld.o aqchem.o aq\_map.o cldproc\_acm.o convcld\_acm.o getalpha.o hlconst.o indexn.o opwdep.o rescld.o scavwdep.o PA\_GLOBAL.o PA\_IPRDEF.o PA\_VARS.o PA\_PARSE.o PA\_IPRVARS.o pa\_compmech.o pa\_datagen.o pa\_errcheck.o pa\_getcoef.o pa\_getcycle.o pa\_getdesc.o pa\_getfamily.o pa\_getiprout.o pa\_getirrout.o pa\_getrxns.o pa\_getrxnsum.o pa\_init.o pa\_irr\_ctl.o pa\_irr.o pa\_mkhdr.o pa\_molcloss.o pa\_molcprod.o pa\_output.o pa\_read.o pa\_report.o pa\_setup\_ipr.o pa\_setup\_irr.o pa\_update.o pa\_wrtpadefn.o cksummer.o findex.o get\_envlist.o lstepf.o setup\_logdev.o subhdomain.o subhfile.o -L/media/maria/Backup/CMAQ\_Project/PREP/mcip/src/lib/x86\_64/intel/ioapi/lib -lioapi -L/media/maria/Backup/CMAQ\_Project/PREP/mcip/src/lib/x86\_64/intel/netcdf/lib -lnetcdff -lnetcdf -L/media/maria/Backup/CMAQ\_Project/PREP/mcip/src/lib/x86\_64/intel/mpi/lib -lcurl -o CCTM\_v52.exe  
/media/maria/Backup/intel/compilers\_and\_libraries\_2019.3.199/linux/mpi/intel64/lib/libmpifort.so: undefined reference to `PMPI\_Aint\_diff’

I am not a specialist about compilers or programming. I was searching on Internet a possible solution, however I didn’t find anything about it.

Do you have any idea?  
Appreciate your help

Maria

---

<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:** [April 2, 2019, 7:16pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/2 "2019-04-02T19:16:36Z")

</div>

Hi Maria,

It may be something as simple of adding -lmpi to your config\_cmaq.csh

config\_cmaq.csh: setenv mpi\_lib “-lmpi”

If this doesn’t work, please send the following information:  
If you are using modules on a compute server, please use the module list command to see what compiler is loaded:

```auto
module list 

```

If not, use the command `which mpiifort` to reveal what compiler you are using:

```auto
which mpiifort

```

---

<div class="post-metadata">

**Author:** ![Maria](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Maria](https://forum.cmascenter.org/u/Maria)\
**Post date:** [April 2, 2019, 8:57pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/3 "2019-04-02T20:57:58Z")

</div>

Thank you for your reply.  
I applied the change that you suggested in my config\_cmaq.csh, but it didn’t work.

When I typed “which mpiifort” the result is:

/media/maria/Backup/intel/compilers\_and\_libraries\_2019.3.199/linux/mpi/intel64/bin/mpiifort

Then, I decided to change the path in:  
config\_cmaq.csh: setenv MPI\_LIB\_DIR

But a new error comes up:  
distr\_env.c:(.text+0x156): undefined reference to `ompi\_mpi\_int’

So, I suppose that the change is not in the correct environment variable. Do I have to change the path in other place?

Maria

---

<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:** [April 3, 2019, 10:20pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/4 "2019-04-03T22:20:38Z")

</div>

Hi Maria,

Please try adding the following environment variable to your config\_cmaq.csh  
under the section  
case intel:

```auto
setenv myLINK_FLAG "-qopenmp"

```

Liz

---

<div class="post-metadata">

**Author:** ![Maria](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Maria](https://forum.cmascenter.org/u/Maria)\
**Post date:** [April 4, 2019, 9:10pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/5 "2019-04-04T21:10:30Z")

</div>

Hi Liz

In my current config\_cmaq.csh file, I have that environment variable but the error persists:

setenv IOAPI\_MOD\_DIR /media/maria/Backup/IOAPI3.1/Linux2\_x86\_64ifort/ #\> I/O API precompiled modules  
setenv IOAPI\_INCL\_DIR /media/maria/Backup/IOAPI3.1/Linux2\_x86\_64ifort/ #\> I/O API include header files  
setenv IOAPI\_LIB\_DIR /media/maria/Backup/IOAPI3.1/Linux2\_x86\_64ifort/ #\> I/O API libraries  
setenv NETCDF\_LIB\_DIR /media/maria/Backup/netcdf-4.1.3/netcdf/lib/ #\> netCDF directory path  
setenv NETCDF\_INCL\_DIR /media/maria/Backup/netcdf-4.1.3/netcdf/include/ #\> netCDF directory path  
setenv MPI\_LIB\_DIR /home/maria/Escritorio/openmpi-3.1.1/ #\> MPI directory path

```
    #> Compiler Aliases and Flags
    setenv myFC mpiifort
    setenv myCC icc       
    setenv myFSTD "-O3 -fno-alias -mp1 -fp-model source"
    setenv myDBG "-O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback"
    setenv myLINK_FLAG "-qopenmp"
    setenv myFFLAGS "-fixed -132"
    setenv myFRFLAGS "-free"
    setenv myCFLAGS "-O2"
    setenv extra_lib "-lcurl"
    #setenv extra_lib ""
    setenv mpi_lib "" 

```

I really appreciate your help

Maria

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [April 5, 2019, 9:35am UTC](https://forum.cmascenter.org/t/cctm-compilation/594/6 "2019-04-05T09:35:23Z")

</div>

@lizadams Hello

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.

---

<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:** [April 5, 2019, 12:56pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/7 "2019-04-05T12:56:55Z")

</div>

Please use the following instructions to install the required software.

> <https://github.com/USEPA/CMAQ/blob/5.2.1/DOCS/Tutorials/CMAQ_GettingStarted.md>

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [April 5, 2019, 4:23pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/8 "2019-04-05T16:23:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [April 6, 2019, 8:29am UTC](https://forum.cmascenter.org/t/cctm-compilation/594/9 "2019-04-06T08:29:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [April 6, 2019, 3:20pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/10 "2019-04-06T15:20:45Z")

</div>

Where did you get this ioapi-3.2/ioapi/ ? Going to the CMAS web-server, I see:  
_longleaf:download % tar tfz ioapi-3.2.tar.gz | grep gfort_  
_ioapi/Makeinclude.Linux2\_x86\_64gfort\_360_  
_ioapi/Makeinclude.Linux2\_x86\_64gfort_  
_ioapi/Makeinclude.WIN\_x86\_64gfort\_medium_  
_ioapi/Makeinclude.Linux2\_ia64gfort_  
_ioapi/Makeinclude.Linux2\_x86\_64gfort\_365_  
_ioapi/Makeinclude.Linux2\_x86\_64gfortmpi_  
_ioapi/Makeinclude.OSX\_x86\_gfortran_  
_ioapi/Makeinclude.Linux2\_x86\_64gfort\_medium_  
_ioapi/Makeinclude.Linux2\_x86\_64gfortdbg_  
_ioapi/Makeinclude.WIN\_x86gfort_  
_ioapi/Makeinclude.WIN\_x86\_64gfort_

and similarly on the GitHub server… You **did** follow the I/O API installation instructions _[https://cjcoats.github.io/ioapi/AVAIL.html#build](https://cjcoats.github.io/ioapi/AVAIL.html#build)_ didn’t you?

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [May 1, 2019, 6:24pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/11 "2019-05-01T18:24:51Z")

</div>

Hello,

Below is what I got while building CCTM:

gfortran -c -ffixed-form -ffixed-line-length-132 -funroll-loops -finit-character=32 -O3 -funroll-loops -finit-character=32 -Wtabs -Wsurprising -I /home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/ioapi/modules -I /home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/ioapi/include\_files -I /home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/mpi -I. pinterpb.f  
STATE3.EXT:174:27:

Error: Syntax error in COMMON statement at (1)  
STATE3.EXT:191:27:

Error: Syntax error in COMMON statement at (1)  
Makefile:414: recipe for target ‘pinterpb.o’ failed  
make: \*\*\* [pinterpb.o] Error 1  
**ERROR** while running make command

else if ( 0 ) then  
endif  
mv Makefile Makefile.gcc7.3.0  
if ( -e Makefile.gcc7.3.0 && -e Makefile ) rm Makefile  
ln -s Makefile.gcc7.3.0 Makefile  
if ( 0 != 0 ) then  
if ( -e /home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/CCTM/scripts/BLD\_CCTM\_v52\_gcc7.3.0/CCTM\_v52.cfg ) then  
mv CCTM\_v52.cfg.bld /home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/CCTM/scripts/BLD\_CCTM\_v52\_gcc7.3.0/CCTM\_v52.cfg  
exit

Please, help me out as usual. Thanks a lot.

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [May 2, 2019, 1:09pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/12 "2019-05-02T13:09:22Z")

</div>

See [https://www.cmascenter.org/ioapi/documentation/all\_versions/html/AVAIL.html#cmaq](https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#cmaq)

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [May 2, 2019, 5:02pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/13 "2019-05-02T17:02:16Z")

</div>

Still on CCTM, kindly assist me. Thanks.

driver.o: In function `MAIN__': driver.F:(.text+0x11e3): undefined reference to`mpi\_wtime\_’  
driver.F:(.text+0x1283): undefined reference to `mpi_finalize_' se_data_send_module.o: In function`_se\_data\_send\_module\_MOD\_se\_5d\_data\_send’:  
se\_data\_send\_module.f:(.text+0x4e7): undefined reference to `mpi_send_' se_data_send_module.f:(.text+0x55b): undefined reference to`mpi\_send’  
se\_data\_send\_module.f:(.text+0x5c7): undefined reference to `mpi_send_' se_data_send_module.o: In function`se\_data\_send\_module\_MOD\_se\_4de\_data\_send’:  
se\_data\_send\_module.f:(.text+0x76a): undefined reference to `mpi_send_' se_data_send_module.o: In function`se\_data\_send\_module\_MOD\_se\_4d\_data\_send’:  
se\_data\_send\_module.f:(.text+0xe8b): undefined reference to `mpi_send_' se_data_send_module.o:se_data_send_module.f:(.text+0xf03): more undefined references to`mpi\_send’ follow  
se\_internal\_util\_module.o: In function `__se_internal_util_module_MOD_se_generate_map': se_internal_util_module.f:(.text+0xe45): undefined reference to`mpi\_gather’  
se\_internal\_util\_module.f:(.text+0xe78): undefined reference to `mpi_bcast_' se_data_recv_module.o: In function`se\_data\_recv\_module\_MOD\_se\_5d\_data\_recv’:  
se\_data\_recv\_module.f:(.text+0x1ad): undefined reference to `mpi_recv_' se_data_recv_module.o: In function`se\_data\_recv\_module\_MOD\_se\_4de\_data\_recv’:  
se\_data\_recv\_module.f:(.text+0x725): undefined reference to `mpi_recv_' se_data_recv_module.f:(.text+0xa6b): undefined reference to`mpi\_recv’  
se\_data\_recv\_module.o: In function `__se_data_recv_module_MOD_se_4d_data_recv': se_data_recv_module.f:(.text+0xc26): undefined reference to`mpi\_recv’  
se\_data\_recv\_module.o: In function `__se_data_recv_module_MOD_se_3de_data_recv': se_data_recv_module.f:(.text+0x1077): undefined reference to`mpi\_recv’  
se\_data\_recv\_module.o:se\_data\_recv\_module.f:(.text+0x1389): more undefined references to `mpi_recv_' follow se_global_sum_module.o: In function`se\_global\_sum\_module\_MOD\_se\_global\_rasum’:  
se\_global\_sum\_module.f:(.text+0xfb): undefined reference to `mpi_reduce_' se_global_sum_module.f:(.text+0x2a1): undefined reference to`mpi\_bcast’  
se\_global\_sum\_module.o: In function `__se_global_sum_module_MOD_se_global_iasum': se_global_sum_module.f:(.text+0x3dc): undefined reference to`mpi\_reduce’  
se\_global\_sum\_module.f:(.text+0x53d): undefined reference to `mpi_bcast_' se_global_sum_module.o: In function`se\_global\_sum\_module\_MOD\_se\_global\_rsum’:  
se\_global\_sum\_module.f:(.text+0x5b7): undefined reference to `mpi_reduce_' se_global_sum_module.f:(.text+0x5fa): undefined reference to`mpi\_bcast’  
se\_global\_sum\_module.o: In function `__se_global_sum_module_MOD_se_global_isum': se_global_sum_module.f:(.text+0x647): undefined reference to`mpi\_reduce’  
se\_global\_sum\_module.f:(.text+0x686): undefined reference to `mpi_bcast_' se_global_max_module.o: In function`se\_global\_max\_module\_MOD\_se\_global\_rmax’:  
se\_global\_max\_module.f:(.text+0x3a): undefined reference to `mpi_reduce_' se_global_max_module.f:(.text+0x5f): undefined reference to`mpi\_bcast’  
se\_global\_max\_module.o: In function `__se_global_max_module_MOD_se_global_imax': se_global_max_module.f:(.text+0xba): undefined reference to`mpi\_reduce’  
se\_global\_max\_module.f:(.text+0xdf): undefined reference to `mpi_bcast_' se_global_min_module.o: In function`se\_global\_min\_module\_MOD\_se\_global\_rmin’:  
se\_global\_min\_module.f:(.text+0x3e): undefined reference to `mpi_reduce_' se_global_min_module.f:(.text+0x63): undefined reference to`mpi\_bcast’  
se\_global\_min\_module.o: In function `__se_global_min_module_MOD_se_global_imin': se_global_min_module.f:(.text+0xbe): undefined reference to`mpi\_reduce’  
se\_global\_min\_module.f:(.text+0xe3): undefined reference to `mpi_bcast_' se_slice_module.o: In function`se\_slice\_module\_MOD\_se\_slice4r’:  
se\_slice\_module.f:(.text+0x45c): undefined reference to `mpi_recv_' se_slice_module.f:(.text+0xa2a): undefined reference to`mpi\_send’  
se\_slice\_module.o: In function `__se_slice_module_MOD_se_slice4i': se_slice_module.f:(.text+0xfac): undefined reference to`mpi\_recv’  
se\_slice\_module.f:(.text+0x14d8): undefined reference to `mpi_send_' se_slice_module.o: In function`se\_slice\_module\_MOD\_se\_slice3r’:  
se\_slice\_module.f:(.text+0x1950): undefined reference to `mpi_recv_' se_slice_module.f:(.text+0x1e28): undefined reference to`mpi\_send’  
se\_slice\_module.f:(.text+0x1ec6): undefined reference to `mpi_recv_' se_slice_module.o: In function`se\_slice\_module\_MOD\_se\_slice3i’:  
se\_slice\_module.f:(.text+0x2270): undefined reference to `mpi_recv_' se_slice_module.f:(.text+0x26a6): undefined reference to`mpi\_send’  
se\_slice\_module.f:(.text+0x2744): undefined reference to `mpi_recv_' se_slice_module.o: In function`se\_slice\_module\_MOD\_se\_slice2r’:  
se\_slice\_module.f:(.text+0x2a54): undefined reference to `mpi_recv_' se_slice_module.f:(.text+0x2e2b): undefined reference to`mpi\_send’  
se\_slice\_module.f:(.text+0x2ea9): undefined reference to `mpi_recv_' se_slice_module.o: In function`se\_slice\_module\_MOD\_se\_slice2i’:  
se\_slice\_module.f:(.text+0x3194): undefined reference to `mpi_recv_' se_slice_module.f:(.text+0x34ca): undefined reference to`mpi\_send’  
se\_slice\_module.f:(.text+0x3549): undefined reference to `mpi_recv_' se_slice_module.o: In function`se\_slice\_module\_MOD\_se\_slice1r’:  
se\_slice\_module.f:(.text+0x360a): undefined reference to `mpi_recv_' se_slice_module.f:(.text+0x364f): undefined reference to`mpi\_send’  
se\_slice\_module.o: In function `__se_slice_module_MOD_se_slice1i': se_slice_module.f:(.text+0x36ea): undefined reference to`mpi\_recv’  
se\_slice\_module.f:(.text+0x372f): undefined reference to `mpi_send_' se_init_module.o: In function`se\_init\_module\_MOD\_se\_init’:  
se\_init\_module.F:(.text+0xa5): undefined reference to `mpi_comm_dup_' se_init_module.F:(.text+0xce): undefined reference to`mpi\_comm\_dup’  
se\_init\_module.F:(.text+0xb4d): undefined reference to `mpi_comm_group_' se_init_module.F:(.text+0xeb3): undefined reference to`mpi\_group\_incl’  
se\_init\_module.F:(.text+0xed1): undefined reference to `mpi_group_excl_' se_init_module.F:(.text+0xeed): undefined reference to`mpi\_comm\_create’  
se\_init\_module.F:(.text+0xf08): undefined reference to `mpi_comm_create_' se_gather_module.o: In function`se\_gather\_module\_MOD\_se\_gather4i’:  
se\_gather\_module.f:(.text+0x271): undefined reference to `mpi_gather_' se_gather_module.f:(.text+0x2d9): undefined reference to`mpi\_gather’  
se\_gather\_module.o: In function `__se_gather_module_MOD_se_gather3i': se_gather_module.f:(.text+0xef1): undefined reference to`mpi\_gather’  
se\_gather\_module.f:(.text+0xf5a): undefined reference to `mpi_gather_' se_gather_module.o: In function`se\_gather\_module\_MOD\_se\_gather2i’:  
se\_gather\_module.f:(.text+0x1acd): undefined reference to `mpi_gather_' se_gather_module.o:se_gather_module.f:(.text+0x1b32): more undefined references to`mpi\_gather’ follow  
se\_twoway\_comm\_module.o: In function `__se_twoway_comm_module_MOD_se_twoway_recv4': se_twoway_comm_module.f:(.text+0x689): undefined reference to`mpi\_recv’  
se\_twoway\_comm\_module.o: In function `__se_twoway_comm_module_MOD_se_twoway_send4': se_twoway_comm_module.f:(.text+0xf5e): undefined reference to`mpi\_send’  
se\_twoway\_comm\_module.o: In function `__se_twoway_comm_module_MOD_se_cmaq_wrf_comm4': se_twoway_comm_module.f:(.text+0x1f94): undefined reference to`mpi\_send’  
se\_twoway\_comm\_module.f:(.text+0x20c9): undefined reference to `mpi_recv_' se_twoway_comm_module.f:(.text+0x285b): undefined reference to`mpi\_send’  
se\_twoway\_comm\_module.f:(.text+0x2919): undefined reference to `mpi_recv_' se_twoway_comm_module.f:(.text+0x29a9): undefined reference to`mpi\_send’  
se\_twoway\_comm\_module.o: In function `__se_twoway_comm_module_MOD_se_cmaq_wrf_comm3': se_twoway_comm_module.f:(.text+0x34b7): undefined reference to`mpi\_send’  
se\_twoway\_comm\_module.f:(.text+0x35d4): undefined reference to `mpi_recv_' se_twoway_comm_module.f:(.text+0x3c4f): undefined reference to`mpi\_send’  
se\_twoway\_comm\_module.f:(.text+0x3db3): undefined reference to `mpi_send_' se_twoway_comm_module.f:(.text+0x3e25): undefined reference to`mpi\_recv_’  
se\_twoway\_comm\_module.o: In function `__se_twoway_comm_module_MOD_se_cmaq_wrf_comm2': se_twoway_comm_module.f:(.text+0x4761): undefined reference to`mpi\_send\_’  
se\_twoway\_comm\_module.f:(.text+0x4879): undefined reference to `mpi_recv_' se_twoway_comm_module.o: In function`_se\_twoway\_comm\_module\_MOD\_se\_wrf\_cmaq\_comm4’:  
se\_twoway\_comm\_module.f:(.text+0x5a74): undefined reference to `mpi_send_' se_twoway_comm_module.f:(.text+0x5ba9): undefined reference to`mpi\_recv’  
se\_twoway\_comm\_module.f:(.text+0x633b): undefined reference to `mpi_send_' se_twoway_comm_module.f:(.text+0x63f9): undefined reference to`mpi\_recv_’  
se\_twoway\_comm\_module.f:(.text+0x6489): undefined reference to `mpi_send_' se_twoway_comm_module.o: In function`_se\_twoway\_comm\_module\_MOD\_se\_wrf\_cmaq\_comm3’:  
se\_twoway\_comm\_module.f:(.text+0x6f97): undefined reference to `mpi_send_' se_twoway_comm_module.f:(.text+0x70b4): undefined reference to`mpi\_recv’  
se\_twoway\_comm\_module.f:(.text+0x772f): undefined reference to `mpi_send_' se_twoway_comm_module.f:(.text+0x7893): undefined reference to`mpi\_send_’  
se\_twoway\_comm\_module.f:(.text+0x7905): undefined reference to `mpi_recv_' se_twoway_comm_module.o: In function`_se\_twoway\_comm\_module\_MOD\_se\_wrf\_cmaq\_comm2’:  
se\_twoway\_comm\_module.f:(.text+0x8241): undefined reference to `mpi_send_' se_twoway_comm_module.f:(.text+0x8359): undefined reference to`mpi\_recv’  
se\_util\_module.o: In function `__se_util_module_MOD_se_collect': se_util_module.f:(.text+0x2d9): undefined reference to`mpi\_recv_’  
se\_util\_module.f:(.text+0x60e): undefined reference to `mpi_send_' se_util_module.o: In function`_se\_util\_module\_MOD\_se\_in\_syn’:  
se\_util\_module.f:(.text+0x65a): undefined reference to `mpi_bcast_' se_util_module.o: In function`se\_util\_module\_MOD\_se\_global\_logical’:  
se\_util\_module.f:(.text+0x44a9): undefined reference to `mpi_reduce_' se_util_module.f:(.text+0x44d4): undefined reference to`mpi\_bcast’  
se\_util\_module.o: In function `__se_util_module_MOD_se_my_region': se_util_module.f:(.text+0x460e): undefined reference to`mpi\_reduce’  
se\_util\_module.f:(.text+0x4636): undefined reference to `mpi_bcast_' se_util_module.o: In function`se\_util\_module\_MOD\_se\_rsum\_chk’:  
se\_util\_module.f:(.text+0x4690): undefined reference to `mpi_reduce_' se_util_module.f:(.text+0x46f3): undefined reference to`mpi\_bcast’  
se\_util\_module.o: In function `__se_util_module_MOD_se_isum_chk': se_util_module.f:(.text+0x47a0): undefined reference to`mpi\_reduce’  
se\_util\_module.f:(.text+0x47f6): undefined reference to `mpi_bcast_' se_util_module.o: In function`se\_util\_module\_MOD\_se\_global\_min\_data’:  
se\_util\_module.f:(.text+0x4a2e): undefined reference to `mpi_reduce_' se_util_module.f:(.text+0x4a5b): undefined reference to`mpi\_bcast’  
se\_util\_module.f:(.text+0x4b9d): undefined reference to `mpi_bcast_' se_util_module.o: In function`se\_util\_module\_MOD\_se\_barrier’:  
se\_util\_module.f:(.text+0x4d05): undefined reference to `mpi_comm_dup_' se_util_module.f:(.text+0x4d12): undefined reference to`mpi\_barrier’  
se\_util\_module.f:(.text+0x4d1f): undefined reference to `mpi_comm_free_' se_util_module.f:(.text+0x4d3f): undefined reference to`mpi\_barrier’  
swap\_sandia.o: In function `__swap_sandia_MOD_swap_init_snl': swap_sandia.f:(.text+0x20): undefined reference to`mpi\_comm\_rank’  
swap\_sandia.f:(.text+0x36): undefined reference to `mpi_comm_size_' swap_sandia_routines.o: In function`swap1d’:  
swap\_sandia\_routines.f:(.text+0x96): undefined reference to `mpi_irecv_' swap_sandia_routines.f:(.text+0x10f): undefined reference to`mpi\_send_’  
swap\_sandia\_routines.f:(.text+0x188): undefined reference to `mpi_wait_' swap_sandia_routines.f:(.text+0x1d0): undefined reference to`mpi\_wait\_’  
swap\_sandia\_routines.o: In function `swap2d_': swap_sandia_routines.f:(.text+0x2e2): undefined reference to`mpi\_irecv\_’  
swap\_sandia\_routines.f:(.text+0x53e): undefined reference to `mpi_send_' swap_sandia_routines.f:(.text+0x590): undefined reference to`mpi\_wait\_’  
swap\_sandia\_routines.f:(.text+0x5e0): undefined reference to `mpi_wait_' swap_sandia_routines.o: In function`swap3d\_’:  
swap\_sandia\_routines.f:(.text+0x910): undefined reference to `mpi_irecv_' swap_sandia_routines.f:(.text+0xa34): undefined reference to`mpi\_send\_’  
swap\_sandia\_routines.f:(.text+0xa98): undefined reference to `mpi_wait_' swap_sandia_routines.f:(.text+0xb18): undefined reference to`mpi\_wait\_’  
swap\_sandia\_routines.o: In function `swap4d_': swap_sandia_routines.f:(.text+0xd9f): undefined reference to`mpi\_wait\_’  
swap\_sandia\_routines.f:(.text+0xf0e): undefined reference to `mpi_irecv_' swap_sandia_routines.f:(.text+0x106c): undefined reference to`mpi\_send\_’  
pm3err.o: In function `pm3err_': pm3err.f:(.text+0xce2): undefined reference to`mpi\_abort\_’  
pm3exit.o: In function `pm3exit_': pm3exit.f:(.text+0x8f2): undefined reference to`mpi\_abort\_’  
pshut3.o: In function `pshut3_': pshut3.F:(.text+0x665): undefined reference to`mpi\_bcast\_’  
ptrwrite3.o: In function `ptrwrite3_': ptrwrite3.f:(.text+0x1ff): undefined reference to`mpi\_bcast\_’  
ptrwrite3.f:(.text+0x250): undefined reference to `mpi_bcast_' ptrwrite3.f:(.text+0x279): undefined reference to`mpi\_bcast\_’  
ptrwrite3.f:(.text+0x372): undefined reference to `mpi_bcast_' ptrwrite3.o:ptrwrite3.f:(.text+0x9fc): more undefined references to`mpi\_bcast\_’ follow  
pwrgrdd.o: In function `pwrgrdd_': pwrgrdd.f:(.text+0x651): undefined reference to`mpi\_recv\_’  
pwrgrdd.f:(.text+0x746): undefined reference to `mpi_recv_' pwrgrdd.f:(.text+0xc9a): undefined reference to`mpi\_send\_’  
pwrgrdd.f:(.text+0xce4): undefined reference to `mpi_send_' pwrgrdd.f:(.text+0xd2e): undefined reference to`mpi\_allreduce\_’  
pwrite3.o: In function `pwrite3_': pwrite3.f:(.text+0x206): undefined reference to`mpi\_bcast\_’  
pwrite3.f:(.text+0x257): undefined reference to `mpi_bcast_' pwrite3.f:(.text+0x280): undefined reference to`mpi\_bcast\_’  
pwrite3.f:(.text+0x36f): undefined reference to `mpi_bcast_' pwrite3.f:(.text+0x98c): undefined reference to`mpi\_bcast\_’  
distr\_env.o: In function `distr_env_': distr_env.c:(.text+0xd6): undefined reference to`ompi\_mpi\_comm\_world’  
distr\_env.c:(.text+0xdd): undefined reference to `ompi_mpi_int' distr_env.c:(.text+0xe9): undefined reference to`MPI\_Bcast’  
distr\_env.c:(.text+0xf4): undefined reference to `ompi_mpi_comm_world' distr_env.c:(.text+0xfb): undefined reference to`ompi\_mpi\_char’  
distr\_env.c:(.text+0x105): undefined reference to `MPI_Bcast' distr_env.c:(.text+0x10c): undefined reference to`ompi\_mpi\_comm\_world’  
distr\_env.c:(.text+0x111): undefined reference to `MPI_Barrier' distr_env.c:(.text+0x148): undefined reference to`ompi\_mpi\_comm\_world’  
distr\_env.c:(.text+0x14f): undefined reference to `ompi_mpi_int' distr_env.c:(.text+0x163): undefined reference to`MPI\_Bcast’  
distr\_env.c:(.text+0x16e): undefined reference to `ompi_mpi_comm_world' distr_env.c:(.text+0x175): undefined reference to`ompi\_mpi\_char’  
distr\_env.c:(.text+0x187): undefined reference to `MPI_Bcast' mpcomm_init.o: In function`mpcomm\_init\_’:  
mpcomm\_init.F:(.text+0x4d): undefined reference to `mpi_init_' mpcomm_init.F:(.text+0x60): undefined reference to`mpi\_wtime\_’  
mpcomm\_init.F:(.text+0x82): undefined reference to `mpi_comm_size_' mpcomm_init.F:(.text+0xa2): undefined reference to`mpi\_comm\_rank\_’  
setup\_logdev.o: In function `setup_logdev_': setup_logdev.F:(.text+0x6d): undefined reference to`mpi\_comm\_rank\_’  
collect2: error: ld returned 1 exit status  
Makefile:408: recipe for target ‘CCTM\_v52.exe’ failed  
make: \*\*\* [CCTM\_v52.exe] Error 1  
**ERROR** while running make command

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [May 2, 2019, 6:47pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/14 "2019-05-02T18:47:08Z")

</div>

You have an error with specifying the MPI libraries in the link-line. Note that what is required is dependent upon which MPI implementation you are using – the MPICH implementation of MPI uses different libraries than OPENMPI (and further note that it is also dependent upon the vendor of the underlying C and Fortran libraries…

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [May 2, 2019, 7:37pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/15 "2019-05-02T19:37:49Z")

</div>

Ok. I am using OPENMPI and netcdf-4.1.3. What’s the way forward now, please? Kindly assist me. Thanks.

/home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/ioapi/lib/libioapi.a(wrdict3.o): In function `wrdict3_': wrdict3.f90:(.text+0x3a7): undefined reference to`GOMP\_critical\_name\_start’  
wrdict3.f90:(.text+0x3b3): undefined reference to `GOMP_critical_name_start' wrdict3.f90:(.text+0x55e): undefined reference to`GOMP\_critical\_name\_end’  
wrdict3.f90:(.text+0x56a): undefined reference to `GOMP_critical_name_end' wrdict3.f90:(.text+0x8f3): undefined reference to`GOMP\_critical\_name\_end’  
wrdict3.f90:(.text+0x8ff): undefined reference to `GOMP_critical_name_end' wrdict3.f90:(.text+0x15b0): undefined reference to`GOMP\_critical\_name\_end’  
/home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/ioapi/lib/libioapi.a(wrdict3.o):wrdict3.f90:(.text+0x15bc): more undefined references to `GOMP_critical_name_end' follow /home/catalyst/Desktop/Build_WRF/CMAQ-5.2/lib/x86_64/gcc7.3.0/ioapi/lib/libioapi.a(wriddata.o): In function`wriddata\_’:  
wriddata.f90:(.text+0x44): undefined reference to `GOMP_critical_name_start' wriddata.f90:(.text+0x50): undefined reference to`GOMP\_critical\_name\_start’  
wriddata.f90:(.text+0x184): undefined reference to `GOMP_critical_name_end' wriddata.f90:(.text+0x190): undefined reference to`GOMP\_critical\_name\_end’  
wriddata.f90:(.text+0x225): undefined reference to `GOMP_critical_name_end' wriddata.f90:(.text+0x231): undefined reference to`GOMP\_critical\_name\_end’  
/home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/ioapi/lib/libioapi.a(wrsmatrx.o): In function `wrsmatrx_': wrsmatrx.f90:(.text+0xd3): undefined reference to`GOMP\_critical\_name\_start’  
wrsmatrx.f90:(.text+0xdf): undefined reference to `GOMP_critical_name_start' wrsmatrx.f90:(.text+0x214): undefined reference to`GOMP\_critical\_name\_end’  
wrsmatrx.f90:(.text+0x220): undefined reference to `GOMP_critical_name_end' wrsmatrx.f90:(.text+0x2aa): undefined reference to`GOMP\_critical\_name\_end’  
wrsmatrx.f90:(.text+0x2b6): undefined reference to `GOMP_critical_name_end' /home/catalyst/Desktop/Build_WRF/CMAQ-5.2/lib/x86_64/gcc7.3.0/ioapi/lib/libioapi.a(crtfil3.o): In function`crtfil3\_’:  
crtfil3.F90:(.text+0x2c): undefined reference to `GOMP_critical_name_start' crtfil3.F90:(.text+0x46): undefined reference to`GOMP\_critical\_name\_end’  
crtfil3.F90:(.text+0x69): undefined reference to `GOMP_critical_name_start' crtfil3.F90:(.text+0x4a5): undefined reference to`GOMP\_critical\_name\_end’  
crtfil3.F90:(.text+0x570): undefined reference to `GOMP_critical_name_end' crtfil3.F90:(.text+0x57c): undefined reference to`GOMP\_critical\_name\_start’  
crtfil3.F90:(.text+0x5af): undefined reference to `GOMP_critical_name_end' crtfil3.F90:(.text+0xa49): undefined reference to`GOMP\_critical\_name\_end’  
/home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/ioapi/lib/libioapi.a(wrtflag.o): In function `wrtflag_': wrtflag.F90:(.text+0xaa): undefined reference to`GOMP\_critical\_name\_start’  
wrtflag.F90:(.text+0xe3): undefined reference to `GOMP_critical_name_end' wrtflag.F90:(.text+0x731): undefined reference to`GOMP\_critical\_name\_start’  
wrtflag.F90:(.text+0x757): undefined reference to `GOMP_critical_name_end' /home/catalyst/Desktop/Build_WRF/CMAQ-5.2/lib/x86_64/gcc7.3.0/ioapi/lib/libioapi.a(rdatt3.o): In function`master.0.rdatt3\_’:  
rdatt3.F90:(.text+0x3f5): undefined reference to `GOMP_critical_name_start' rdatt3.F90:(.text+0x681): undefined reference to`GOMP\_critical\_name\_end’  
rdatt3.F90:(.text+0x133b): undefined reference to `GOMP_critical_name_end' rdatt3.F90:(.text+0x1cd5): undefined reference to`GOMP\_critical\_name\_end’  
rdatt3.F90:(.text+0x1d12): undefined reference to `GOMP_critical_name_end' rdatt3.F90:(.text+0x1da3): undefined reference to`GOMP\_critical\_name\_end’  
/home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/ioapi/lib/libioapi.a(wratt3.o): In function `master.0.wratt3_': wratt3.F90:(.text+0x659): undefined reference to`GOMP\_critical\_name\_start’  
wratt3.F90:(.text+0x6e7): undefined reference to `GOMP_critical_name_end' wratt3.F90:(.text+0xb3b): undefined reference to`GOMP\_critical\_name\_end’  
wratt3.F90:(.text+0x126f): undefined reference to `GOMP\_critical\_name\_end’  
collect2: error: ld returned 1 exit status  
Makefile:408: recipe for target ‘CCTM\_v52.exe’ failed  
make: \*\*\* [CCTM\_v52.exe] Error 1  
**ERROR** while running make command

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [May 3, 2019, 11:58am UTC](https://forum.cmascenter.org/t/cctm-compilation/594/16 "2019-05-03T11:58:20Z")

</div>

What’s your underlying compiler for OpenMPI? Since the I/O API is openmp-enabled (with various other programs using omp shared-memory parallelism), you need to include the appropriate OpenMP flag in your link step (-qopenmp for Intel, -fopenmp for GNU, -mp for PGI, …)

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [May 3, 2019, 12:01pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/17 "2019-05-03T12:01:38Z")

</div>

Thanks for your response. Below is my Compiler Aliases and Flags:

#\> Compiler Aliases and Flags  
setenv myFC gfortran  
#setenv myFC mpifort  
setenv myCC gcc  
setenv myFSTD “-O3 -funroll-loops -finit-character=32 -Wtabs -Wsurprising”  
setenv myDBG “-Wall -O0 -g -fcheck=all -ffpe-trap=invalid,zero,overflow -fbacktrace”  
#setenv myDBG “$myDBG -fimplicit-none”  
setenv myFFLAGS “-ffixed-form -ffixed-line-length-132 -funroll-loops -finit-character=32”  
setenv myFRFLAGS “-ffree-form -ffree-line-length-none -funroll-loops -finit-character=32”  
setenv myCFLAGS “-O2”  
setenv myLINK\_FLAG “-fopenmp”  
setenv extra\_lib “”  
#setenv mpi\_lib “-lmpi\_mpifh” #\> -lmpich for mvapich or -lmpi for openmpi  
setenv mpi\_lib “” #\> -lmpich for mvapich or -lmpi for openmpi

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [May 3, 2019, 12:06pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/18 "2019-05-03T12:06:17Z")

</div>

sp you need to add -`fopenmp` to your link-flags

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [May 3, 2019, 12:06pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/19 "2019-05-03T12:06:40Z")

</div>

For my CCTM Script"

setenv FC ${myFC} #\> path of Fortan compiler; set in config.cmaq  
set FP = FC #\> path of Fortan preprocessor; set in config.cmaq set CC = {myCC} #\> path of C compiler; set in config.cmaq  
setenv BLDER {CMAQ\_HOME}/UTIL/bldmake/bldmake\_{compilerString}.exe #\> name of model builder executable

#\> Libraries/include files  
set LIOAPI = “{IOAPI\_DIR}/lib {ioapi\_lib}” #\> I/O API library directory  
set IOAPIMOD = “{IOAPI\_DIR}/include" #\> I/O API module directory set NETCDF = "{NETCDF\_DIR}/lib {netcdf\_lib}" #\> netCDF library directory #set PNETCDF = "{PNETCDF\_DIR}/lib {pnetcdf\_lib}" #\> Parallel netCDF library directory #set PIO\_INC = "{IOAPI\_DIR}/src”

#\> Compiler flags set in config.cmaq  
set FSTD = “{myFSTD}" set DBG = "{myDBG}”  
setenv F\_FLAGS “{myFFLAGS}" #\> F77 flags set F90\_FLAGS = "{myFRFLAGS}” #\> F90 flags  
set CPP\_FLAGS = “” #\> Fortran preprocessor flags  
set C\_FLAGS = “{myCFLAGS} -DFLDMN -I" #\> C flags set LINK\_FLAGS = "{myLINK\_FLAG}” # Link flags

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [May 3, 2019, 12:08pm UTC](https://forum.cmascenter.org/t/cctm-compilation/594/20 "2019-05-03T12:08:22Z")

</div>

I have been able to successfully compile CCTM after so many manipulations of my scripts. Thanks so much for your guide. I’m available to help those facing the challenges I have faced in the course of compiling CMAQ and its related models.

Cheers.

Catalyst

[Next page](https://forum.cmascenter.org/t/cctm-compilation/594.md?page=2)
