CCTM compilation

Hi,

I was trying to compile CCTM and stuck for two days. I getting the following error:


make list
file /usr/local/usrapps/fgarcia4/CMAQ5.2.1-Sadia/CCTM/src/util/util/subhfile.F added to make list
file /usr/local/usrapps/fgarcia4/CMAQ5.2.1-Sadia/CCTM/src/util/util/UTILIO_DEFN.F added to make list
ERROR Cannot Open source file:alloc_data_mod.f
endif
else if ( 0 ) then
endif
mv Makefile Makefile.intel2017.1.132
mv: cannot stat ‘Makefile’: No such file or directory
if ( -e Makefile.intel2017.1.132 && -e Makefile ) rm Makefile
ln -s Makefile.intel2017.1.132 Makefile
if ( 0 != 0 ) then
if ( -e /usr/local/usrapps/fgarcia4/CMAQ5.2.1-Sadia/CCTM/scripts/BLD_CCTM_v521_intel2017.1.132/CCTM_v521.cfg ) then
mv CCTM_v521.cfg.bld /usr/local/usrapps/fgarcia4/CMAQ5.2.1-Sadia/CCTM/scripts/BLD_CCTM_v521_intel2017.1.132/CCTM_v521.cfg
exit

I also got the following error after running the script second time:


): In function NC4_rename_att': /usr/local/usrapps/fgarcia4/downloads/netcdf-c-intel2017/download/netcdf-c-4.6.1/libsrc4/nc4attr.c:463: undefined reference to H5Adelete’
/usr/local/usrapps/fgarcia4/downloads/netcdf-c-intel2017/download/netcdf-c-4.6.1/libsrc4/nc4attr.c:456: undefined reference to H5Adelete' /usr/local/usrapps/fgarcia4/CMAQ5.2.1-Sadia/lib/x86_64/intel2017.1.132/ioapi/lib/libnetcdf.a(libnetcdf4_la-nc4attr.o): In function NC4_del_att’:
/usr/local/usrapps/fgarcia4/downloads/netcdf-c-intel2017/download/netcdf-c-4.6.1/libsrc4/nc4attr.c:566: undefined reference to `H5Adelete’
make: *** [CCTM_v521.exe] Error 1
ERROR while running make command

endif
else if ( 0 ) then
endif
mv Makefile Makefile.intel2017.1.132
mv: ‘Makefile’ and ‘Makefile.intel2017.1.132’ are the same file
if ( -e Makefile.intel2017.1.132 && -e Makefile ) rm Makefile
rm Makefile
ln -s Makefile.intel2017.1.132 Makefile
if ( 0 != 0 ) then
if ( -e /usr/local/usrapps/fgarcia4/CMAQ5.2.1-Sadia/CCTM/scripts/BLD_CCTM_v521_intel2017.1.132/CCTM_v521.cfg ) then
echo >>> previous CCTM_v521.cfg exists, re-naming to CCTM_v521.cfg.old <<<

previous CCTM_v521.cfg exists, re-naming to CCTM_v521.cfg.old <<<
mv /usr/local/usrapps/fgarcia4/CMAQ5.2.1-Sadia/CCTM/scripts/BLD_CCTM_v521_intel2017.1.132/CCTM_v521.cfg /usr/local/usrapps/fgarcia4/CMAQ5.2.1-Sadia/CCTM/scripts/BLD_CCTM_v521_intel2017.1.132/CCTM_v521.cfg.old
endif
mv CCTM_v521.cfg.bld /usr/local/usrapps/fgarcia4/CMAQ5.2.1-Sadia/CCTM/scripts/BLD_CCTM_v521_intel2017.1.132/CCTM_v521.cfg
exit


It would be great if you could help me out.

Thanks,
Sadia

This looks like you didn’t follow the instructions at https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#ncf4
and are working with an HDF-etc. enabled netCDF. You will need either to build a “vanilla”
netCDF (recommended), or do the commands
nc-config --libs
nf-config --libs
to figure out how to modify your Makefiles (etc.)

1 Like

Hi
I compiled CCTM and it didn’t give me any error, but it didn’t create any CCTM.exe file. Could you guide me, please?

The log file is:

New Text Document.txt (101.6 KB)

So it looks as though you have a Makefile in BLD_CCTM_v52_intel.

cd there and type make

What happens then?

1 Like

Thank you.
I have two makefile: Makefile (is shortcut) and MAKEfile.intel

I type make and it gave an error.
The log file is:

ensiyeh:~/WRF-CMAQ/CMAQ_REPO/CCTM/scripts/BLD_CCTM_v52_intel> make
ifort -c -fixed -132 -O3 -fno-alias -mp1 -fp-model source -qopenmp -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/ioapi/modules -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/ioapi/include_files -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/mpi -I. se_bndy_copy_info_ext.f
ifort -c -fixed -132 -O3 -fno-alias -mp1 -fp-model source -qopenmp -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/ioapi/modules -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/ioapi/include_files -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/mpi -I. se_pe_info_ext.f
ifort -c -fixed -132 -O3 -fno-alias -mp1 -fp-model source -qopenmp -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/ioapi/modules -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/ioapi/include_files -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/mpi -I. se_comm_info_ext.f
ifort -c -fixed -132 -O3 -fno-alias -mp1 -fp-model source -qopenmp -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/ioapi/modules -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/ioapi/include_files -I /home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/mpi -I. se_data_send_module.f
se_data_send_module.f(84): error #5102: Cannot open include file ‘mpif.h’
include “mpif.h”
----------------^
se_data_send_module.f(117): error #5102: Cannot open include file ‘mpif.h’
include “mpif.h”
----------------^
se_data_send_module.f(154): error #5102: Cannot open include file ‘mpif.h’
include “mpif.h”
----------------^
se_data_send_module.f(191): error #5102: Cannot open include file ‘mpif.h’
include “mpif.h”
----------------^
se_data_send_module.f(231): error #5102: Cannot open include file ‘mpif.h’
include “mpif.h”
----------------^
se_data_send_module.f(270): error #5102: Cannot open include file ‘mpif.h’
include “mpif.h”
----------------^
se_data_send_module.f(313): error #5102: Cannot open include file ‘mpif.h’
include “mpif.h”
----------------^
se_data_send_module.f(354): error #5102: Cannot open include file ‘mpif.h’
include “mpif.h”
----------------^
se_data_send_module.f(106): error #6404: This name does not have a type, and must have an explicit type. [MPI_REAL]
call mpi_send (sarray, scount, mpi_real, send_to(dir_ind),
---------------------------------------^
se_data_send_module.f(351): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value. [REQUEST]
subroutine se_5d_data_send (data, sind, send_to, dir_ind, tag, request)
-----------------------------------------------------------------------^
se_data_send_module.f(310): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value. [REQUEST]
subroutine se_4de_data_send (data, sind, send_to, dir_ind, tag, request)
------------------------------------------------------------------------^
se_data_send_module.f(267): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value. [REQUEST]
subroutine se_4d_data_send (data, sind, send_to, dir_ind, tag, request)
-----------------------------------------------------------------------^
se_data_send_module.f(228): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value. [REQUEST]
subroutine se_3de_data_send (data, sind, send_to, dir_ind, tag, request)
------------------------------------------------------------------------^
se_data_send_module.f(188): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value. [REQUEST]
subroutine se_3d_data_send (data, sind, send_to, dir_ind, tag, request)
-----------------------------------------------------------------------^
se_data_send_module.f(151): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value. [REQUEST]
subroutine se_2de_data_send (data, sind, send_to, dir_ind, tag, request)
------------------------------------------------------------------------^
se_data_send_module.f(114): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value. [REQUEST]
subroutine se_2d_data_send (data, sind, send_to, dir_ind, tag, request)
-----------------------------------------------------------------------^
se_data_send_module.f(81): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value. [REQUEST]
subroutine se_1d_data_send (data, sind, send_to, dir_ind, tag, request)
-----------------------------------------------------------------------^
compilation aborted for se_data_send_module.f (code 1)
Makefile:427: recipe for target ‘se_data_send_module.o’ failed
make: * [se_data_send_module.o] Error 1

This looks like you’re doing a parallel build.
I’m guessing that this directory should contain mpi.h – does it?

I also note that you’re using ifort as a compiler-- are you using the Intel impi package? If so, you may need to chase through its directory-structure to find mpi.h and link it to the directory listed above… If not, your compiler should be some mpif90 (with appropriate adjustments to the directory above for that particular MPI-installation).

1 Like

Thank you. I want to install online coupled wrf-cmaq.

I don’t have any *.h in this directory.
I don’t installed parallel netcdf.
I don’t use intel impi package. I installed mpich-3.0.4.
I searched in my OS and there is mpif90. I installed openmpi, too.

What am I doing now? Guide me, please

Go back and examine the CMAQ installation documentation: your compiler needs to be that mpif90 and you need to link its include-files and libraries to the appropriate CMAQ-installation directories.

Note that you need to have configured and built MPICH with the same compiler you are using for WRF (since mpif90 is really a “wrapper” script that uses that compiler)…

1 Like

If I uninstall my openmpi, will it be run?
I installed all of them with the same compiler.

I’m not sure about ioapi, because I used make build, but other libraries and WRF installed with the same compilers.

You shouldn’t need to uninstall; you just have to use one or the other consistently.

1 Like

So why it doesn’t make CCTM.exe?

Why we have makefile and makfile.intel in the BLD_CCTM_v52_intel?

So why it doesn’t make CCTM.exe?

The CMAQ part of the build system doesn’t know how to find the MPI related include-files.

Don’t ask me; I didn’t create that build-system.

1 Like

I copy mpich/include in mpi, after make, it gives me another error.

icc -c -O2 -DFLDMN -I/home/ensiyeh/WRF-CMAQ/CMAQ_REPO/lib/x86_64/intel/mpi/include -I. distr_env.c
distr_env.c(36): catastrophic error: cannot open source file “mpi.h”
#include “mpi.h”
^

compilation aborted for distr_env.c (code 4)
Makefile:436: recipe for target ‘distr_env.o’ failed
make: * [distr_env.o] Error 4

Could you guide me, please?

The makefile and Makefile.intel are linked together as a symbolic link.
You can see this using the following ls command:

ls -lrt Makefile*
-rw-r--r-- 1 lizadams rc_cep-emc_psx 27952 Jul 24 12:56 Makefile.intel
lrwxrwxrwx 1 lizadams rc_cep-emc_psx    12 Jul 24 12:56 Makefile -> Makefile.intel

The -> symbol indicates that you have symbolically linked Makefile to Makefile.intel
To symbolically link Makefile to Makefile.intel the following command was used:

ln -s Makefile.intel Makefile

This allows you to type make, and it will build the executable without having to type the full name of the makefile, but this could be done as an alternative:

make -f Makefile.intel 

Rather than creating the Makefile directly, the bldit_cctm.csh script creates the Makefile.intel and then links it to the makefile to preserve the intel label, so in the future you will know that the Makefile is for the intel compiler.

This is often helpful if you use the module load command to load the compiler environment.
You need to know which compiler the makefile options are valid for.

2 Likes

Hi Liz,
I have a problem when I compiling bldit_cctm. Could you help me,please?

The error is:

Makefile generated
Makefile:8: warning: NUL character seen; rest of line ignored
Makefile:9: warning: NUL character seen; rest of line ignored
/opt/intel/bin/icc -c -O2 -DFLDMN -I/home/ensiyeh/WRF-CMAQ/CMAQ-5.2/lib/x86_64/intel/mpi/include -I. distr_env.c
distr_env.c(36): catastrophic error: cannot open source file “mpi.h”
#include “mpi.h”
^

compilation aborted for distr_env.c (code 4)
Makefile:423: recipe for target ‘distr_env.o’ failed
make: *** [distr_env.o] Error 4
ERROR while running make command

else if ( 0 ) then
endif
mv Makefile Makefile.intel
mv: ‘Makefile’ and ‘Makefile.intel’ are the same file
if ( -e Makefile.intel && -e Makefile ) rm Makefile
rm Makefile
ln -s Makefile.intel Makefile
if ( 0 != 0 ) then
if ( -e /home/ensiyeh/WRF-CMAQ/CMAQ-5.2/CCTM/scripts/BLD_CCTM_v52_intel/CCTM_v52.cfg ) then
echo >>> previous CCTM_v52.cfg exists, re-naming to CCTM_v52.cfg.old <<<

previous CCTM_v52.cfg exists, re-naming to CCTM_v52.cfg.old <<<
mv /home/ensiyeh/WRF-CMAQ/CMAQ-5.2/CCTM/scripts/BLD_CCTM_v52_intel/CCTM_v52.cfg /home/ensiyeh/WRF-CMAQ/CMAQ-5.2/CCTM/scripts/BLD_CCTM_v52_intel/CCTM_v52.cfg.old
endif
mv CCTM_v52.cfg.bld /home/ensiyeh/WRF-CMAQ/CMAQ-5.2/CCTM/scripts/BLD_CCTM_v52_intel/CCTM_v52.cfg
exit

This is my log file:
build_cctn.txt (98.2 KB)

Have you figure out this problem? I meet the same problem. Thanks

Hi~ cjcoats
I want to install CMAQ5.3 with gcc6.4.0, and I’ve installed netcdf4.1.3, mpich3.2.1,ioapi3.2
,but after I compiled CCTM it create 0 xxx.exe file and 1 Makefile in BLD_CCTM_v53_gcc , there is nothing in the Makefile.

something about config_cmaq.csh is as follows:

setenv IOAPI_INCL_DIR /home/cmaq/cmaq_zl/package/ioapi/ioapi-3.2/ioapi
setenv IOAPI_LIB_DIR /home/cmaq/cmaq_zl/installsf/ioapi3/Linux2_x86_64
setenv NETCDF_LIB_DIR /usr/local/netcdf4.1.3/lib
setenv NETCDF_INCL_DIR /usr/local/netcdf4.1.3/include
setenv NETCDFF_LIB_DIR /usr/local/netcdf4.1.3/lib
setenv NETCDFF_INCL_DIR /usr/local/netcdf4.1.3/include

#> Compiler Aliases and Flags
#> set the compiler flag -fopt-info-missed to generate a missed optimization report in the bldit logfile
setenv myFC mpifort
setenv myCC gcc
setenv myFSTD “-O3 -funroll-loops -finit-character=32 -Wtabs -Wsurprising -march=native -ftree-vectorize -ftree-loop-if-convert -finline-limit=512”
setenv myDBG “-Wall -O0 -g -fcheck=all -ffpe-trap=invalid,zero,overflow -fbacktrace”
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” openMP not supported w/ CMAQ
setenv extra_lib “”
#setenv mpi_lib “-lmpi_mpifh” #> -lmpich for mvapich or -lmpi for openmpi
setenv mpi_lib “-lmpich” #> -lmpich for mvapich or -lmpi for openmpi
setenv MPI_LIB_DIR /home/cmaq/cmaq_zl/installsf/mpich-install

Appreciate your help:sunflower:

the log file is:bldit.cctm.txt (13.1 KB)

I wasn’t involved in the CMAQ build-system, so you need someone else’s help here.

However. Some issues:

  1. As documented here in the I/O API installation instructions https://cjcoats.github.io/ioapi/AVAIL.html#warn, You are best off if you can build the whole modeling system (libnetcdf.a, libpvm3.a, libioapi.a, and your model(s) CMAQ, SMOKE, etc. with a common compiler set and common set of compile-flags. In particular, Linux-distribution-vendor supplied libnetcdf.a rarely works with CMAS-supported compiler sets.
  2. Somewhere in the version-4.1.x transition, netCDF went to a separate-Fortran-library configuration. Is this version before that transition? …and was Fortran enabled? Check by going to the netCDF-library directory and doing nm libnetcdf.a | grep nf_open – does a line withT in column 1 and ending in nf_open_ show up?
  3. The I/O API build defaults to OpenMP-parallel enabled, and this parallelism is in fact used in many of the M3Tools programs, as well as by other applications. If it is enabled in your build, then you should NOT comment out the OpenMP clause from myLINK_FLAG; furthermore, for mpifort it needs to be -qopenmp not -fopenmp.