Add extra logic for C std flags on PGI, XL, and Cray (#11635)
This commit is contained in:
parent
a998fa25b0
commit
91205545f0
@ -3,10 +3,11 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
import spack.compiler
|
from spack.compiler import Compiler, UnsupportedCompilerFlag
|
||||||
|
from spack.version import ver
|
||||||
|
|
||||||
|
|
||||||
class Cce(spack.compiler.Compiler):
|
class Cce(Compiler):
|
||||||
"""Cray compiler environment compiler."""
|
"""Cray compiler environment compiler."""
|
||||||
# Subclasses use possible names of C compiler
|
# Subclasses use possible names of C compiler
|
||||||
cc_names = ['cc']
|
cc_names = ['cc']
|
||||||
@ -44,7 +45,23 @@ def cxx11_flag(self):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def c99_flag(self):
|
def c99_flag(self):
|
||||||
return "-h c99"
|
if self.version >= ver('8.4'):
|
||||||
|
return '-h stc=c99,noconform,gnu'
|
||||||
|
if self.version >= ver('8.1'):
|
||||||
|
return '-h c99,noconform,gnu'
|
||||||
|
raise UnsupportedCompilerFlag(self,
|
||||||
|
'the C99 standard',
|
||||||
|
'c99_flag',
|
||||||
|
'< 8.1')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def c11_flag(self):
|
||||||
|
if self.version >= ver('8.5'):
|
||||||
|
return '-h std=c11,noconform,gnu'
|
||||||
|
raise UnsupportedCompilerFlag(self,
|
||||||
|
'the C11 standard',
|
||||||
|
'c11_flag',
|
||||||
|
'< 8.5')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def pic_flag(self):
|
def pic_flag(self):
|
||||||
|
@ -3,10 +3,11 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
import spack.compiler
|
from spack.compiler import Compiler, UnsupportedCompilerFlag
|
||||||
|
from spack.version import ver
|
||||||
|
|
||||||
|
|
||||||
class Pgi(spack.compiler.Compiler):
|
class Pgi(Compiler):
|
||||||
# Subclasses use possible names of C compiler
|
# Subclasses use possible names of C compiler
|
||||||
cc_names = ['pgcc']
|
cc_names = ['pgcc']
|
||||||
|
|
||||||
@ -46,3 +47,21 @@ def cxx11_flag(self):
|
|||||||
@property
|
@property
|
||||||
def pic_flag(self):
|
def pic_flag(self):
|
||||||
return "-fpic"
|
return "-fpic"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def c99_flag(self):
|
||||||
|
if self.version >= ver('12.10'):
|
||||||
|
return '-c99'
|
||||||
|
raise UnsupportedCompilerFlag(self,
|
||||||
|
'the C99 standard',
|
||||||
|
'c99_flag',
|
||||||
|
'< 12.10')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def c11_flag(self):
|
||||||
|
if self.version >= ver('15.3'):
|
||||||
|
return '-c11'
|
||||||
|
raise UnsupportedCompilerFlag(self,
|
||||||
|
'the C11 standard',
|
||||||
|
'c11_flag',
|
||||||
|
'< 15.3')
|
||||||
|
@ -45,11 +45,25 @@ def cxx11_flag(self):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def c99_flag(self):
|
def c99_flag(self):
|
||||||
return '-std=c99'
|
if self.version >= ver('13.1.1'):
|
||||||
|
return '-std=gnu99'
|
||||||
|
if self.version >= ver('10.1'):
|
||||||
|
return '-qlanglvl=extc99'
|
||||||
|
raise UnsupportedCompilerFlag(self,
|
||||||
|
'the C99 standard',
|
||||||
|
'c99_flag',
|
||||||
|
'< 10.1')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def c11_flag(self):
|
def c11_flag(self):
|
||||||
return '-std=c11'
|
if self.version >= ver('13.1.2'):
|
||||||
|
return '-std=gnu11'
|
||||||
|
if self.version >= ver('12.1'):
|
||||||
|
return '-qlanglvl=extc1x'
|
||||||
|
raise UnsupportedCompilerFlag(self,
|
||||||
|
'the C11 standard',
|
||||||
|
'c11_flag',
|
||||||
|
'< 12.1')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def pic_flag(self):
|
def pic_flag(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user