From 22043617aa31b67edbbbe3892846bdbef9f8cd4f Mon Sep 17 00:00:00 2001 From: Stephen Sachs Date: Fri, 11 Oct 2024 02:25:32 +0200 Subject: libunistring: 1.2 needs std=c18 for icc, add icc C++ flags update (#37607) --- lib/spack/spack/compilers/intel.py | 8 ++++++++ lib/spack/spack/test/compilers/basics.py | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'lib') diff --git a/lib/spack/spack/compilers/intel.py b/lib/spack/spack/compilers/intel.py index 3cae5e5873..4990da3cb0 100644 --- a/lib/spack/spack/compilers/intel.py +++ b/lib/spack/spack/compilers/intel.py @@ -92,6 +92,14 @@ class Intel(Compiler): else: return "-std=c1x" + @property + def c18_flag(self): + # c18 supported since oneapi 2022, which is classic version 2021.5.0 + if self.real_version < Version("21.5.0"): + raise UnsupportedCompilerFlag(self, "the C18 standard", "c18_flag", "< 21.5.0") + else: + return "-std=c18" + @property def cc_pic_flag(self): return "-fPIC" diff --git a/lib/spack/spack/test/compilers/basics.py b/lib/spack/spack/test/compilers/basics.py index 65c05ccbdf..ee31e50f53 100644 --- a/lib/spack/spack/test/compilers/basics.py +++ b/lib/spack/spack/test/compilers/basics.py @@ -461,9 +461,13 @@ def test_intel_flags(): unsupported_flag_test("cxx14_flag", "intel@=14.0") supported_flag_test("cxx14_flag", "-std=c++1y", "intel@=15.0") supported_flag_test("cxx14_flag", "-std=c++14", "intel@=15.0.2") + unsupported_flag_test("cxx17_flag", "intel@=18") + supported_flag_test("cxx17_flag", "-std=c++17", "intel@=19.0") unsupported_flag_test("c99_flag", "intel@=11.0") supported_flag_test("c99_flag", "-std=c99", "intel@=12.0") unsupported_flag_test("c11_flag", "intel@=15.0") + supported_flag_test("c18_flag", "-std=c18", "intel@=21.5.0") + unsupported_flag_test("c18_flag", "intel@=21.4.0") supported_flag_test("c11_flag", "-std=c1x", "intel@=16.0") supported_flag_test("cc_pic_flag", "-fPIC", "intel@=1.0") supported_flag_test("cxx_pic_flag", "-fPIC", "intel@=1.0") -- cgit v1.2.3-70-g09d2