summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStephen Sachs <stesachs@amazon.com>2024-10-11 02:25:32 +0200
committerGitHub <noreply@github.com>2024-10-11 02:25:32 +0200
commit22043617aa31b67edbbbe3892846bdbef9f8cd4f (patch)
tree915cfa1076f77a31039e50fa65fd7fa28cd51c48 /lib
parent7df23c747112f7bf8c1f2db7895265d426f56d48 (diff)
downloadspack-22043617aa31b67edbbbe3892846bdbef9f8cd4f.tar.gz
spack-22043617aa31b67edbbbe3892846bdbef9f8cd4f.tar.bz2
spack-22043617aa31b67edbbbe3892846bdbef9f8cd4f.tar.xz
spack-22043617aa31b67edbbbe3892846bdbef9f8cd4f.zip
libunistring: 1.2 needs std=c18 for icc, add icc C++ flags update (#37607)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/intel.py8
-rw-r--r--lib/spack/spack/test/compilers/basics.py4
2 files changed, 12 insertions, 0 deletions
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
@@ -93,6 +93,14 @@ class Intel(Compiler):
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")