From 3e7938ec65907cc86f253ca30375dff9f03e3581 Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Mon, 17 Apr 2023 14:31:30 +0000 Subject: [PATCH] Workaround to prevent loading of a default compiler module To prevent loading a default compiler module set COMPILER="" when calling sit. Note: Sit will not take care of unloading compiler modules manually loaded by the user Signed-off-by: Christoph Niethammer --- sit | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sit b/sit index 65cbfc4..c2d3ede 100755 --- a/sit +++ b/sit @@ -102,19 +102,21 @@ sit_info "Sit class file(s): $sit_classfile" # compiler to use # (gnu|intel|pgi) -COMPILER=${COMPILER:=${DEFAULT_COMPILER}} +COMPILER=${COMPILER=$DEFAULT_COMPILER} sit_info_verbose "Compiler: $COMPILER" # use specific compiler version COMPILER_VERSION=${COMPILER_VERSION:=} sit_info_verbose "Compiler version: $COMPILER_VERSION" -# Compiler specifications -COMPILER_CONFIG_FILE="$SIT_PATH/etc/platform-configs/${PLATFORM}/compiler/${COMPILER}" -if [ -e $COMPILER_CONFIG_FILE ] ; then - source $COMPILER_CONFIG_FILE -else - sit_fail "Could not find configuration file for compiler '${COMPILER}' on platform '${PLATFORM}'." +if [ ! -z ${COMPILER} ] ; then + # Compiler specifications if compiler != null + COMPILER_CONFIG_FILE="$SIT_PATH/etc/platform-configs/${PLATFORM}/compiler/${COMPILER}" + if [ -e $COMPILER_CONFIG_FILE ] ; then + source $COMPILER_CONFIG_FILE + else + sit_fail "Could not find configuration file for compiler '${COMPILER}' on platform '${PLATFORM}'." + fi fi