Newer
Older

WAUTELET Philippe
committed
#MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier

Juan Escobar
committed
#MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence

WAUTELET Philippe
committed
#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt

Juan Escobar
committed
#MNH_LIC for details. version 1.
##########################################################
# #
# Compiler Options #
# #
##########################################################
#
# Gfortran version
#GFV=$(shell gfortran --version | grep -E -m1 -o ' [[:digit:]\.]{2,}( |$$)' | sed 's/\.//g' )
GFV=123
#
#OBJDIR_PATH=/home/escj/azertyuiopqsdfghjklm/wxcvbn/azertyuiopqsdfghjklmwxcvbn
#

ESCOBAR MUNOZ Juan
committed
OPT_BASE = -g -fPIC -fno-backslash -gdwarf-4

Juan Escobar
committed
#OPT_BASE = -g -fPIC -fno-backslash
#

ESCOBAR MUNOZ Juan
committed
#TP= -mcpu=native
TP ?= -mcpu=neoverse-n1
OPT_PERF0 = -O0 $(TP)
OPT_PERF2 = -O2 $(TP)

ESCOBAR MUNOZ Juan
committed
# -mcpu=thunderx2t99 neoverse-n1

ESCOBAR MUNOZ Juan
committed
OPT_PERF3 = -O3 $(TP)

ESCOBAR MUNOZ Juan
committed
#-mcpu=thunderx2t99 -ffp-contract=fast

Juan Escobar
committed
OPT_CHECK =
OPT_I8 = -i8
OPT_R8 = -r8
#
#
# Real/Integer 4/8 option
#
MNH_REAL ?=8
MNH_INT ?=4
#
#
ifneq "$(MNH_REAL)" "4"
OPT_BASE += $(OPT_R8)
endif
#
OPT_BASE_I4 := $(OPT_BASE)
ifeq "$(MNH_INT)" "8"
OPT_BASE += $(OPT_I8)
LFI_INT ?=8
else
LFI_INT ?=4
endif
#
#
OPT = $(OPT_BASE) $(OPT_PERF2)
OPT0 = $(OPT_BASE) $(OPT_PERF0)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF2)
#

ESCOBAR MUNOZ Juan
committed
# 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
#

Juan Escobar
committed
ifeq "$(OPTLEVEL)" "DEBUG"
OPT = $(OPT_BASE) $(OPT_PERF0) $(OPT_CHECK)
OPT0 = $(OPT_BASE) $(OPT_PERF0) $(OPT_CHECK)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF0)
CFLAGS += -g -O0
endif
#

ESCOBAR MUNOZ Juan
committed
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

Juan Escobar
committed
ifeq "$(OPTLEVEL)" "O3"
OPT = $(OPT_BASE) $(OPT_PERF3)
OPT0 = $(OPT_BASE) $(OPT_PERF0)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF3)
endif
#
#
CC = armclang

ESCOBAR MUNOZ Juan
committed
CXX = armclang++

ESCOBAR MUNOZ Juan
committed
#CC = gcc
#CXX = g++

Juan Escobar
committed
FC = armflang
ifeq "$(VER_MPI)" "MPIAUTO"
F90 = mpif90
CPPFLAGS_SURCOUCHE += -DMNH_USE_MPI_STATUSES_IGNORE
else
F90 = armflang
endif
#
F90FLAGS = $(OPT)
F77 = $(F90)
F77FLAGS = $(OPT)
FX90 = $(F90)
FX90FLAGS = $(OPT)
#
#LDFLAGS = -Wl,-warn-once
#
# preprocessing flags
#

ESCOBAR MUNOZ Juan
committed
#CPP = cpp -P -traditional -Wcomment
CPP = mnh_expand

Juan Escobar
committed
#

ESCOBAR MUNOZ Juan
committed
CPPFLAGS_C += -DLITTLE_endian

Juan Escobar
committed
CPPFLAGS_SURFEX =
CPPFLAGS_SURCOUCHE += -DDEV_NULL

Juan Escobar
committed
CPPFLAGS_RAD =
CPPFLAGS_NEWLFI = -DSWAPIO -DLINUX -DLFI_INT=${LFI_INT}

ESCOBAR MUNOZ Juan
committed
CPPFLAGS_MNH = -DMNH=MNH -DSFX_MNH

ESCOBAR MUNOZ Juan
committed
CPPFLAGS_MNH += -imacros MNH_OPENACC_NV_CR.CPP
CPPFLAGS_MNH += -DMNH_EXPAND

ESCOBAR MUNOZ Juan
committed
#
# BITREP flags
#
#if MNH_BITREP exists => compile with the BITREP library
MNH_BITREP ?= YES
ifeq "$(MNH_BITREP)" "YES"
CPPFLAGS_MNH += -DMNH_BITREP
endif
#

Juan Escobar
committed
ifdef VER_GA
CPPFLAGS_SURCOUCHE += -DMNH_GA
INC += -I${GA_ROOT}/include
LIBS += -L${GA_ROOT}/lib -larmci -lga
endif
#
# Netcdf/HDF5 flags
#

ESCOBAR MUNOZ Juan
committed
#HDF_CONF= CFLAGS=-std=c99
NETCDF_OPT ?= $(TP) -fPIC -gdwarf-4
HDF_OPT ?= $(TP) -fPIC -std=c99 -gdwarf-4

Juan Escobar
committed
#
## LIBTOOLS flags
#
#if MNH_TOOLS exists => compile the tools if gfortran >= 5.X
ifeq "$(MNH_INT)" "4"
ifeq ($(shell test $(GFV) -ge 500 ; echo $$?),0)
MNH_TOOLS=yes
endif
endif
#

WAUTELET Philippe
committed
## IOLFI flag
#
#if MNH_IOLFI exists => compile the NEWLFI library (for LFI files)
MNH_IOLFI=yes
#
## COMPRESS flag

Juan Escobar
committed
#
#if MNH_COMPRESS exists => compile the COMPRESS library (for LFI files)
MNH_COMPRESS=yes

Juan Escobar
committed
#

WAUTELET Philippe
committed
## S4PY flag
#
#if MNH_S4PY exists => compile the libs4py library (for epygram)
#MNH_S4PY=no

Juan Escobar
committed
#

WAUTELET Philippe
committed
## MGSOLVER flag (multigrid solver)
#
#if MNH_MGSOLVER exists => compile the multigrid solver
MNH_MGSOLVER ?= YES
#

WAUTELET Philippe
committed
## ecCodes or grib_api selection
#MNH_GRIBAPI: if set to no: use ecCodes
# if set to yes: use grib_api (deprecated library)
#
MNH_GRIBAPI=no

ESCOBAR MUNOZ Juan
committed
ECCODES_FFLAGS= $(TP) -gdwarf-4
ECCODES_CFLAGS= $(TP) -gdwarf-4

WAUTELET Philippe
committed
#

Juan Escobar
committed
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
##########################################################
# #
# Source of MESONH PACKAGE Distribution #
# #
##########################################################
#
include Makefile.MESONH.mk
#
##########################################################
# #
# extra VPATH, Compilation flag modification #
# systeme module , etc ... #
# external precompiled module librairie #
# etc ... #
# #
##########################################################
ifneq "$(findstring 8,$(LFI_INT))" ""
OBJS_I8=spll_NEWLFI_ALL.o
$(OBJS_I8) : OPT = $(OPT_BASE) $(OPT_PERF2) $(OPT_I8)
endif
ifeq "$(MNH_INT)" "8"
OBJS_I4=spll_modd_netcdf.o
$(OBJS_I4) : OPT = $(OPT_BASE_I4)
endif
ifneq "$(OPTLEVEL)" "DEBUG"

ESCOBAR MUNOZ Juan
committed
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)

Juan Escobar
committed
endif

ESCOBAR MUNOZ Juan
committed

ESCOBAR MUNOZ Juan
committed
SPLL = spll_new