aocc: add support for v3.0 compilers (#22219)
A mitigation of a known issue that affects v3.0 is added, see https://developer.amd.com/wp-content/resources/AOCC-3.0-Install-Guide.pdf
This commit is contained in:
parent
43dd7b84c0
commit
e6c8fa1311
@ -9,6 +9,7 @@
|
|||||||
import llnl.util.lang
|
import llnl.util.lang
|
||||||
|
|
||||||
from spack.compiler import Compiler
|
from spack.compiler import Compiler
|
||||||
|
from spack.version import ver
|
||||||
|
|
||||||
|
|
||||||
class Aocc(Compiler):
|
class Aocc(Compiler):
|
||||||
@ -118,3 +119,22 @@ def f77_version(cls, f77):
|
|||||||
@property
|
@property
|
||||||
def stdcxx_libs(self):
|
def stdcxx_libs(self):
|
||||||
return ('-lstdc++', )
|
return ('-lstdc++', )
|
||||||
|
|
||||||
|
@property
|
||||||
|
def cflags(self):
|
||||||
|
return self._handle_default_flag_addtions()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def cxxflags(self):
|
||||||
|
return self._handle_default_flag_addtions()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def fflags(self):
|
||||||
|
return self._handle_default_flag_addtions()
|
||||||
|
|
||||||
|
def _handle_default_flag_addtions(self):
|
||||||
|
# This is a known issue for AOCC 3.0 see:
|
||||||
|
# https://developer.amd.com/wp-content/resources/AOCC-3.0-Install-Guide.pdf
|
||||||
|
if self.real_version == ver('3.0.0'):
|
||||||
|
return ("-Wno-unused-command-line-argument "
|
||||||
|
"-mllvm -eliminate-similar-expr=false")
|
||||||
|
@ -466,6 +466,10 @@ def test_aocc_flags():
|
|||||||
supported_flag_test("f77_pic_flag", "-fPIC", "aocc@2.2.0")
|
supported_flag_test("f77_pic_flag", "-fPIC", "aocc@2.2.0")
|
||||||
supported_flag_test("fc_pic_flag", "-fPIC", "aocc@2.2.0")
|
supported_flag_test("fc_pic_flag", "-fPIC", "aocc@2.2.0")
|
||||||
supported_flag_test("version_argument", "--version", "aocc@2.2.0")
|
supported_flag_test("version_argument", "--version", "aocc@2.2.0")
|
||||||
|
flg = "-Wno-unused-command-line-argument -mllvm -eliminate-similar-expr=false"
|
||||||
|
supported_flag_test("cflags", flg, "aocc@3.0.0")
|
||||||
|
supported_flag_test("cxxflags", flg, "aocc@3.0.0")
|
||||||
|
supported_flag_test("fflags", flg, "aocc@3.0.0")
|
||||||
|
|
||||||
|
|
||||||
def test_fj_flags():
|
def test_fj_flags():
|
||||||
|
@ -321,6 +321,11 @@ def _module(cmd, *args):
|
|||||||
|
|
||||||
@pytest.mark.parametrize('version_str,expected_version', [
|
@pytest.mark.parametrize('version_str,expected_version', [
|
||||||
# This applies to C,C++ and FORTRAN compiler
|
# This applies to C,C++ and FORTRAN compiler
|
||||||
|
('AMD clang version 12.0.0 (CLANG: AOCC_3.0.0-Build#78 2020_12_10)'
|
||||||
|
'(based on LLVM Mirror.Version.12.0.0)\n'
|
||||||
|
'Target: x86_64-unknown-linux-gnu\n'
|
||||||
|
'Thread model: posix\n', '3.0.0'
|
||||||
|
),
|
||||||
('AMD clang version 11.0.0 (CLANG: AOCC_2.3.0-Build#85 2020_11_10)'
|
('AMD clang version 11.0.0 (CLANG: AOCC_2.3.0-Build#85 2020_11_10)'
|
||||||
'(based on LLVM Mirror.Version.11.0.0)\n'
|
'(based on LLVM Mirror.Version.11.0.0)\n'
|
||||||
'Target: x86_64-unknown-linux-gnu\n'
|
'Target: x86_64-unknown-linux-gnu\n'
|
||||||
|
@ -32,6 +32,8 @@ class Aocc(Package):
|
|||||||
|
|
||||||
maintainers = ['amd-toolchain-support']
|
maintainers = ['amd-toolchain-support']
|
||||||
|
|
||||||
|
version(ver="3.0.0", sha256='4ff269b1693856b9920f57e3c85ce488c8b81123ddc88682a3ff283979362227',
|
||||||
|
url='http://developer.amd.com/wordpress/media/files/aocc-compiler-3.0.0.tar')
|
||||||
version(ver="2.3.0", sha256='9f8a1544a5268a7fb8cd21ac4bdb3f8d1571949d1de5ca48e2d3309928fc3d15',
|
version(ver="2.3.0", sha256='9f8a1544a5268a7fb8cd21ac4bdb3f8d1571949d1de5ca48e2d3309928fc3d15',
|
||||||
url='http://developer.amd.com/wordpress/media/files/aocc-compiler-2.3.0.tar')
|
url='http://developer.amd.com/wordpress/media/files/aocc-compiler-2.3.0.tar')
|
||||||
version(ver="2.2.0", sha256='500940ce36c19297dfba3aa56dcef33b6145867a1f34890945172ac2be83b286',
|
version(ver="2.2.0", sha256='500940ce36c19297dfba3aa56dcef33b6145867a1f34890945172ac2be83b286',
|
||||||
|
Loading…
Reference in New Issue
Block a user