From a3eb09c582142ba31a5a865a89bc93aa216c54cd Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Thu, 23 Dec 2021 14:29:51 +0100 Subject: [PATCH] don't grep for specific version in --version output of Intel compiler commands for versions 2022.x --- easybuild/easyblocks/i/intel_compilers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/easybuild/easyblocks/i/intel_compilers.py b/easybuild/easyblocks/i/intel_compilers.py index 9b40365ded..716eb8bf6f 100644 --- a/easybuild/easyblocks/i/intel_compilers.py +++ b/easybuild/easyblocks/i/intel_compilers.py @@ -110,7 +110,13 @@ def sanity_check_step(self): all_compiler_cmds = classic_compiler_cmds + oneapi_compiler_cmds custom_commands = ["which %s" % c for c in all_compiler_cmds] - custom_commands.extend("%s --version | grep %s" % (c, self.version) for c in all_compiler_cmds) + + # only for 2021.x versions do all compiler commands have the expected version; + # for example: for 2022.0.1, icc has version 2021.5.0, icpx has 2022.0.0 + if LooseVersion(self.version) >= LooseVersion('2022.0'): + custom_commands.extend("%s --version" % c for c in all_compiler_cmds) + else: + custom_commands.extend("%s --version | grep %s" % (c, self.version) for c in all_compiler_cmds) super(EB_intel_minus_compilers, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)