From c7569fefa850696d181b6d6e547e8a458dad1426 Mon Sep 17 00:00:00 2001 From: Lutz Gross <6036995+LutzGross@users.noreply.github.com> Date: Thu, 4 Jan 2024 11:56:20 +1000 Subject: [PATCH] fixes for compilation on macOS and trilinos15 --- scons/templates/homebrew_options.py | 1 + site_scons/dependencies.py | 6 ++++-- trilinoswrap/src/types.h | 14 +++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scons/templates/homebrew_options.py b/scons/templates/homebrew_options.py index 6d2b91929a..28341026c8 100644 --- a/scons/templates/homebrew_options.py +++ b/scons/templates/homebrew_options.py @@ -41,6 +41,7 @@ #mpi_libs = ['mpi_cxx', 'mpi', 'open-rte', 'open-pal'] import glob GCC=[ os.path.join(HOMEBREW_PREFIX, 'bin', 'g++-13') ] +cxx_extra = "-Wno-error=maybe-uninitialized" assert len(GCC) > 0, "unable to find gcc compiler in "+ os.path.join(HOMEBREW_PREFIX, 'bin') cxx = GCC[0] diff --git a/site_scons/dependencies.py b/site_scons/dependencies.py index b30ef2fae1..8f74f6ffa9 100644 --- a/site_scons/dependencies.py +++ b/site_scons/dependencies.py @@ -528,10 +528,12 @@ def checkForTrilinos(env): minor=int(str(trilinos_version)[2:4]) tmp=int(str(trilinos_version)[4:6]) env['trilinos_version'] = str(major)+"."+str(minor)+"."+str(tmp) - if major >= 14: + if major == 14 and minor <2 : env.Append(CPPDEFINES = ['ESYS_TRILINOS_14']) - if major >= 14 and minor >=2: + elif major == 14 and minor >=2: env.Append(CPPDEFINES = ['ESYS_TRILINOS_14_2']) + else: + env.Append(CPPDEFINES = ['ESYS_TRILINOS_15']) if os.path.isfile(os.path.join(trilinos_inc_path,'Tpetra_BlockCrsMatrix.hpp')): print("Checking for %s... %s" % ('Tpetra_BlockCrsMatrix.hpp', "yes") ) diff --git a/trilinoswrap/src/types.h b/trilinoswrap/src/types.h index b80dd060d6..0281922838 100644 --- a/trilinoswrap/src/types.h +++ b/trilinoswrap/src/types.h @@ -75,21 +75,21 @@ typedef escript::DataTypes::index_t GO; typedef escript::DataTypes::index_t LO; #endif /// Kokkos Node type -#ifdef ESYS_TRILINOS_14_2 +#ifdef ESYS_TRILINOS_14 #ifdef _OPENMP - typedef Tpetra::KokkosCompat::KokkosOpenMPWrapperNode NT; + typedef Kokkos::Compat::KokkosOpenMPWrapperNode NT; #elif ESYS_HAVE_CUDA - typedef Tpetra::KokkosCompat::KokkosCudaWrapperNode NT; + typedef Kokkos::Compat::KokkosCudaWrapperNode NT; #else - typedef Tpetra::KokkosCompat::KokkosSerialWrapperNode NT; + typedef Kokkos::Compat::KokkosSerialWrapperNode NT; #endif #else #ifdef _OPENMP - typedef Kokkos::Compat::KokkosOpenMPWrapperNode NT; + typedef Tpetra::KokkosCompat::KokkosOpenMPWrapperNode NT; #elif ESYS_HAVE_CUDA - typedef Kokkos::Compat::KokkosCudaWrapperNode NT; + typedef Tpetra::KokkosCompat::KokkosCudaWrapperNode NT; #else - typedef Kokkos::Compat::KokkosSerialWrapperNode NT; + typedef Tpetra::KokkosCompat::KokkosSerialWrapperNode NT; #endif #endif