Skip to content

Commit

Permalink
Fix detection of rdbfsmua modulefile
Browse files Browse the repository at this point in the history
Build script was checking for the existance of a modulefile for rdbfmsua,
but did not include the '.lua' that exists in the filename. Changed the
detection to instead try to load the file and detect when there is an
error.
  • Loading branch information
WalterKolczynski-NOAA committed Mar 19, 2024
1 parent 7a71132 commit 3ab4a79
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ush/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@ mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}"

# Configure, build, install
set -x
# shellcheck disable=SC2086
cmake ${CMAKE_OPTS} "${DIR_ROOT}"
make -j "${BUILD_JOBS:-8}" VERBOSE="${BUILD_VERBOSE:-}"
make install
set +x

# Build rdbfmsua.x with makefile separately due to GEMPAK issues in cmake
# Load modules
if [[ -f "${DIR_ROOT}/modulefiles/rdbfmsua_${MACHINE_ID}.${COMPILER}" ]]; then
source "${DIR_ROOT}/ush/module-setup.sh"
module use "${DIR_ROOT}/modulefiles"
module load "rdbfmsua_${MACHINE_ID}.${COMPILER}"
source "${DIR_ROOT}/ush/module-setup.sh"
module use "${DIR_ROOT}/modulefiles"
if module load "rdbfmsua_${MACHINE_ID}.${COMPILER}" &> /dev/null; then
module list
else
echo "No modulefile for 'rdbfmsua' on '${MACHINE_ID}'. Skip building 'rdbfmsua.x'"
echo "WARNING: Unable to load modelfile for 'rdbfmsua' on '${MACHINE_ID}' (does it exist?)."
echo " Skipping building 'rdbfmsua.x'"
exit 0
fi

Expand Down

0 comments on commit 3ab4a79

Please sign in to comment.