Hi everyone,
I successfully compiled MCIP BCON and ICON when configuring CMAQv5.3.3 using mpich4.0 ioapi-3.2-large. However, I encountered an error in the mpi library link during the installation of CCTM. I would like to know the reason for this. Below is the log file when I make CCTM
/usr/bin/ld: cmaq_main.o: in function MAIN__': cmaq_main.F:(.text+0x2ea): undefined reference to
mpi_wtime_’
/usr/bin/ld: cmaq_main.F:(.text+0x3dd): undefined reference to mpi_finalize_' /usr/bin/ld: se_data_send_module.o: in function
_se_data_send_module_MOD_se_5d_data_send’:
se_data_send_module.f:(.text+0x5a9): undefined reference to mpi_send_' /usr/bin/ld: se_data_send_module.f:(.text+0x62d): undefined reference to
mpi_send’
/usr/bin/ld: se_data_send_module.f:(.text+0x953): undefined reference to mpi_send_' /usr/bin/ld: se_data_send_module.o: in function
__se_data_send_module_MOD_se_4de_data_send’:se_data_send_module.f:(.text+0xb3a): undefined reference to mpi_send_' /usr/bin/ld: se_data_send_module.o: in function
se_data_send_module_MOD_se_4d_data_send’:
se_data_send_module.f:(.text+0x15f3): undefined reference to mpi_send_' /usr/bin/ld: se_data_send_module.o:se_data_send_module.f:(.text+0x1674): more undefined references to
mpi_send’ follow
/usr/bin/ld: se_internal_util_module.o: in function __se_internal_util_module_MOD_se_generate_map': se_internal_util_module.f:(.text+0xa81): undefined reference to
mpi_gather’
/usr/bin/ld: se_internal_util_module.f:(.text+0xaab): undefined reference to mpi_bcast_' /usr/bin/ld: se_data_recv_module.o: in function
_se_data_recv_module_MOD_se_5d_data_recv’:
se_data_recv_module.f:(.text+0x1c4): undefined reference to mpi_recv_' /usr/bin/ld: se_data_recv_module.o: in function
se_data_recv_module_MOD_se_4de_data_recv’:se_data_recv_module.f:(.text+0xb3c): undefined reference to mpi_recv_' /usr/bin/ld: se_data_recv_module.f:(.text+0x11ee): undefined reference to
mpi_recv’
/usr/bin/ld: se_data_recv_module.o: in function __se_data_recv_module_MOD_se_4d_data_recv': se_data_recv_module.f:(.text+0x13c1): undefined reference to
mpi_recv’
/usr/bin/ld: se_data_recv_module.o: in function __se_data_recv_module_MOD_se_3de_data_recv':se_data_recv_module.f:(.text+0x1b77): undefined reference to
mpi_recv’
/usr/bin/ld: se_data_recv_module.o:se_data_recv_module.f:(.text+0x2153): more undefined references to mpi_recv_' follow /usr/bin/ld: se_global_sum_module.o: in function
_se_global_sum_module_MOD_se_global_rasum’:
se_global_sum_module.f:(.text+0xc8): undefined reference to mpi_reduce_' /usr/bin/ld: se_global_sum_module.f:(.text+0x119): undefined reference to
mpi_bcast’
/usr/bin/ld: se_global_sum_module.f:(.text+0x187): undefined reference to mpi_reduce_' /usr/bin/ld: se_global_sum_module.o: in function
_se_global_sum_module_MOD_se_global_iasum’:
se_global_sum_module.f:(.text+0x678): undefined reference to mpi_reduce_' /usr/bin/ld: se_global_sum_module.f:(.text+0x6c9): undefined reference to
mpi_bcast’
/usr/bin/ld: se_global_sum_module.f:(.text+0x737): undefined reference to mpi_reduce_' /usr/bin/ld: se_global_sum_module.o: in function
_se_global_sum_module_MOD_se_global_rsum’:se_global_sum_module.f:(.text+0xafe): undefined reference to mpi_reduce_' /usr/bin/ld: se_global_sum_module.f:(.text+0xb37): undefined reference to
mpi_bcast’
/usr/bin/ld: se_global_sum_module.o: in function `__se_global_sum_module_MOD_se_global_isum’:
————————————————————————
I set the gcc section in my config_cmaq.csh file as follows:
#> set the compiler flag -fopt-info-missed to generate a missed optimization report in the bldit logfile
setenv myFC gfortran
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” # “-fopenmp” # openMP may be required if I/O API was built using this link flag.
setenv extra_lib “”
setenv mpi_lib “-lmpich”
My Makefile as follows:
EXEC = CCTM_v533.exe
FC = gfortran
CC = gcc
LIB = /home/mapuni/WRF/CMAQ-5.3.3/lib/x86_64/gcc
include_path = -I (LIB)/ioapi/lib \
-I (LIB)/ioapi/include_files
-I (LIB)/mpi/lib -I.
WARN =
FSTD = -O3 -funroll-loops -finit-character=32 -Wtabs -Wsurprising -march=native -ftree-vectorize -ftree-loop-if-convert -finline-limit=512
DBG = -Wall -O0 -g -fcheck=all -ffpe-trap=invalid,zero,overflow -fbacktrace
ifneq (,(filter (debug), TRUE true True T ))
DEBUG = TRUE
endif
ifneq (,(filter (DEBUG), TRUE true ))
f_FLAGS = -ffixed-form -ffixed-line-length-132 -funroll-loops -finit-character=32 (DBG) (include_path)
f90_FLAGS = -ffree-form -ffree-line-length-none -funroll-loops -finit-character=32 (DBG) (include_path)
else
f_FLAGS = -ffixed-form -ffixed-line-length-132 -funroll-loops -finit-character=32 (FSTD) (include_path)
f90_FLAGS = -ffree-form -ffree-line-length-none -funroll-loops -finit-character=32 (FSTD) (include_path)
endif
F_FLAGS = (f_FLAGS) -fallow-argument-mismatch
F90_FLAGS = (f90_FLAGS) -fallow-argument-mismatch
C_FLAGS = -O2 -DFLDMN -I(LIB)/mpi/include -I.
LINKER = $(FC)
LINK_FLAGS = -fopenmp
REPOROOT = /home/mapuni/WRF/CMAQ-5.3.3/CCTM/src
Thank you very much for your help. I have been stuck for many days and even after changing to the mpich version, I still cannot generate CCTMv533.exe properly