Skip to content
Snippets Groups Projects
Commit aa12df56 authored by ESCOBAR MUNOZ Juan's avatar ESCOBAR MUNOZ Juan
Browse files

Juan 16/10/2023:Rules.LXarm.mk, add debug + OPENACCDEFONLY + BITREP options

parent a99b978a
No related branches found
No related tags found
No related merge requests found
......@@ -14,13 +14,16 @@ GFV=123
#
#OBJDIR_PATH=/home/escj/azertyuiopqsdfghjklm/wxcvbn/azertyuiopqsdfghjklmwxcvbn
#
OPT_BASE = -g -fno-backslash
OPT_BASE = -g -fPIC -fno-backslash -gdwarf-4
#OPT_BASE = -g -fPIC -fno-backslash
#
OPT_PERF0 = -O0 -mcpu=native
OPT_PERF2 = -O2 -mcpu=native
#TP= -mcpu=native
TP ?= -mcpu=neoverse-n1
OPT_PERF0 = -O0 $(TP)
OPT_PERF2 = -O2 $(TP)
# -mcpu=thunderx2t99 neoverse-n1
OPT_PERF3 = -O3 -mcpu=native
OPT_PERF3 = -O3 $(TP)
#-mcpu=thunderx2t99 -ffp-contract=fast
OPT_CHECK =
OPT_I8 = -i8
......@@ -50,6 +53,13 @@ OPT = $(OPT_BASE) $(OPT_PERF2)
OPT0 = $(OPT_BASE) $(OPT_PERF0)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF2)
#
# Source to compile without 'simd' or 'fma' for bit-reproductibility
BJS_REPROD= spll_mode_sum_ll.o mode_sum_ll.mod spll_mode_repro_sum.o mode_repro_sum.mod
#
# BITREP flags <-> use BR_ routines
#
MNH_BITREP = NO
#
ifeq "$(OPTLEVEL)" "DEBUG"
OPT = $(OPT_BASE) $(OPT_PERF0) $(OPT_CHECK)
OPT0 = $(OPT_BASE) $(OPT_PERF0) $(OPT_CHECK)
......@@ -57,6 +67,14 @@ OPT_NOCB = $(OPT_BASE) $(OPT_PERF0)
CFLAGS += -g -O0
endif
#
ifeq "$(OPTLEVEL)" "OPENACCDEFONLY"
CPPFLAGS += -DMNH_OPENACC -D_FAKEOPENACC
OPT = $(OPT_BASE) $(OPT_NOOPENACC) $(OPT_PERF2)
OPT0 = $(OPT_BASE) $(OPT_NOOPENACC) $(OPT_PERF0)
OPT_NOCB = $(OPT_BASE) $(OPT_NOOPENACC) $(OPT_PERF2)
CXXFLAGS = -Kieee -Mnofma $(OPT_NOOPENACC)
$(OBJS_REPROD) : OPT = $(OPT_BASE) $(OPT_NOOPENACC) $(OPT_PERF2) -ffp-contract=off
endif
ifeq "$(OPTLEVEL)" "O3"
OPT = $(OPT_BASE) $(OPT_PERF3)
OPT0 = $(OPT_BASE) $(OPT_PERF0)
......@@ -65,6 +83,7 @@ endif
#
#
CC = armclang
CXX = armclang++
FC = armflang
ifeq "$(VER_MPI)" "MPIAUTO"
F90 = mpif90
......@@ -94,7 +113,15 @@ CPPFLAGS_NEWLFI = -DSWAPIO -DLINUX -DLFI_INT=${LFI_INT}
CPPFLAGS_MNH = -DMNH -DSFX_MNH
CPPFLAGS_MNH += -imacros MNH_OPENACC_NV_CR.CPP
CPPFLAGS_MNH += -DMNH_EXPAND
#
# BITREP flags
#
#if MNH_BITREP exists => compile with the BITREP library
MNH_BITREP ?= YES
ifeq "$(MNH_BITREP)" "YES"
CPPFLAGS_MNH += -DMNH_BITREP
endif
#
ifdef VER_GA
CPPFLAGS_SURCOUCHE += -DMNH_GA
INC += -I${GA_ROOT}/include
......@@ -103,7 +130,9 @@ endif
#
# Netcdf/HDF5 flags
#
HDF_CONF= CFLAGS=-std=c99
#HDF_CONF= CFLAGS=-std=c99
NETCDF_OPT ?= $(TP) -fPIC -gdwarf-4
HDF_OPT ?= $(TP) -fPIC -std=c99 -gdwarf-4
#
## LIBTOOLS flags
#
......@@ -134,6 +163,8 @@ MNH_COMPRESS=yes
# if set to yes: use grib_api (deprecated library)
#
MNH_GRIBAPI=no
ECCODES_FFLAGS= $(TP) -gdwarf-4
ECCODES_CFLAGS= $(TP) -gdwarf-4
#
##########################################################
# #
......@@ -162,11 +193,10 @@ OBJS_I4=spll_modd_netcdf.o
$(OBJS_I4) : OPT = $(OPT_BASE_I4)
endif
ifeq ($(shell test $(GFV) -le 482 ; echo $$?),0)
ifneq "$(OPTLEVEL)" "DEBUG"
OBJS_O0= spll_lima_phillips_integ.o
$(OBJS_O0) : OPT = $(OPT_BASE) $(OPT_PERF0)
endif
OBJS_O1= spll_modd_pack_gr_field_n.o modd_pack_gr_field_n.mod spll_modd_les_n.o modd_les_n.mod spll_write_lfifm1_for_diag.o
$(OBJS_O1) : OPT = $(OPT_BASE) $(OPT_PERF1)
endif
SPLL = spll_new
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment