summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatish Balay <balay@mcs.anl.gov>2023-10-19 09:31:02 -0500
committerGitHub <noreply@github.com>2023-10-19 07:31:02 -0700
commitb2d3e01fe60bdcbac03e657da58bb41f3a6c5624 (patch)
tree1ee255e0d955c6972b7f586f98bd8082908eac05
parent681639985ab047d34f9ceae1e0dccfdb22af449c (diff)
downloadspack-b2d3e01fe60bdcbac03e657da58bb41f3a6c5624.tar.gz
spack-b2d3e01fe60bdcbac03e657da58bb41f3a6c5624.tar.bz2
spack-b2d3e01fe60bdcbac03e657da58bb41f3a6c5624.tar.xz
spack-b2d3e01fe60bdcbac03e657da58bb41f3a6c5624.zip
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]
-rw-r--r--var/spack/repos/builtin/packages/petsc/package.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py
index 9d0d3a9016..2f258edc17 100644
--- a/var/spack/repos/builtin/packages/petsc/package.py
+++ b/var/spack/repos/builtin/packages/petsc/package.py
@@ -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 @@ class Petsc(Package, CudaPackage, ROCmPackage):
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 @@ class Petsc(Package, CudaPackage, ROCmPackage):
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 @@ class Petsc(Package, CudaPackage, ROCmPackage):
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")