-
Notifications
You must be signed in to change notification settings - Fork 5
/
cerberus.rules
102 lines (94 loc) · 3.99 KB
/
cerberus.rules
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
export RED YELLOW GREEN END
export DEBUG USE_MPI TINY_PROFILE PYTHON_PLOT fc_CCACHE_EXEC_NOT_FOUND
export fc_OMP_ENABLED
export fc_EB_NO_USER_WRONG_DIM fc_EB_NO_USER fc_EB_WRONG_DIM
export fc_PARTICLES_NO_USER fc_PARTICLES_WRONG_DIM
export fc_EILMER_NO_USER EILMER_GAS
export SYMPLECTIC
# store the executable name
EXEC_PATH:=$(.DEFAULT_GOAL)
ifneq ($(BUILD_ACTUAL), TRUE)
.DEFAULT_GOAL = cerberus
endif
ifeq ($(BUILD_ACTUAL), TRUE)
$(info ${GREEN}Building $(.DEFAULT_GOAL)${END})
endif
.PHONY: cerberus
cerberus: build_flags_check
ifeq ($(EILMER_INSTALL_LIB), TRUE)
@echo "${GREEN}Building UQ GDTk with flavour ${EILMER_COMPILE_FLAVOUR}${END}";\
EILMER_SRC='$(EILMER_SRC)' EILMER_HOME='$(EILMER_HOME)' EILMER_URL='$(EILMER_URL)' EILMER_FLAVOUR='$(EILMER_COMPILE_FLAVOUR)' MF='$(MAKEFLAGS)' $(TOP)/build_eilmer.sh
endif
@$(MAKE) BUILD_ACTUAL=TRUE
@echo "${GREEN}${EXEC_PATH} has been generated${END}";\
.PHONY: clean_eilmer_git
clean_eilmer_git:
$(MAKE) -C $(EILMER_SRC)/src/gas clean
$(MAKE) -C $(EILMER_SRC)/src/eilmer clean
$(MAKE) -C $(EILMER_SRC)/extern/lua-5.4.3 clean
.PHONY: clean_all
clean_all: clean_eilmer_git
rm -rf $(BUILDDIR)
.PHONY: develop
develop:
@echo "${GREEN}Beginning development build of cerberus${END}";\
bear -- $(MAKE) cerberus DEBUG=TRUE VERBOSE=TRUE USE_MPI=FALSE;\
echo "${GREEN}compile_commands.json generated${END}";\
.PHONY: develop_eilmer
develop_eilmer:
@echo "${GREEN}Beginning development build of cerberus+eilmer${END}";\
bear -- $(MAKE) cerberus DEBUG=TRUE EILMER_GAS=TRUE VERBOSE=TRUE USE_MPI=FALSE;\
echo "${GREEN}compile_commands.json generated${END}";\
.PHONY: build_flags_check
build_flags_check:
@echo "${YELLOW}Checking build flags${END}"; \
if [ "$(DEBUG)" = TRUE ]; then \
echo "${RED}BUILDING IN DEBUG MODE${END}"; \
fi; \
if [ "$(fc_DIM_NO_USER)" = TRUE ]; then \
echo "${YELLOW}DIM not set by user. Defaulting to 2${END}"; \
fi; \
if [ "$(USE_MPI)" = FALSE ]; then \
echo "${RED}MPI is disabled${END}"; \
fi; \
if [ "$(fc_OMP_ENABLED)" = TRUE ]; then \
echo "${RED}USE_OMP flag is not supported. Forcing to FALSE${END}"; \
fi; \
if [ "$(fc_EB_NO_USER_WRONG_DIM)" = TRUE ]; then \
echo "${YELLOW}USE_EB not set by user. Defaulting to FALSE since DIM=1${END}"; \
fi; \
if [ "$(fc_EB_NO_USER)" = TRUE ]; then \
echo "${YELLOW}USE_EB not set by user. Defaulting to TRUE since DIM > 1${END}"; \
fi; \
if [ "$(fc_EB_WRONG_DIM)" = TRUE ]; then \
echo "${RED}Forcing USE_EB=FALSE as DIM=1${END}"; \
fi; \
if [ "$(fc_PARTICLES_NO_USER_WRONG_DIM)" = TRUE ]; then \
echo "${YELLOW}AMREX_PARTICLES not set by user. Defaulting to FALSE since DIM=1${END}"; \
fi; \
if [ "$(fc_PARTICLES_NO_USER)" = TRUE ]; then \
echo "${YELLOW}AMREX_PARTICLES not set by user. Defaulting to TRUE since DIM > 1${END}"; \
fi; \
if [ "$(fc_PARTICLES_WRONG_DIM)" = TRUE ]; then \
echo "${RED}Forcing AMREX_PARTICLES=FALSE as DIM=1${END}"; \
fi; \
if [ "$(fc_EILMER_NO_USER)" = TRUE ]; then \
echo "${YELLOW}EILMER_GAS not set by user. Defaulting to FALSE${END}"; \
fi; \
if [ "$(TINY_PROFILE)" = TRUE ]; then \
echo "${YELLOW}TINY_PROFILE=TRUE. A timing table will be output at the end of each simulation${END}"; \
fi; \
if [ "$PYTHON_PLOT)" = TRUE ]; then \
echo "${YELLOW}(experimental) PYTHON_PLOT=TRUE. Building with python diagnostic support${END}"; \
fi; \
if [ "$(SYMPLECTIC)" = P8R2 ]; then \
echo "${YELLOW}(experimental) SYMPLECTIC=P8R2. Building with SYMPLECTIC support${END}"; \
elif [ "$(SYMPLECTIC)" = WL ]; then \
echo "${YELLOW}(experimental) SYMPLECTIC=PWL. Building with SYMPLECTIC support${END}"; \
fi; \
if [ "$(fc_CCACHE_EXEC_NOT_FOUND)" = TRUE ]; then \
echo "${YELLOW}USE_CCACHE=TRUE, but 'ccache' command can't be found. Forcing USE_CCACHE=FALSE${END}"; \
fi; \
if [ "$(USE_CCACHE)" = TRUE ]; then \
echo "${GREEN}Using ccache to speed up re-compilation${END}"; \
fi