petsc: add variant +sycl (#40562)

* petsc: add variant +sycl

* petsc: add in gmake as dependency - so that consistent make gets used between petsc and slepc builds [that can have different env for each of the builds]
This commit is contained in:
Satish Balay 2023-10-19 09:31:02 -05:00 committed by GitHub
parent 681639985a
commit b2d3e01fe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,6 +87,7 @@ class Petsc(Package, CudaPackage, ROCmPackage):
variant("double", default=True, description="Switches between single and double precision")
variant("complex", default=False, description="Build with complex numbers")
variant("debug", default=False, description="Compile in debug mode")
variant("sycl", default=False, description="Enable sycl build")
variant("metis", default=True, description="Activates support for metis and parmetis")
variant(
@ -207,6 +208,8 @@ def check_fortran_compiler(self):
patch("revert-3.18.0-ver-format-for-dealii.patch", when="@3.18.0")
depends_on("diffutils", type="build")
# not listed as a "build" dependency - so that slepc build gets the same dependency
depends_on("gmake")
# Virtual dependencies
# Git repository needs sowing to build Fortran interface
@ -338,6 +341,9 @@ def check_fortran_compiler(self):
when="+kokkos +rocm amdgpu_target=%s" % rocm_arch,
)
conflicts("~kokkos", when="+sycl", msg="+sycl requires +kokkos")
depends_on("kokkos+sycl", when="+sycl +kokkos")
phases = ["configure", "build", "install"]
# Using the following tarballs
@ -434,6 +440,16 @@ def configure_options(self):
else:
options.append("--with-x=0")
if "+sycl" in spec:
sycl_compatible_compilers = ["icpx"]
if not (os.path.basename(self.compiler.cxx) in sycl_compatible_compilers):
raise InstallError("PETSc's SYCL GPU Backend requires oneAPI CXX (icpx) compiler.")
options.append("--with-sycl=1")
options.append("--with-syclc=" + self.compiler.cxx)
options.append("SYCLPPFLAGS=-Wno-tautological-constant-compare")
else:
options.append("--with-sycl=0")
if "trilinos" in spec:
if spec.satisfies("^trilinos+boost"):
options.append("--with-boost=1")