Don't detect "classic" on Cray to avoid a compiler bug (#17314)

* Don't detect "classic" on Cray to avoid a compiler bug

* add tests

Co-authored-by: Gregory Becker <becker33@llnl.gov>
This commit is contained in:
Massimiliano Culpo 2020-06-30 22:45:29 +02:00 committed by GitHub
parent 1d55adfd2b
commit 486b4671b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View File

@ -91,16 +91,24 @@ def c11_flag(self):
@property @property
def cc_pic_flag(self): def cc_pic_flag(self):
if self.is_clang_based:
return "-fPIC"
return "-h PIC" return "-h PIC"
@property @property
def cxx_pic_flag(self): def cxx_pic_flag(self):
if self.is_clang_based:
return "-fPIC"
return "-h PIC" return "-h PIC"
@property @property
def f77_pic_flag(self): def f77_pic_flag(self):
if self.is_clang_based:
return "-fPIC"
return "-h PIC" return "-h PIC"
@property @property
def fc_pic_flag(self): def fc_pic_flag(self):
if self.is_clang_based:
return "-fPIC"
return "-h PIC" return "-h PIC"

View File

@ -146,7 +146,8 @@ def detect_version(self, detect_version_args):
compiler_cls.PrgEnv_compiler compiler_cls.PrgEnv_compiler
) )
matches = re.findall(version_regex, output) matches = re.findall(version_regex, output)
version = tuple(version for _, version in matches) version = tuple(version for _, version in matches
if 'classic' not in version)
compiler_id = detect_version_args.id compiler_id = detect_version_args.id
value = detect_version_args._replace( value = detect_version_args._replace(
id=compiler_id._replace(version=version) id=compiler_id._replace(version=version)

View File

@ -83,7 +83,8 @@ def compiler_search_paths(self):
compiler_cls.PrgEnv_compiler compiler_cls.PrgEnv_compiler
) )
matches = re.findall(version_regex, output) matches = re.findall(version_regex, output)
versions = tuple(version for _, version in matches) versions = tuple(version for _, version in matches
if 'classic' not in version)
# Now inspect the modules and add to paths # Now inspect the modules and add to paths
msg = "[CRAY FE] Detected FE compiler [name={0}, versions={1}]" msg = "[CRAY FE] Detected FE compiler [name={0}, versions={1}]"

View File

@ -385,6 +385,10 @@ def test_cce_flags():
supported_flag_test("cxx_pic_flag", "-h PIC", "cce@1.0") supported_flag_test("cxx_pic_flag", "-h PIC", "cce@1.0")
supported_flag_test("f77_pic_flag", "-h PIC", "cce@1.0") supported_flag_test("f77_pic_flag", "-h PIC", "cce@1.0")
supported_flag_test("fc_pic_flag", "-h PIC", "cce@1.0") supported_flag_test("fc_pic_flag", "-h PIC", "cce@1.0")
supported_flag_test("cc_pic_flag", "-fPIC", "cce@9.1.0")
supported_flag_test("cxx_pic_flag", "-fPIC", "cce@9.1.0")
supported_flag_test("f77_pic_flag", "-fPIC", "cce@9.1.0")
supported_flag_test("fc_pic_flag", "-fPIC", "cce@9.1.0")
supported_flag_test("debug_flags", ['-g', '-G0', '-G1', '-G2', '-Gfast'], supported_flag_test("debug_flags", ['-g', '-G0', '-G1', '-G2', '-Gfast'],
'cce@1.0') 'cce@1.0')