From aa00c3fe1fe956ce6169657fd6c7f4a10fec53f8 Mon Sep 17 00:00:00 2001 From: Piotr Sacharuk <107190444+PiotrSacharuk@users.noreply.github.com> Date: Tue, 25 Mar 2025 01:05:43 +0100 Subject: [PATCH] trilinos: Apply workaround for oneAPI compiler for problems with build (#49636) * Fix problem at least with datatransferkit * Include patch 11676 from trilinos * Add patches for trilinos 13.4.1 * style check failed * Update links for patches * additional style check failed --- .../trilinos/13.4.1-14-patch11676.patch | 12 ++++++++++++ .../13.4.1-kokkoskernel-patch2296.patch | 15 +++++++++++++++ .../packages/trilinos/13.4.1-patch11600.patch | 12 ++++++++++++ .../14-14.2-kokkoskernel-patch2296.patch | 15 +++++++++++++++ .../repos/builtin/packages/trilinos/package.py | 17 +++++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 var/spack/repos/builtin/packages/trilinos/13.4.1-14-patch11676.patch create mode 100644 var/spack/repos/builtin/packages/trilinos/13.4.1-kokkoskernel-patch2296.patch create mode 100644 var/spack/repos/builtin/packages/trilinos/13.4.1-patch11600.patch create mode 100644 var/spack/repos/builtin/packages/trilinos/14-14.2-kokkoskernel-patch2296.patch diff --git a/var/spack/repos/builtin/packages/trilinos/13.4.1-14-patch11676.patch b/var/spack/repos/builtin/packages/trilinos/13.4.1-14-patch11676.patch new file mode 100644 index 00000000000..145ece04df2 --- /dev/null +++ b/var/spack/repos/builtin/packages/trilinos/13.4.1-14-patch11676.patch @@ -0,0 +1,12 @@ +diff --git a/packages/teuchos/core/src/Teuchos_BigUIntDecl.hpp b/packages/teuchos/core/src/Teuchos_BigUIntDecl.hpp +index e82e8be9e9a..b41b0d035af 100644 +--- a/packages/teuchos/core/src/Teuchos_BigUIntDecl.hpp ++++ b/packages/teuchos/core/src/Teuchos_BigUIntDecl.hpp +@@ -43,6 +43,7 @@ + #define TEUCHOS_BIG_UINT_DECL_HPP + + #include ++#include + + /*! \file Teuchos_BigUIntDecl.hpp + \brief Arbitrary-precision unsigned integer declaration. diff --git a/var/spack/repos/builtin/packages/trilinos/13.4.1-kokkoskernel-patch2296.patch b/var/spack/repos/builtin/packages/trilinos/13.4.1-kokkoskernel-patch2296.patch new file mode 100644 index 00000000000..014dbc5db94 --- /dev/null +++ b/var/spack/repos/builtin/packages/trilinos/13.4.1-kokkoskernel-patch2296.patch @@ -0,0 +1,15 @@ +diff --git a/packages/kokkos-kernels/src/sparse/KokkosSparse_spadd_handle.hpp b/packages/kokkos-kernels/src/sparse/KokkosSparse_spadd_handle.hpp +index 917b1038a61..d5e4d30653d 100644 +--- a/packages/kokkos-kernels/src/sparse/KokkosSparse_spadd_handle.hpp ++++ b/packages/kokkos-kernels/src/sparse/KokkosSparse_spadd_handle.hpp +@@ -104,10 +104,6 @@ class SPADDHandle { + */ + size_type get_c_nnz() { return this->result_nnz_size; } + +- void set_sort_option(int option) { this->sort_option = option; } +- +- int get_sort_option() { return this->sort_option; } +- + /** + * \brief Default constructor. + */ diff --git a/var/spack/repos/builtin/packages/trilinos/13.4.1-patch11600.patch b/var/spack/repos/builtin/packages/trilinos/13.4.1-patch11600.patch new file mode 100644 index 00000000000..9f013f71c64 --- /dev/null +++ b/var/spack/repos/builtin/packages/trilinos/13.4.1-patch11600.patch @@ -0,0 +1,12 @@ +diff --git a/packages/kokkos/core/src/impl/Kokkos_MemoryPool.cpp b/packages/kokkos/core/src/impl/Kokkos_MemoryPool.cpp +index 889d821bb1c..3ddc1d3515e 100644 +--- a/packages/kokkos/core/src/impl/Kokkos_MemoryPool.cpp ++++ b/packages/kokkos/core/src/impl/Kokkos_MemoryPool.cpp +@@ -46,6 +46,7 @@ + + #include + #include ++#include + + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- diff --git a/var/spack/repos/builtin/packages/trilinos/14-14.2-kokkoskernel-patch2296.patch b/var/spack/repos/builtin/packages/trilinos/14-14.2-kokkoskernel-patch2296.patch new file mode 100644 index 00000000000..4ee9c8b8482 --- /dev/null +++ b/var/spack/repos/builtin/packages/trilinos/14-14.2-kokkoskernel-patch2296.patch @@ -0,0 +1,15 @@ +diff --git a/packages/kokkos-kernels/sparse/src/KokkosSparse_spadd_handle.hpp b/packages/kokkos-kernels/sparse/src/KokkosSparse_spadd_handle.hpp +index 6d726e3da65..01d96f55115 100644 +--- a/packages/kokkos-kernels/sparse/src/KokkosSparse_spadd_handle.hpp ++++ b/packages/kokkos-kernels/sparse/src/KokkosSparse_spadd_handle.hpp +@@ -76,10 +76,6 @@ class SPADDHandle { + */ + size_type get_c_nnz() { return this->result_nnz_size; } + +- void set_sort_option(int option) { this->sort_option = option; } +- +- int get_sort_option() { return this->sort_option; } +- + /** + * \brief Default constructor. + */ diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 973ac383974..e1106ce4878 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -542,6 +542,18 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage): when="@13.0.0:13.0.1 +teko gotype=long", ) + # https://github.com/kokkos/kokkos-kernels/pull/2296 + patch("13.4.1-kokkoskernel-patch2296.patch", when="@13.4.1 %oneapi@2025:") + + # https://github.com/kokkos/kokkos-kernels/pull/2296 + patch("14-14.2-kokkoskernel-patch2296.patch", when="@14 %oneapi@2025:") + + # https://github.com/trilinos/Trilinos/pull/11676 + patch("13.4.1-14-patch11676.patch", when="@13.4.1:14.0 %oneapi@2025:") + + # https://github.com/trilinos/Trilinos/pull/11600 + patch("13.4.1-patch11600.patch", when="@13.4.1 %oneapi@2025:") + def flag_handler(self, name, flags): spec = self.spec is_cce = spec.satisfies("%cce") @@ -557,6 +569,11 @@ def flag_handler(self, name, flags): flags.append("-no-ipo") if "+wrapper" in spec: flags.append("--expt-extended-lambda") + if spec.satisfies("%oneapi@2025:"): + flags.append( + "-Wno-error=missing-template-arg-list-after-template-kw " + "-Wno-missing-template-arg-list-after-template-kw" + ) elif name == "ldflags": if spec.satisfies("%cce@:14"): flags.append("-fuse-ld=gold")