@@ -41,14 +41,31 @@ def __init__(self, name: str, exec_name: str,
41
41
suite = self ._compiler .suite ,
42
42
mpi = mpi ,
43
43
availability_option = self ._compiler .availability_option )
44
- # We need to have the right version to parse the version output
45
- # So we set this function based on the function that the
46
- # wrapped compiler uses:
47
- setattr (self , "parse_version_output" , compiler .parse_version_output )
48
44
49
45
def __str__ (self ):
50
46
return f"{ type (self ).__name__ } ({ self ._compiler .name } )"
51
47
48
+ # We need to have the right version to parse the version output
49
+ # So we set this function based on the function that the
50
+ # wrapped compiler uses:
51
+ def parse_version_output (self , _ : Category , version_output : str ) -> str :
52
+ """
53
+ Extract the numerical part from a GNU compiler's version output
54
+
55
+ Overridden to use the wrapped compiler's version of the function, and
56
+ pass in the wrapped compiler's category, since the category of this
57
+ wrapper might be different.
58
+
59
+ :param category: the compiler's Category
60
+ :param version_output: the full version output from the compiler
61
+ :returns: the actual version as a string
62
+
63
+ :raises RuntimeError: if the output is not in an expected format.
64
+ """
65
+
66
+ return self .compiler .parse_version_output (
67
+ self .compiler .category , version_output )
68
+
52
69
def get_version (self ) -> Tuple [int , ...]:
53
70
"""
54
71
:returns: a tuple of at least 2 integers, representing the version
0 commit comments