CCTM Compile Error

I am getting following error while building CCTM:

wrtflag.F90:(.text+0x156): undefined reference to GOMP_critical_name_end' /data/CMAQ/CMAQ_V5.3.1/lib/x86_64/gcc/ioapi/lib/libioapi.a(rdatt3.o): In function master.0.rdatt3_’:
rdatt3.F90:(.text+0x2c3): undefined reference to GOMP_critical_name_start' rdatt3.F90:(.text+0x55b): undefined reference to GOMP_critical_name_end’
rdatt3.F90:(.text+0xc89): undefined reference to GOMP_critical_name_end' rdatt3.F90:(.text+0xd33): undefined reference to GOMP_critical_name_end’
rdatt3.F90:(.text+0xdba): undefined reference to GOMP_critical_name_end' rdatt3.F90:(.text+0x1780): undefined reference to GOMP_critical_name_end’
/data/CMAQ/CMAQ_V5.3.1/lib/x86_64/gcc/ioapi/lib/libioapi.a(wratt3.o): In function master.0.wratt3_': wratt3.F90:(.text+0x114): undefined reference to GOMP_critical_name_start’
wratt3.F90:(.text+0x191): undefined reference to GOMP_critical_name_end' wratt3.F90:(.text+0xa47): undefined reference to GOMP_critical_name_end’
wratt3.F90:(.text+0xe0b): undefined reference to `GOMP_critical_name_end’
collect2: error: ld returned 1 exit status
make: *** [CCTM_v531.exe] Error 1
ERROR while running make command

mv Makefile Makefile.gcc
mv: ‘Makefile’ and ‘Makefile.gcc’ are the same file
rm Makefile
ln -s Makefile.gcc Makefile
if ( 0 != 0 ) then
if ( -e /data/CMAQ/CMAQ_V5.3.1/CCTM/scripts/BLD_CCTM_v531_gcc/CCTM_v531.cfg ) then
echo >>> previous CCTM_v531.cfg exists, re-naming to CCTM_v531.cfg.old <<<

previous CCTM_v531.cfg exists, re-naming to CCTM_v531.cfg.old <<<
mv /data/CMAQ/CMAQ_V5.3.1/CCTM/scripts/BLD_CCTM_v531_gcc/CCTM_v531.cfg /data/CMAQ/CMAQ_V5.3.1/CCTM/scripts/BLD_CCTM_v531_gcc/CCTM_v531.cfg.old
mv CCTM_v531.cfg.bld /data/CMAQ/CMAQ_V5.3.1/CCTM/scripts/BLD_CCTM_v531_gcc/CCTM_v531.cfg

I tried commenting ln -s Makefile.gcc Makefile and associated lines also. but still getting error.
Executable is not built either.

Hi Yogesh,

It looks like you are using the gcc compiler.
Were you able to follow these installation instructions?

Basically, if the ioapi library was built to link with the openmp library, then you need to also link the openmp library to build the CMAQ executable.

The same compiler and flags used to build the ioapi library, must be used to build CMAQ.

wrtflag.F90 and the other f90 routines where you are getting the error are found in the ioapi library.
Check the Makeinclude.* file that you used to compile the ioapi library and see if you used the following option for the gcc compiler
OMPFLAGS = -fopenmp
OMPLIBS = -fopenmp

If you did, you need to either rebuild the ioapi library without linking the openmp library, or add that option to your config_cmaq.csh under the section

case gcc

setenv myLINK_FLAG “-fopenmp”


Hi @lizadams
Thank you for your inputs. Now I am able to compile CCTM and successfully create CCTM executable.

Please confirm if this settings in tutorial are correct:
setenv CC /urs/local/apps/gcc/9.1.0/bin/gfortran
setenv FC /urs/local/apps/gcc/9.1.0/bin/gcc
setenv CXX /urs/local/apps/gcc/9.1.0/bin/g++

I used following to successfully compile netcdf-c and netcdf-fortran
setenv FC /urs/local/apps/gcc/9.1.0/bin/gfortran
setenv CC /urs/local/apps/gcc/9.1.0/bin/gcc
setenv CXX /urs/local/apps/gcc/9.1.0/bin/g++

Please confirm.

Hi Yogesh,

Thank you. I have corrected the instructions.

1 Like