From 6030aa49b9c54416fba7857af8aa0f4251cc5b08 Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Tue, 27 Aug 2024 17:10:11 -0600 Subject: [PATCH 1/2] update ncar-gnu.mk template for gcc/13.2.0 --- standalone/templates/ncar-gnu.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standalone/templates/ncar-gnu.mk b/standalone/templates/ncar-gnu.mk index 7580dfa0..a60e3162 100644 --- a/standalone/templates/ncar-gnu.mk +++ b/standalone/templates/ncar-gnu.mk @@ -21,7 +21,7 @@ MAKEFLAGS += --jobs=$(shell grep '^processor' /proc/cpuinfo | wc -l) FPPFLAGS := -FFLAGS := -fcray-pointer -fdefault-double-8 -fdefault-real-8 -Waliasing -ffree-line-length-none -fno-range-check +FFLAGS := -fcray-pointer -fdefault-double-8 -fdefault-real-8 -Waliasing -ffree-line-length-none -fno-range-check -fallow-argument-mismatch FFLAGS += -I$(shell nc-config --includedir) FFLAGS += $(shell pkg-config --cflags-only-I mpich2-c) FFLAGS_OPT = -O3 @@ -79,7 +79,7 @@ ifeq ($(NETCDF),3) endif endif -LIBS := $(shell nc-config --flibs) $(shell pkg-config --libs mpich2-f90) +LIBS := $(shell nf-config --flibs) $(shell pkg-config --libs mpich2-f90) LDFLAGS += $(LIBS) #--------------------------------------------------------------------------- From ce7ea650f9fc2f8b025e884cf384637aa39434b6 Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Tue, 27 Aug 2024 17:11:53 -0600 Subject: [PATCH 2/2] make compiler a CL argument --- standalone/build/build_examples-ncar.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/standalone/build/build_examples-ncar.sh b/standalone/build/build_examples-ncar.sh index da4800e9..2e86f8a5 100755 --- a/standalone/build/build_examples-ncar.sh +++ b/standalone/build/build_examples-ncar.sh @@ -15,9 +15,27 @@ CESM_ROOT=`pwd -P` SHR_ROOT=${CESM_ROOT}/share FMS_ROOT=${CESM_ROOT}/libraries/FMS -COMPILER=intel +# Default compiler +COMPILER="intel" + +# Parse command line arguments +while [[ "$#" -gt 0 ]]; do + case $1 in + --compiler) COMPILER="$2"; shift ;; + *) echo "Unknown parameter passed: $1"; exit 1 ;; + esac + shift +done +echo "Using compiler: $COMPILER" + TEMPLATE=${TEMPLATE_DIR}/ncar-${COMPILER}.mk +# Throw error if template does not exist: +if [ ! -f $TEMPLATE ]; then + echo "ERROR: Template file $TEMPLATE does not exist. Exiting." + exit 1 +fi + if [ -e $1 ]; then BLD_ROOT=${COMPILER} else