diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-06-30 22:45:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 15:45:29 -0500 |
commit | 486b4671b66a1956b75866b8502124724f0df881 (patch) | |
tree | 4ae0799f1ecb1e8d369c1dfbf13b787cb47dfaad | |
parent | 1d55adfd2b75a8cbe7c1cd4f229cca6fa1dd81f9 (diff) | |
download | spack-486b4671b66a1956b75866b8502124724f0df881.tar.gz spack-486b4671b66a1956b75866b8502124724f0df881.tar.bz2 spack-486b4671b66a1956b75866b8502124724f0df881.tar.xz spack-486b4671b66a1956b75866b8502124724f0df881.zip |
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>
-rw-r--r-- | lib/spack/spack/compilers/cce.py | 8 | ||||
-rw-r--r-- | lib/spack/spack/operating_systems/cray_backend.py | 3 | ||||
-rw-r--r-- | lib/spack/spack/operating_systems/cray_frontend.py | 3 | ||||
-rw-r--r-- | lib/spack/spack/test/compilers/basics.py | 4 |
4 files changed, 16 insertions, 2 deletions
diff --git a/lib/spack/spack/compilers/cce.py b/lib/spack/spack/compilers/cce.py index 9844eb299d..55718c292a 100644 --- a/lib/spack/spack/compilers/cce.py +++ b/lib/spack/spack/compilers/cce.py @@ -91,16 +91,24 @@ class Cce(Compiler): @property def cc_pic_flag(self): + if self.is_clang_based: + return "-fPIC" return "-h PIC" @property def cxx_pic_flag(self): + if self.is_clang_based: + return "-fPIC" return "-h PIC" @property def f77_pic_flag(self): + if self.is_clang_based: + return "-fPIC" return "-h PIC" @property def fc_pic_flag(self): + if self.is_clang_based: + return "-fPIC" return "-h PIC" diff --git a/lib/spack/spack/operating_systems/cray_backend.py b/lib/spack/spack/operating_systems/cray_backend.py index 262df6a7bd..eaf8360c2c 100644 --- a/lib/spack/spack/operating_systems/cray_backend.py +++ b/lib/spack/spack/operating_systems/cray_backend.py @@ -146,7 +146,8 @@ class CrayBackend(LinuxDistro): compiler_cls.PrgEnv_compiler ) 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 value = detect_version_args._replace( id=compiler_id._replace(version=version) diff --git a/lib/spack/spack/operating_systems/cray_frontend.py b/lib/spack/spack/operating_systems/cray_frontend.py index a11875ae75..d06920af43 100644 --- a/lib/spack/spack/operating_systems/cray_frontend.py +++ b/lib/spack/spack/operating_systems/cray_frontend.py @@ -83,7 +83,8 @@ class CrayFrontend(LinuxDistro): compiler_cls.PrgEnv_compiler ) 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 msg = "[CRAY FE] Detected FE compiler [name={0}, versions={1}]" diff --git a/lib/spack/spack/test/compilers/basics.py b/lib/spack/spack/test/compilers/basics.py index 0888a66c6c..acc7c7e5f0 100644 --- a/lib/spack/spack/test/compilers/basics.py +++ b/lib/spack/spack/test/compilers/basics.py @@ -385,6 +385,10 @@ def test_cce_flags(): 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("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'], 'cce@1.0') |