xsdk-project / xsdk-issues

A repository under which GitHub issues not related to a specific xSDK repo can be filed.
7 stars 0 forks source link

sundials +sycl build error #244

Closed balay closed 11 months ago

balay commented 11 months ago
diff --git a/var/spack/repos/builtin/packages/xsdk/package.py b/var/spack/repos/builtin/packages/xsdk/package.py
index e8fe895183..a98bcd67c1 100644
--- a/var/spack/repos/builtin/packages/xsdk/package.py
+++ b/var/spack/repos/builtin/packages/xsdk/package.py
@@ -248,6 +248,7 @@ class Xsdk(BundlePackage, CudaPackage, ROCmPackage):

     xsdk_depends_on("sundials +trilinos", when="+trilinos @0.7.0:")
     xsdk_depends_on("sundials +ginkgo", when="+ginkgo @0.8.0:")
+    xsdk_depends_on("sundials cxxstd=17 +sycl", when="@1.0.0: +sycl")
     xsdk_depends_on(
         "sundials@develop~int64+hypre+petsc+superlu-dist",
         when="@develop",
In file included from /home/xsdk/spack.y/spack-stage/spack-stage-sundials-6.6.1-p5s44q7bhdfvtyyyzeiahtznpy2eix3f/spack-src/src/sunmemory/sycl/sundials_sycl_memory.cpp:19:
/home/xsdk/spack.y/spack-stage/spack-stage-sundials-6.6.1-p5s44q7bhdfvtyyyzeiahtznpy2eix3f/spack-src/include/sunmemory/sunmemory_sycl.h:20:10: fatal error: 'CL/sycl.hpp' file not found
#include <CL/sycl.hpp>
         ^~~~~~~~~~~~~

spack-build-out.txt

Note I had a different error without cxxstd=17

gardner48 commented 11 months ago

Is the C++ compiler dpcpp or icpx?

gardner48 commented 11 months ago

Is the C++ compiler dpcpp or icpx?

I'd guess guess that it's icpx and we need to add -fsycl to the C++ flags.

balay commented 11 months ago

yeah icpx. The attached build log has the details

masterleinad commented 11 months ago

include <CL/sycl.hpp>

Should be

#include <sycl/sycl.hpp>

for any recent oneAPI version.

gardner48 commented 11 months ago

Looks like it's using icx for the C and C++ compiler. We plan on updating the includes to sycl/sycl.hpp but I believe CL/sycl.hpp still works and adding -fsycl to the C++ flags should fix issue.

balos1 commented 11 months ago

This will be fixed with https://github.com/spack/spack/pull/40845

balay commented 11 months ago

https://github.com/spack/spack/pull/40845 is now merged, xsdk+sycl is now updated to build sundials+sycl