Skip to content

Commit

Permalink
Move checks into config file for brevity
Browse files Browse the repository at this point in the history
  • Loading branch information
aprilnovak committed Jan 10, 2023
1 parent c8be078 commit 8175eca
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 38 deletions.
22 changes: 3 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions config/check_deps.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 3 additions & 19 deletions unit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8175eca

Please sign in to comment.