|
|
@@ -18,18 +18,16 @@ if(avail_mods)
|
|
|
|
|
|
message("module list")
|
|
|
env_module_list(loaded_mods)
|
|
|
+ set(mod0_found FALSE)
|
|
|
foreach(mod IN LISTS loaded_mods)
|
|
|
message(" ${mod}")
|
|
|
+ if(NOT mod0_found AND mod MATCHES "^${mod0}")
|
|
|
+ set(mod0_found ${mod})
|
|
|
+ endif()
|
|
|
endforeach()
|
|
|
|
|
|
- list(LENGTH loaded_mods num_loaded_mods)
|
|
|
- message("Number of modules loaded: ${num_loaded_mods}")
|
|
|
- if(NOT num_loaded_mods EQUAL 1)
|
|
|
- message(FATAL_ERROR "Exactly 1 module should be loaded. Found ${num_loaded_mods}")
|
|
|
- endif()
|
|
|
-
|
|
|
- list(GET loaded_mods 0 mod0_actual)
|
|
|
- if(NOT (mod0_actual MATCHES "^${mod0}"))
|
|
|
- message(FATAL_ERROR "Loaded module does not match ${mod0}. Actual: ${mod0_actual}")
|
|
|
+ if(NOT mod0_found)
|
|
|
+ message(FATAL_ERROR "Requested module ${mod0} not found in loaded modules")
|
|
|
endif()
|
|
|
+ message("module ${mod0} found loaded as ${mod0_found}")
|
|
|
endif()
|