Fix upstream bug #1542

This commit is contained in:
Antonio Trande 2024-02-08 15:46:51 +01:00
parent 0a53ef007c
commit 516bf1f343
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,47 @@
From ab86aa04d4d69fee965a3829143bef835b6ec081 Mon Sep 17 00:00:00 2001
From: Satish Balay <balay@mcs.anl.gov>
Date: Tue, 6 Feb 2024 15:17:17 -0600
Subject: [PATCH] petsc64: use int64_t with mpiuni [in sync with metis]
---
include/petsc/mpiuni/mpi.h | 1 +
include/petscsystypes.h | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/petsc/mpiuni/mpi.h b/include/petsc/mpiuni/mpi.h
index ea27c6628f4..d51a924e089 100644
--- a/include/petsc/mpiuni/mpi.h
+++ b/include/petsc/mpiuni/mpi.h
@@ -229,6 +229,7 @@ typedef int MPI_Datatype;
#define MPI_INT8_T (5 << 20 | 1 << 8 | (int)sizeof(int8_t))
#define MPI_INT16_T (5 << 20 | 1 << 8 | (int)sizeof(int16_t))
#define MPI_INT32_T (5 << 20 | 1 << 8 | (int)sizeof(int32_t))
+#define MPI_INT64_T (5 << 20 | 1 << 8 | (int)sizeof(int64_t))
#define MPI_UNSIGNED_SHORT (5 << 20 | 1 << 8 | (int)sizeof(unsigned short))
#define MPI_UNSIGNED (5 << 20 | 1 << 8 | (int)sizeof(unsigned))
diff --git a/include/petscsystypes.h b/include/petscsystypes.h
index 86f7dba1c33..6e4d549bbe6 100644
--- a/include/petscsystypes.h
+++ b/include/petscsystypes.h
@@ -253,7 +253,7 @@ M*/
#endif
#endif
-#if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && defined(PETSC_HAVE_MPI_INT64_T) /* MPI_INT64_T is not guaranteed to be a macro */
+#if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && (defined(PETSC_HAVE_MPIUNI) || defined(PETSC_HAVE_MPI_INT64_T)) /* MPI_INT64_T is not guaranteed to be a macro */
typedef int64_t PetscInt64;
#define PETSC_INT64_MIN INT64_MIN
@@ -300,7 +300,7 @@ enum {
#define PETSC_MAX_INT PETSC_INT_MAX
#define PETSC_MAX_UINT16 65535
-#if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && defined(PETSC_HAVE_MPI_INT64_T) /* MPI_INT64_T is not guaranteed to be a macro */
+#if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && (defined(PETSC_HAVE_MPIUNI) || defined(PETSC_HAVE_MPI_INT64_T)) /* MPI_INT64_T is not guaranteed to be a macro */
#define MPIU_INT64 MPI_INT64_T
#define PetscInt64_FMT PRId64
#elif (PETSC_SIZEOF_LONG_LONG == 8)
--
GitLab

View File

@ -318,6 +318,9 @@ Patch4: %{name}-3.19.4-fix_metis64.patch
Patch6: %{name}-3.14.1-fix_pkgconfig_file.patch
Patch7: %{name}-3.17.0-avoid_fake_MKL_detection.patch
# https://gitlab.com/petsc/petsc/-/issues/1542
Patch8: %{name}-use_int64_t_with_mpiuni.patch
%if %{with superlu}
BuildRequires: SuperLU-devel >= 5.2.0
%endif
@ -606,6 +609,7 @@ popd
pushd %{name}-%{version}
%patch -P 0 -p0 -b .backup
%patch -P 6 -p1 -b .backup
%patch -P 8 -p1 -b .backup
popd
%if %{with openmpi}