Skip to content

Commit

Permalink
Merge remote-tracking branch 'alper_compiler_fork/standalone_gnu_buil…
Browse files Browse the repository at this point in the history
…d' into 138-set-up-github-actions-ci-testing

The github workflow MOM6 Build is not compiling correctly. It could be
because of the compiler, which is using gnu by default
  • Loading branch information
manishvenu committed Aug 28, 2024
2 parents 8d8129a + ce7ea65 commit e5a9fa2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion standalone/build/build_examples-ncar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions standalone/templates/ncar-gnu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

#---------------------------------------------------------------------------
Expand Down

0 comments on commit e5a9fa2

Please sign in to comment.