diff --git a/petsc-use_int64_t_with_mpiuni.patch b/petsc-use_int64_t_with_mpiuni.patch new file mode 100644 index 0000000..e63e3d6 --- /dev/null +++ b/petsc-use_int64_t_with_mpiuni.patch @@ -0,0 +1,47 @@ +From ab86aa04d4d69fee965a3829143bef835b6ec081 Mon Sep 17 00:00:00 2001 +From: Satish Balay +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 + diff --git a/petsc.spec b/petsc.spec index f9da141..4998bce 100644 --- a/petsc.spec +++ b/petsc.spec @@ -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}