Skip to content

Commit

Permalink
Only use module depends on if the module tool supports it
Browse files Browse the repository at this point in the history
  • Loading branch information
Micket committed Sep 18, 2024
1 parent faa3b21 commit 9361e6e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions easybuild/tools/module_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,7 @@ def load_module(self, mod_name, recursive_unload=None, depends_on=False, unload_
body.extend([self.unload_module(m).strip() for m in unload_modules])
load_template = self.LOAD_TEMPLATE
# Lmod 7.6.1+ supports depends-on which does this most nicely:
if build_option('mod_depends_on') or depends_on:
if not self.modules_tool.supports_depends_on:
raise EasyBuildError("depends-on statements in generated module are not supported by modules tool")
if (build_option('mod_depends_on') or depends_on) and self.modules_tool.supports_depends_on:
load_template = self.LOAD_TEMPLATE_DEPENDS_ON

body.append(load_template)
Expand Down Expand Up @@ -1320,9 +1318,7 @@ def load_module(self, mod_name, recursive_unload=None, depends_on=False, unload_

load_template = self.LOAD_TEMPLATE
# Lmod 7.6+ supports depends_on which does this most nicely:
if build_option('mod_depends_on') or depends_on:
if not self.modules_tool.supports_depends_on:
raise EasyBuildError("depends_on statements in generated module are not supported by modules tool")
if (build_option('mod_depends_on') or depends_on) and self.modules_tool.supports_depends_on:
load_template = self.LOAD_TEMPLATE_DEPENDS_ON

body.append(load_template)
Expand Down

0 comments on commit 9361e6e

Please sign in to comment.