diff options
author | Stephen Nicholas Swatman <stephen@v25.nl> | 2024-07-15 21:42:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 14:42:19 -0500 |
commit | c12772e73f80f18a3a95815db277972849e5029d (patch) | |
tree | 6aed13d7c639bcd807f370d9b96f65d4c2a6813c /var | |
parent | a26ac1dbcce120e460e24bbb605e1cf764615a0f (diff) | |
download | spack-c12772e73f80f18a3a95815db277972849e5029d.tar.gz spack-c12772e73f80f18a3a95815db277972849e5029d.tar.bz2 spack-c12772e73f80f18a3a95815db277972849e5029d.tar.xz spack-c12772e73f80f18a3a95815db277972849e5029d.zip |
vecmem: add infrastructure for working with SYCL (#45058)
* vecmem: add infrastructure for working with SYCL
The vecmem package uses an unorthodox build system where, instead of
expecting a SYCL-capable compiler in the `CXX` environment variable, it
expects one in `SYCLCXX`. It also needs the correct SYCL flags to be
set. This commit adds a custom build environment for the vecmem package
which allows it to be built in this way. I've also added an extra CMake
flag to ensure that the build system doesn't download any unwanted
dependencies.
* Update var/spack/repos/builtin/packages/vecmem/package.py
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
---------
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/vecmem/package.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/vecmem/package.py b/var/spack/repos/builtin/packages/vecmem/package.py index 9e2fb72377..ad71b780ad 100644 --- a/var/spack/repos/builtin/packages/vecmem/package.py +++ b/var/spack/repos/builtin/packages/vecmem/package.py @@ -63,6 +63,12 @@ class Vecmem(CMakePackage, CudaPackage): # and we can choose between always depending on googletest, or using FetchContent # depends_on("googletest", type="test") + def setup_build_environment(self, env): + if self.spec.satisfies("+sycl"): + env.set("SYCLCXX", self.compiler.cxx) + if self.spec.satisfies("%oneapi"): + env.set("SYCLFLAGS", "-fsycl") + def cmake_args(self): args = [ self.define("FETCHCONTENT_FULLY_DISCONNECTED", False), # see FIXME above @@ -71,6 +77,7 @@ class Vecmem(CMakePackage, CudaPackage): self.define_from_variant("VECMEM_BUILD_SYCL_LIBRARY", "sycl"), self.define("BUILD_TESTING", self.run_tests), self.define("VECMEM_BUILD_TESTING", self.run_tests), + self.define("VECMEM_USE_SYSTEM_LIBS", True), self.define("VECMEM_USE_SYSTEM_GOOGLETEST", False), # see FIXME above ] |