From 9babfa242ee929a255a13680f44e332b3cd8714b Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Sun, 27 Apr 2014 10:58:13 +0200 Subject: [PATCH] libem.bash: build unavailable (build) dependencies --- lib/libem.bash | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libem.bash b/lib/libem.bash index 7466c00..6fc6c31 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -183,8 +183,12 @@ function _load_build_dependencies() { m=$m/${!_V} fi if module load "$m" 2>&1 | grep -q "Unable to locate"; then - echo "Oops: Module \"$m\" not available" - return 1 + echo "Module \"$m\" not available, trying to build it..." + "${SCRIPTDIR}/${m/\/*}" + if -z $(module avail "$m" 2>&1); then + echo "Oops: Building module \"$m\" failed..." + exit 1 + fi fi echo "Loading module: $m" module load "$m"