projects/guix·blob python-team · refs

65 lines · 1.8 KiB

1This patch contains the relevant changes to GKlib made in SuiteSparse
2(CHOLMOD) for the version 7.10.2
3(https://github.com/DrTimothyAldenDavis/SuiteSparse/commit/8a7641cdb4809533c681417e94f98058c07c5da2).
4The disabling of signal handling when MATLAB_MEX_FILE is defined is omitted.
5
6diff -ur a/CMakeLists.txt b/CMakeLists.txt
7--- a/CMakeLists.txt
8+++ b/CMakeLists.txt
9@@ -3,6 +3,8 @@
10
11 option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)
12
13+find_package ( SuiteSparse_config 7.10.2 REQUIRED )
14+
15 get_filename_component(abs "." ABSOLUTE)
16 set(GKLIB_PATH ${abs})
17 unset(abs)
18diff -ur a/GKlib.h b/GKlib.h
19--- a/GKlib.h
20+++ b/GKlib.h
21@@ -59,6 +59,24 @@
22 #include <omp.h>
23 #endif
24
25+/* -------------------------------------------------------------------------- */
26+/* Added for incorporation into SuiteSparse.
27+ Tim Davis, Oct 31, 2022, Texas A&M University. */
28+#include "SuiteSparse_config.h"
29+#define malloc SuiteSparse_config_malloc
30+#define calloc SuiteSparse_config_calloc
31+#define realloc SuiteSparse_config_realloc
32+#define free(p) \
33+{ \
34+ if ((p) != NULL) \
35+ { \
36+ SuiteSparse_config_free (p) ; \
37+ (p) = NULL ; \
38+ } \
39+}
40+
41+/* -------------------------------------------------------------------------- */
42+
43
44
45
46diff -ur a/memory.c b/memory.c
47--- a/memory.c
48+++ b/memory.c
49@@ -108,6 +108,8 @@
50 /*************************************************************************/
51 int gk_malloc_init()
52 {
53+ gkmcore = NULL;
54+#if 0
55 if (gkmcore == NULL)
56 gkmcore = gk_gkmcoreCreate();
57
58@@ -115,6 +117,7 @@
59 return 0;
60
61 gk_gkmcorePush(gkmcore);
62+#endif
63
64 return 1;
65 }