From fd22d109a675aa7095b05500f2add2378cda5913 Mon Sep 17 00:00:00 2001 From: eugeneswalker <38933153+eugeneswalker@users.noreply.github.com> Date: Sat, 4 Nov 2023 06:55:19 -0700 Subject: [PATCH] sundials +sycl: add cxxflags=-fsycl via flag_handler (#40845) --- .../gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml | 2 +- var/spack/repos/builtin/packages/sundials/package.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml index efbf0e2e9c..8c872240f9 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml @@ -200,11 +200,11 @@ spack: - kokkos +sycl +openmp cxxstd=17 +tests +examples - kokkos-kernels build_type=Release %oneapi ^kokkos +sycl +openmp cxxstd=17 +tests +examples - slate +sycl + - sundials +sycl cxxstd=17 +examples-install - tau +mpi +opencl +level_zero ~pdt +syscall # tau: requires libdrm.so to be installed # -- # - ginkgo +oneapi # InstallError: Ginkgo's oneAPI backend requires theDPC++ compiler as main CXX compiler. # - hpctoolkit +level_zero # dyninst@12.3.0%gcc: /usr/bin/ld: libiberty/./d-demangle.c:142: undefined reference to `_intel_fast_memcpy'; can't mix intel-tbb@%oneapi with dyninst%gcc - # - sundials +sycl cxxstd=17 # sundials: include/sunmemory/sunmemory_sycl.h:20:10: fatal error: 'CL/sycl.hpp' file not found - py-scipy diff --git a/var/spack/repos/builtin/packages/sundials/package.py b/var/spack/repos/builtin/packages/sundials/package.py index f424a523f1..71ae9186a0 100644 --- a/var/spack/repos/builtin/packages/sundials/package.py +++ b/var/spack/repos/builtin/packages/sundials/package.py @@ -292,6 +292,12 @@ class Sundials(CMakePackage, CudaPackage, ROCmPackage): # fix issues with exported PETSc target(s) in SUNDIALSConfig.cmake patch("sundials-v5.8.0.patch", when="@5.8.0") + def flag_handler(self, name, flags): + if name == "cxxflags": + if self.spec.satisfies("+sycl"): + flags.append("-fsycl") + return (flags, None, None) + # ========================================================================== # SUNDIALS Settings # ==========================================================================