From 8175eca34b11cc121aee1919f6f929fb122f3b4e Mon Sep 17 00:00:00 2001 From: aprilnovak Date: Tue, 10 Jan 2023 12:36:00 -0600 Subject: [PATCH] Move checks into config file for brevity --- Makefile | 22 +++------------------- config/check_deps.mk | 17 +++++++++++++++++ unit/Makefile | 22 +++------------------- 3 files changed, 23 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index 92eba9efe..e80110145 100644 --- a/Makefile +++ b/Makefile @@ -93,25 +93,9 @@ STOCHASTIC_TOOLS := yes TENSOR_MECHANICS := yes THERMAL_HYDRAULICS := yes -# First, we can find which submodules have been pulled in -MOOSE_CONTENT := $(shell ls $(MOOSE_DIR) 2> /dev/null) -NEKRS_CONTENT := $(shell ls $(NEKRS_DIR) 2> /dev/null) -OPENMC_CONTENT := $(shell ls $(OPENMC_DIR) 2> /dev/null) -DAGMC_CONTENT := $(shell ls $(DAGMC_DIR) 2> /dev/null) -MOAB_CONTENT := $(shell ls $(MOAB_DIR) 2> /dev/null) -SAM_CONTENT := $(shell ls $(SAM_DIR) 2> /dev/null) -SOCKEYE_CONTENT := $(shell ls $(SOCKEYE_DIR) 2> /dev/null) - -ifeq ($(THERMAL_HYDRAULICS), yes) - THM_CONTENT := true -endif - -SODIUM_CONTENT := $(shell ls $(SODIUM_DIR) 2> /dev/null) -POTASSIUM_CONTENT := $(shell ls $(POTASSIUM_DIR) 2> /dev/null) -IAPWS95_CONTENT := $(shell ls $(IAPWS95_DIR) 2> /dev/null) - -# Print errors if some submodules are missing or various pre-reqs for Sockeye, -# SAM, and THM optional submodules are missing or conflict with one another +# Perform various checks on the dependencies: (i) error if dependencies are +# missing or conflict with one another; (ii) warn if not using a paired +# submodule hash; (iii) check that NEKRS_HOME points to the correct location include config/check_deps.mk # BUILD_TYPE will be passed to CMake via CMAKE_BUILD_TYPE diff --git a/config/check_deps.mk b/config/check_deps.mk index c886228e6..6f8779502 100644 --- a/config/check_deps.mk +++ b/config/check_deps.mk @@ -3,6 +3,23 @@ define n endef +# First, we can find which submodules have been pulled in +MOOSE_CONTENT := $(shell ls $(MOOSE_DIR) 2> /dev/null) +NEKRS_CONTENT := $(shell ls $(NEKRS_DIR) 2> /dev/null) +OPENMC_CONTENT := $(shell ls $(OPENMC_DIR) 2> /dev/null) +DAGMC_CONTENT := $(shell ls $(DAGMC_DIR) 2> /dev/null) +MOAB_CONTENT := $(shell ls $(MOAB_DIR) 2> /dev/null) +SAM_CONTENT := $(shell ls $(SAM_DIR) 2> /dev/null) +SOCKEYE_CONTENT := $(shell ls $(SOCKEYE_DIR) 2> /dev/null) + +ifeq ($(THERMAL_HYDRAULICS), yes) + THM_CONTENT := true +endif + +SODIUM_CONTENT := $(shell ls $(SODIUM_DIR) 2> /dev/null) +POTASSIUM_CONTENT := $(shell ls $(POTASSIUM_DIR) 2> /dev/null) +IAPWS95_CONTENT := $(shell ls $(IAPWS95_DIR) 2> /dev/null) + ifeq ($(MOOSE_CONTENT),) $(error $n"MOOSE framework does not seem to be available. Make sure that either the submodule is checked out$nor that MOOSE_DIR points to a location with the MOOSE source.$n$nTo fetch the MOOSE submodule, use ./scripts/get-dependencies.sh") endif diff --git a/unit/Makefile b/unit/Makefile index b4c08862d..fb7a0119d 100644 --- a/unit/Makefile +++ b/unit/Makefile @@ -78,25 +78,9 @@ STOCHASTIC_TOOLS := yes TENSOR_MECHANICS := yes THERMAL_HYDRAULICS := yes -# First, we can find which submodules have been pulled in -MOOSE_CONTENT := $(shell ls $(MOOSE_DIR) 2> /dev/null) -NEKRS_CONTENT := $(shell ls $(NEKRS_DIR) 2> /dev/null) -OPENMC_CONTENT := $(shell ls $(OPENMC_DIR) 2> /dev/null) -DAGMC_CONTENT := $(shell ls $(DAGMC_DIR) 2> /dev/null) -MOAB_CONTENT := $(shell ls $(MOAB_DIR) 2> /dev/null) -SAM_CONTENT := $(shell ls $(SAM_DIR) 2> /dev/null) -SOCKEYE_CONTENT := $(shell ls $(SOCKEYE_DIR) 2> /dev/null) - -ifeq ($(THERMAL_HYDRAULICS), yes) - THM_CONTENT := true -endif - -SODIUM_CONTENT := $(shell ls $(SODIUM_DIR) 2> /dev/null) -POTASSIUM_CONTENT := $(shell ls $(POTASSIUM_DIR) 2> /dev/null) -IAPWS95_CONTENT := $(shell ls $(IAPWS95_DIR) 2> /dev/null) - -# Print errors if some submodules are missing or various pre-reqs for Sockeye, -# SAM, and THM optional submodules are missing or conflict with one another +# Perform various checks on the dependencies: (i) error if dependencies are +# missing or conflict with one another; (ii) warn if not using a paired +# submodule hash; (iii) check that NEKRS_HOME points to the correct location include $(CARDINAL_DIR)/config/check_deps.mk # BUILD_TYPE will be passed to CMake via CMAKE_BUILD_TYPE