Skip to content

Commit c6046a2

Browse files
committed
Implement suggested way to determine compiler version
1 parent 7e3fefc commit c6046a2

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • easybuild/toolchains/compiler

easybuild/toolchains/compiler/gcc.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
import easybuild.tools.systemtools as systemtools
3636
from easybuild.tools.build_log import EasyBuildError
37-
from easybuild.tools.modules import get_software_root
37+
from easybuild.tools.modules import get_software_root, get_software_version
3838
from easybuild.tools.toolchain.compiler import Compiler
3939

4040

@@ -126,7 +126,12 @@ def _set_optimal_architecture(self, default_optarch=None):
126126
(--optarch and --optarch=GENERIC still override this value)
127127
"""
128128
if default_optarch is None and self.arch == systemtools.AARCH64:
129-
gcc_version = self.get_software_version(self.COMPILER_MODULE_NAME)[0]
129+
gcc_version = get_software_version('GCCcore')
130+
if gcc_version is None:
131+
gcc_version = get_software_version('GCC')
132+
if gcc_version is None:
133+
raise EasyBuildError("Failed to determine software version for GCC")
134+
130135
if LooseVersion(gcc_version) < LooseVersion('6'):
131136
# on AArch64, -mcpu=native is not supported prior to GCC 6,
132137
# so try to guess a proper default optarch is none was specified

0 commit comments

Comments
 (0)