@@ -57,51 +57,53 @@ def __init__(self, *args, **kwargs):
57
57
# comparing subversions that include letters causes TypeErrors in Python 3
58
58
# 'a' is assumed to be equivalent with '.01' (January), and 'b' with '.07' (June)
59
59
# (good enough for this purpose)
60
- self .iimpi_ver = LooseVersion (self .version .replace ('a' , '.01' ).replace ('b' , '.07' ))
61
- if self .iimpi_ver >= LooseVersion ('2020.12' ):
62
- self .SUBTOOLCHAIN = IntelCompilersToolchain .NAME
63
- self .COMPILER_MODULE_NAME = IntelCompilersToolchain .COMPILER_MODULE_NAME
64
- else :
65
- self .SUBTOOLCHAIN = IccIfort .NAME
66
- self .COMPILER_MODULE_NAME = IccIfort .COMPILER_MODULE_NAME
60
+ self .iimpi_ver = self .version .replace ('a' , '.01' ).replace ('b' , '.07' )
67
61
else :
68
62
self .iimpi_ver = self .version
69
63
64
+ if self .oneapi_gen :
65
+ self .SUBTOOLCHAIN = IntelCompilersToolchain .NAME
66
+ self .COMPILER_MODULE_NAME = IntelCompilersToolchain .COMPILER_MODULE_NAME
67
+ else :
68
+ self .SUBTOOLCHAIN = IccIfort .NAME
69
+ self .COMPILER_MODULE_NAME = IccIfort .COMPILER_MODULE_NAME
70
+
70
71
def is_deprecated (self ):
71
72
"""Return whether or not this toolchain is deprecated."""
72
73
73
74
deprecated = False
74
75
75
76
# make sure a non-symbolic version (e.g., 'system') is used before making comparisons using LooseVersion
76
77
if re .match ('^[0-9]' , str (self .iimpi_ver )):
78
+ loosever = LooseVersion (self .iimpi_ver )
77
79
# iimpi toolchains older than iimpi/2016.01 are deprecated
78
80
# iimpi 8.1.5 is an exception, since it used in intel/2016a (which is not deprecated yet)
79
- if self . iimpi_ver < LooseVersion ('8.0' ):
81
+ if loosever < LooseVersion ('8.0' ):
80
82
deprecated = True
81
- elif self . iimpi_ver > LooseVersion ('2000' ) and self . iimpi_ver < LooseVersion ('2016.01' ):
83
+ elif loosever > LooseVersion ('2000' ) and loosever < LooseVersion ('2016.01' ):
82
84
deprecated = True
83
85
84
86
return deprecated
85
87
86
88
def is_dep_in_toolchain_module (self , * args , ** kwargs ):
87
89
"""Check whether a specific software name is listed as a dependency in the module for this toolchain."""
88
- if re .match ('^[0-9]' , str (self .iimpi_ver )) and self .iimpi_ver < LooseVersion ('2020.12' ):
89
- res = IccIfort .is_dep_in_toolchain_module (self , * args , ** kwargs )
90
- else :
90
+ if self .oneapi_gen :
91
91
res = IntelCompilersToolchain .is_dep_in_toolchain_module (self , * args , ** kwargs )
92
+ else :
93
+ res = IccIfort .is_dep_in_toolchain_module (self , * args , ** kwargs )
92
94
93
95
return res
94
96
95
97
def _set_compiler_vars (self ):
96
98
"""Intel compilers-specific adjustments after setting compiler variables."""
97
- if re .match ('^[0-9]' , str (self .iimpi_ver )) and self .iimpi_ver < LooseVersion ('2020.12' ):
98
- IccIfort ._set_compiler_vars (self )
99
- else :
99
+ if self .oneapi_gen :
100
100
IntelCompilersToolchain ._set_compiler_vars (self )
101
+ else :
102
+ IccIfort ._set_compiler_vars (self )
101
103
102
104
def set_variables (self ):
103
105
"""Intel compilers-specific adjustments after setting compiler variables."""
104
- if re .match ('^[0-9]' , str (self .iimpi_ver )) and self .iimpi_ver < LooseVersion ('2020.12' ):
105
- IccIfort .set_variables (self )
106
- else :
106
+ if self .oneapi_gen :
107
107
IntelCompilersToolchain .set_variables (self )
108
+ else :
109
+ IccIfort .set_variables (self )
0 commit comments