[packages/sundials] - more type fixes for ILP32 platforms
qboosh
qboosh at pld-linux.org
Wed Jul 2 19:05:32 CEST 2025
commit af03499c6745ec45546e3fd99df630688858730f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Jul 2 19:06:57 2025 +0200
- more type fixes for ILP32 platforms
sundials-fortran.patch | 2 +-
sundials-hash.patch | 19 +++++++++++++++++++
sundials-types.patch | 11 +++++++++++
sundials.spec | 4 ++++
4 files changed, 35 insertions(+), 1 deletion(-)
---
diff --git a/sundials.spec b/sundials.spec
index 4b7e220..60f5fed 100644
--- a/sundials.spec
+++ b/sundials.spec
@@ -25,6 +25,8 @@ Group: Libraries
Source0: https://github.com/LLNL/sundials/archive/v%{version}/%{name}-%{version}.tar.gz
# Source0-md5: 4f6a73bb82c8f23991d8685b1dcf6039
Patch0: %{name}-fortran.patch
+Patch1: %{name}-hash.patch
+Patch2: %{name}-types.patch
URL: https://computing.llnl.gov/projects/sundials
BuildRequires: SuiteSparse-KLU-devel
BuildRequires: cmake >= 3.12
@@ -118,6 +120,8 @@ Dokumentacja API bibliotek SUNDIALS.
%prep
%setup -q
%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
# duplicate of cvodes/ckpng.pdf
%{__rm} doc/idas/ckpnt.pdf
diff --git a/sundials-fortran.patch b/sundials-fortran.patch
index 1b3077c..e8f3e0a 100644
--- a/sundials-fortran.patch
+++ b/sundials-fortran.patch
@@ -157,7 +157,7 @@
call check_retval(retval, "FIDASStolerancesB")
- retval = FIDASetMaxNumStepsB(mem, indexB(1), 1000_8)
-+ retval = FIDASetMaxNumStepsB(mem, indexB(1), 1000)
++ retval = FIDASetMaxNumStepsB(mem, indexB(1), 1000_c_long)
call check_retval(retval, "FIDASetMaxNumStepsB")
! Create dense SUNMatrix for use in linear solves
diff --git a/sundials-hash.patch b/sundials-hash.patch
new file mode 100644
index 0000000..c4c4260
--- /dev/null
+++ b/sundials-hash.patch
@@ -0,0 +1,19 @@
+--- sundials-6.7.0/src/sundials/sundials_hashmap.h.orig 2023-12-18 11:41:45.000000000 +0100
++++ sundials-6.7.0/src/sundials/sundials_hashmap.h 2025-07-02 18:12:37.272673176 +0200
+@@ -23,8 +23,16 @@
+ #include <stdlib.h>
+ #include <string.h>
+
++#ifdef _LP64
++/* these values seem swapped???
++ * https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
++ */
+ static const unsigned long HASH_PRIME = 14695981039346656037U;
+ static const unsigned long HASH_OFFSET_BASIS = 1099511628211U;
++#else
++static const unsigned long HASH_PRIME = 16777619U;
++static const unsigned long HASH_OFFSET_BASIS = 2166136261U;
++#endif
+
+ /*
+ For a nice discussion on popular hashing algorithms see:
diff --git a/sundials-types.patch b/sundials-types.patch
new file mode 100644
index 0000000..11c9901
--- /dev/null
+++ b/sundials-types.patch
@@ -0,0 +1,11 @@
+--- sundials-6.7.0/src/sunlinsol/klu/sunlinsol_klu.c.orig 2025-07-02 10:21:08.968961307 +0200
++++ sundials-6.7.0/src/sunlinsol/klu/sunlinsol_klu.c 2025-07-02 18:21:12.062113471 +0200
+@@ -48,7 +48,7 @@
+ */
+
+ #if defined(SUNDIALS_INT64_T)
+-#define KLU_INDEXTYPE long int
++#define KLU_INDEXTYPE int64_t
+ #else
+ #define KLU_INDEXTYPE int
+ #endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/sundials.git/commitdiff/af03499c6745ec45546e3fd99df630688858730f
More information about the pld-cvs-commit
mailing list