COMPILE_WITH_TOPAZ=on
include roms_topaz.mk
include mkmf.template
...
ROMS 컴파일 시스템
~/ROMS1053/build.bash
export COMPILERS=${MY_ROMS_SRC}/Compilers/Linux-ifort_topaz.mk ##hcjung 20230223 set specific conf file name.
...
export COMPILE_WITH_TOPAZ=off # compile with TOPAZ, on/off, ##hcjung 20230713
...
export which_MPI=intel # compile with impi
...
elif [ "${which_MPI}" = "intel" ] ; then ##hcjung 20230223
export PATH=/opt/kma/kma_lib/apps/intel/21/21.3/mpi/2021.3.0/bin:$PATH ##hcjung 20230223
fi
...
if [ "${COMPILE_WITH_TOPAZ}" = "on" ]; then
## Compile TOPAZ library ##hcjung 20230223
##==============================================================
export TOPAZ_DIR=${MY_ROOT_DIR}/ROMS/Nonlinear/Biology/TOPAZ
cp -f ${COMPILERS} ${TOPAZ_DIR}/roms_topaz.mk
cd ${TOPAZ_DIR}
if [ $clean -eq 1 ]; then
make clean
fi
if [ $parallel -eq 1 ]; then
make $NCPUS | tee ./topaz_compile.log
else
make | tee ./topaz_compile.log
fi
log_line=cat ./topaz_compile.log | wc -l
if [ -f ${TOPAZ_DIR}/libtopaz.a ]; then
echo "SUCCESS :: Compile ${TOPAZ_DIR}/libtopaz.a"
else
echo "ERROR :: Cannot found ${TOPAZ_DIR}/libtopaz.a"
exit
fi
if [ "${COMPILE_WITH_TOPAZ}" = "on" ]; then
if [ ${log_line} -gt 1 ]; then ##hcjung 20230704 add reset
make clean
fi
fi
Compile (the binary will go to BINDIR set above).
if [ $parallel -eq 1 ]; then
mkdir -p ${SCRATCH_DIR}
if [ "${COMPILE_WITH_TOPAZ}" = "on" ]; then
cp -f ${TOPAZ_DIR}/libtopaz.a ${SCRATCH_DIR}/. ##hcjung 20230223 add cp
fi
make $NCPUS
else
mkdir -p ${SCRATCH_DIR}
if [ "${COMPILE_WITH_TOPAZ}" = "on" ]; then
cp -f ${TOPAZ_DIR}/libtopaz.a ${SCRATCH_DIR}/. ##hcjung 20230223 add cp
fi
make
fi
...
TOPAZ 컴파일 시스템
ROMS 컴파일 시스템
if [ $parallel -eq 1 ]; then make $NCPUS | tee ./topaz_compile.log else make | tee ./topaz_compile.log fi log_line=
cat ./topaz_compile.log | wc -l
if [ -f ${TOPAZ_DIR}/libtopaz.a ]; then echo "SUCCESS :: Compile ${TOPAZ_DIR}/libtopaz.a" else echo "ERROR :: Cannot found ${TOPAZ_DIR}/libtopaz.a" exit fi
===============================================================
fi ...
if [ "${COMPILE_WITH_TOPAZ}" = "on" ]; then if [ ${log_line} -gt 1 ]; then ##hcjung 20230704 add reset make clean fi fi
Compile (the binary will go to BINDIR set above).
if [ $parallel -eq 1 ]; then mkdir -p ${SCRATCH_DIR} if [ "${COMPILE_WITH_TOPAZ}" = "on" ]; then cp -f ${TOPAZ_DIR}/libtopaz.a ${SCRATCH_DIR}/. ##hcjung 20230223 add cp fi make $NCPUS else mkdir -p ${SCRATCH_DIR} if [ "${COMPILE_WITH_TOPAZ}" = "on" ]; then cp -f ${TOPAZ_DIR}/libtopaz.a ${SCRATCH_DIR}/. ##hcjung 20230223 add cp fi make fi ...
ifneq ($(MAKECMDGOALS),clean)
MKFILE := $(COMPILERS)/$(OS)-$(strip $(FORT)).mk ##hcjung 20230223
MKFILE := $(COMPILERS) ##hcjung 20230223 include $(MKFILE) endif
CC := icc ##hcjung 20230223 ... ifdef COMPILE_WITH_TOPAZ TOPAZ_INC := -I/home/mirae/hcjung/Model/ROMS/ROMS1158/ROMS/Nonlinear/Biology/TOPAZ FFLAGS += $(FFLAGS) $(TOPAZ_INC) TOPAZ_FFLAGS := $(FFLAGS) -stack-temps -safe-cray-ptr -ftz -assume byterecl -traceback -i4 -r8 ##hcjung 20230427 LIBS := $(SCRATCH_DIR)/libtopaz.a ##hcjung 20230223 else LIBS := endif ... ifdef USE_DEBUG TOPAZ_FFLAGS += -O0 -g ##hcjung 20230427 debug mode else TOPAZ_FFLAGS += -O3 endif ... ifdef USE_NETCDF4 NF_CONFIG ?= nf-config NETCDF_INCDIR ?= $(shell $(NF_CONFIG) --prefix)/include NETCDF_LIBDIR ?= $(shell $(NF_CONFIG) --prefix)/lib -lnetcdff ##hcjung 20230223 LIBS += $(shell $(NF_CONFIG) --flibs) INCDIR += $(NETCDF_INCDIR) $(INCDIR) else ...