add hip compiler property
This commit is contained in:
parent
2519ad20da
commit
0ac63a3799
@ -199,10 +199,21 @@ def cxx(self) -> Optional[str]:
|
|||||||
return self.spec.extra_attributes["compilers"].get("cxx", None)
|
return self.spec.extra_attributes["compilers"].get("cxx", None)
|
||||||
return self._cxx_path()
|
return self._cxx_path()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def hip(self) -> Optional[str]:
|
||||||
|
assert self.spec.concrete, "cannot retrieve HIP compiler, spec is not concrete"
|
||||||
|
if self.spec.external:
|
||||||
|
return self.spec.extra_attributes["compilers"].get("hip", None)
|
||||||
|
return self._hip_path()
|
||||||
|
|
||||||
def _cxx_path(self) -> Optional[str]:
|
def _cxx_path(self) -> Optional[str]:
|
||||||
"""Returns the path to the C++ compiler, if the package was installed by Spack"""
|
"""Returns the path to the C++ compiler, if the package was installed by Spack"""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def _hip_path(self) -> Optional[str]:
|
||||||
|
"""Returns the path to the HIP compiler, if the package was installed by Spack"""
|
||||||
|
return self._cxx_path()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def fortran(self):
|
def fortran(self):
|
||||||
assert self.spec.concrete, "cannot retrieve Fortran compiler, spec is not concrete"
|
assert self.spec.concrete, "cannot retrieve Fortran compiler, spec is not concrete"
|
||||||
|
@ -68,7 +68,7 @@ def url_for_version(self, version):
|
|||||||
depends_on("zlib-api", type="link")
|
depends_on("zlib-api", type="link")
|
||||||
depends_on("z3", type="link")
|
depends_on("z3", type="link")
|
||||||
depends_on("ncurses", type="link")
|
depends_on("ncurses", type="link")
|
||||||
requires(f"%[virtuals=c,cxx] llvm-amdgpu")
|
requires("%[virtuals=c,cxx] llvm-amdgpu")
|
||||||
|
|
||||||
for ver in [
|
for ver in [
|
||||||
"5.3.0",
|
"5.3.0",
|
||||||
|
@ -156,6 +156,9 @@ def setup_dependent_build_environment(self, env, dependent_spec):
|
|||||||
_var_list.append(("fortran", "fortran", "F77", "SPACK_F77"))
|
_var_list.append(("fortran", "fortran", "F77", "SPACK_F77"))
|
||||||
_var_list.append(("fortran", "fortran", "FC", "SPACK_FC"))
|
_var_list.append(("fortran", "fortran", "FC", "SPACK_FC"))
|
||||||
|
|
||||||
|
if dependent_spec.has_virtual_dependency("hip-lang"):
|
||||||
|
_var_list.append(("hip-lang", "hip", "HIPCXX", "SPACK_HIPCXX"))
|
||||||
|
|
||||||
# The package is not used as a compiler, so skip this setup
|
# The package is not used as a compiler, so skip this setup
|
||||||
if not _var_list:
|
if not _var_list:
|
||||||
return
|
return
|
||||||
|
@ -57,7 +57,7 @@ class HipifyClang(CMakePackage):
|
|||||||
depends_on("cxx", type="build")
|
depends_on("cxx", type="build")
|
||||||
|
|
||||||
depends_on("cmake@3.5:", type="build")
|
depends_on("cmake@3.5:", type="build")
|
||||||
requires(f"%[virtuals=c,cxx] llvm-amdgpu")
|
requires("%[virtuals=c,cxx] llvm-amdgpu")
|
||||||
|
|
||||||
for ver in [
|
for ver in [
|
||||||
"5.3.0",
|
"5.3.0",
|
||||||
|
@ -64,7 +64,7 @@ class HsaRocrDev(CMakePackage):
|
|||||||
depends_on("numactl")
|
depends_on("numactl")
|
||||||
depends_on("pkgconfig")
|
depends_on("pkgconfig")
|
||||||
depends_on("libdrm", when="@6.3:")
|
depends_on("libdrm", when="@6.3:")
|
||||||
requires(f"%[virtuals=c,cxx] llvm-amdgpu")
|
requires("%[virtuals=c,cxx] llvm-amdgpu")
|
||||||
|
|
||||||
for ver in [
|
for ver in [
|
||||||
"5.3.0",
|
"5.3.0",
|
||||||
|
@ -23,6 +23,7 @@ class LlvmAmdgpu(CMakePackage, LlvmDetection, CompilerPackage):
|
|||||||
"c": "rocmcc/amdclang",
|
"c": "rocmcc/amdclang",
|
||||||
"cxx": "rocmcc/amdclang++",
|
"cxx": "rocmcc/amdclang++",
|
||||||
"fortran": "rocmcc/amdflang",
|
"fortran": "rocmcc/amdflang",
|
||||||
|
"hip-lang": "rocmcc/amdclang++",
|
||||||
}
|
}
|
||||||
|
|
||||||
stdcxx_libs = ("-lstdc++",)
|
stdcxx_libs = ("-lstdc++",)
|
||||||
|
Loading…
Reference in New Issue
Block a user