Skip to content

Commit

Permalink
Follow a more consistent naming scheme for crays, even though the nat…
Browse files Browse the repository at this point in the history
…ive compiler names are longer (crayftn-cray, craycc-cray).
  • Loading branch information
hiker committed Oct 22, 2024
1 parent 8771e80 commit 0188050
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
21 changes: 13 additions & 8 deletions source/fab/tools/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,11 @@ def run_version_command(
# Cray compiler
# ============================================================================
class Craycc(CCompiler):
'''Class for the native Cray C compiler. Cray has two different compilers.
Older ones have as version number:
'''Class for the native Cray C compiler. Since cc is actually a compiler
wrapper, follow the naming scheme of a compiler wrapper and call it:
craycc-cray.
Cray has two different compilers. Older ones have as version number:
Cray C : Version 8.7.0 Tue Jul 23, 2024 07:39:46
Newer compiler (several lines, the important one):
Cray clang version 15.0.1 (66f7391d6a03cf932f321b9f6b1d8612ef5f362c)
Expand All @@ -521,24 +524,26 @@ class Craycc(CCompiler):
:param name: name of this compiler.
:param exec_name: name of the executable.
'''
def __init__(self, name: str = "craycc", exec_name: str = "craycc"):
def __init__(self, name: str = "craycc-cray", exec_name: str = "cc"):
super().__init__(name, exec_name, suite="cray", mpi=True,
openmp_flag="-qopenmp",
openmp_flag="-homp",
version_regex=r"Cray [Cc][^\d]* (\d[\d\.]+\d) ")


# ============================================================================
class Crayftn(FortranCompiler):
'''Class for the native Cray Fortran compiler.
'''Class for the native Cray Fortran compiler. Since ftn is actually a
compiler wrapper, follow the naming scheme of Cray compiler wrapper
and call it crayftn-cray.
:param name: name of this compiler.
:param exec_name: name of the executable.
'''

def __init__(self, name: str = "crayftn", exec_name: str = "crayftn"):
def __init__(self, name: str = "crayftn-cray", exec_name: str = "ftn"):
super().__init__(name, exec_name, suite="cray", mpi=True,
module_folder_flag="-module",
openmp_flag="-qopenmp",
module_folder_flag="-J",
openmp_flag="-homp",
syntax_only_flag="-syntax-only",
version_regex=(r"Cray Fortran : Version "
r"(\d[\d\.]+\d) "))
4 changes: 2 additions & 2 deletions tests/unit_tests/tools/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ def test_nvfortran_get_version_with_ifort_string():
def test_craycc():
'''Tests the Craycc class.'''
craycc = Craycc()
assert craycc.name == "craycc"
assert craycc.name == "craycc-cray"
assert isinstance(craycc, CCompiler)
assert craycc.category == Category.C_COMPILER
assert craycc.mpi
Expand Down Expand Up @@ -882,7 +882,7 @@ def test_craycc_get_version_with_icc_string():
def test_crayftn():
'''Tests the Crayftn class.'''
crayftn = Crayftn()
assert crayftn.name == "crayftn"
assert crayftn.name == "crayftn-cray"
assert isinstance(crayftn, FortranCompiler)
assert crayftn.category == Category.FORTRAN_COMPILER
assert crayftn.mpi
Expand Down

0 comments on commit 0188050

Please sign in to comment.