-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMkinclude
106 lines (86 loc) · 2.67 KB
/
Mkinclude
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.DEFAULT_GOAL := all
INST_DIR = $(TOPDIR)
DCUTILSDIR = $(TOPDIR)/dc_utils
SCALEFELIBDIR = $(TOPDIR)/FElib
GLOBALSWDIR = $(TOPDIR)/model/global_shallow_water
ATMNONHYDRO2DDIR = $(TOPDIR)/model/atm_nonhydro2d
ATMNONHYDRO3DDIR = $(TOPDIR)/model/atm_nonhydro3d
ifeq ($(SCALE_DEBUG),T)
FFLAGS = $(FFLAGS_DEBUG) $(FFLAGS_SYSDEPEND) -DDEBUG
CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_SYSDEPEND)
POSTFIX = _debug
else
FFLAGS = $(FFLAGS_FAST) $(FFLAGS_SYSDEPEND)
CFLAGS = $(CFLAGS_FAST) $(CFLAGS_SYSDEPEND)
ifeq ($(SCALE_USE_AGGRESSIVEOPT),T)
FFLAGS += $(FFLAGS_AGGRESSIVE)
CFLAGS += $(CFLAGS_AGGRESSIVE)
endif
ifeq ($(SCALE_QUICKDEBUG),T)
FFLAGS += $(FFLAGS_QUICKDEBUG) -DQUICKDEBUG
POSTFIX = _quickdebug
else
POSTFIX =
endif
endif
ifeq ($(findstring undefined, $(origin BUILD_DIR) $(BUILD_DIR)), undefined)
BUILD_DIR = $(abspath ./.libs$(POSTFIX))
endif
ifeq ($(SCALE_USE_SINGLEFP),T)
FFLAGS += -DSINGLE
endif
ifeq ($(SCALE_ENABLE_OPENMP),T)
FFLAGS += $(FFLAGS_OPENMP)
endif
ifeq ($(SCALE_ENABLE_OPENACC),T)
FFLAGS += $(FFLAGS_OPENACC)
endif
ifeq ($(SCALE_DEVELOP),T)
FFLAGS += -DSCALE_DEVELOP
endif
# ----
ifeq ($(origin BINDIR),undefined)
BINDIR = $(INST_DIR)/bin
endif
ifeq ($(origin LIBDIR),undefined)
LIBDIR = $(INST_DIR)/lib
endif
ifeq ($(origin MODDIR),undefined)
MODDIR = $(INST_DIR)/include$(POSTFIX)
endif
# SCALE library
ifeq ($(origin SCALE_LIBNAME),undefined)
SCALE_LIBNAME=libscale.a
endif
SCALE_INCLUDE = -I$(MODDIR)/scalelib -I$(SCALE)/scalelib/include
SCALE_LIBS = -L$(LIBDIR) -lscale_sub$(POSTFIX) -L$(SCALE)/lib -ldcutils
FFLAGS += $(SCALE_INCLUDE)
CONTRIB_LIBS = $(SCALE_LIBS)
CONTRIB_INCLUDE = $(SCALE_INCLUDE)
# NetCDF library setting
# library location are inquired in order of: environment variable->Makedef.XXX->here
include $(TOPDIR)/utils/make/Make_checknetcdf
ifeq ($(SCALE_ENABLE_PNETCDF),T)
SCALE_NETCDF_INCLUDE += -DPNETCDF
ifeq ($(shell pnetcdf-config --help > /dev/null 2>&1 && echo yes),yes)
SCALE_NETCDF_INCLUDE += $(shell pnetcdf-config --cppflags) -I$(shell pnetcdf-config --includedir)
SCALE_NETCDF_LIBS := -L$(shell pnetcdf-config --libdir) -lpnetcdf $(SCALE_NETCDF_LIBS)
endif
endif
ifeq ($(SCALE_COMPAT_NETCDF3),T)
CFLAGS += -DNETCDF3
endif
# Math library setting
# library location are inquired in order of: environment variable->Makedef.XXX
ifeq ($(SCALE_ENABLE_MATHLIB),T)
FFLAGS += -DMATHLIB
endif
# PAPI library setting
# library location are inquired in order of: environment variable->Makedef.XXX
ifeq ($(SCALE_ENABLE_PAPI),T)
FFLAGS += -DPAPI
endif
# TEST CASE
ifneq ($(origin FFLAG_TESTCASE), undefined)
FFLAGS += $(FFLAG_TESTCASE)
endif