unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: David Elsing <david.elsing@posteo.net>
To: 66129@debbugs.gnu.org
Cc: David Elsing <david.elsing@posteo.net>
Subject: [bug#66129] [PATCH 10/20] gnu: Add gklib-suitesparse.
Date: Wed, 20 Sep 2023 22:08:00 +0000	[thread overview]
Message-ID: <28bb0d1f9a1530497514d57a15aabeb1990536a8.1695246169.git.david.elsing@posteo.net> (raw)
In-Reply-To: <cover.1695246169.git.david.elsing@posteo.net>

* gnu/packages/maths.scm (gklib-suitesparse): New variable.
---
 gnu/packages/maths.scm                       | 25 ++++++++
 gnu/packages/patches/gklib-suitesparse.patch | 65 ++++++++++++++++++++
 2 files changed, 90 insertions(+)
 create mode 100644 gnu/packages/patches/gklib-suitesparse.patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 3150bac47f..668d564edc 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5228,6 +5228,31 @@ (define-public suitesparse-ccolamd
 COLAMD which has the the option to apply constraints to the ordering.")
     (license license:bsd-3)))
 
+(define-public gklib-suitesparse
+  (package/inherit gklib
+    (name "gklib-suitesparse")
+    (source (origin
+              (inherit (package-source gklib))
+              (patches (cons
+                        (search-patch
+                         "gklib-suitesparse.patch")
+                        (origin-patches (package-source gklib))))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments gklib)
+       ((#:phases phases #~%standard-phases)
+        #~(modify-phases #$phases
+            (add-after 'unpack 'patch-cmake
+              (lambda _
+                (substitute* "CMakeLists.txt"
+                  (("add_library\\(GKlib.*" all)
+                   (string-append
+                    all
+                    "target_link_libraries(GKlib PUBLIC"
+                    " ${SUITESPARSE_CONFIG_LIBRARIES} m)\n")))))))))
+    (inputs
+     (modify-inputs (package-inputs gklib)
+       (prepend suitesparse-config)))))
+
 (define-public suitesparse
   (package
     (name "suitesparse")
diff --git a/gnu/packages/patches/gklib-suitesparse.patch b/gnu/packages/patches/gklib-suitesparse.patch
new file mode 100644
index 0000000000..8b6c708b6a
--- /dev/null
+++ b/gnu/packages/patches/gklib-suitesparse.patch
@@ -0,0 +1,65 @@
+This patch contains the relevant changes to GKlib made in SuiteSparse
+(CHOLMOD) for the version 7.2.0
+(https://github.com/DrTimothyAldenDavis/SuiteSparse/commit/8a7641cdb4809533c681417e94f98058c07c5da2).
+The disabling of signal handling when MATLAB_MEX_FILE is defined is omitted.
+
+diff -ur a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,6 +3,8 @@
+ 
+ option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)
+ 
++find_package ( SuiteSparse_config 7.1.0 REQUIRED )
++
+ get_filename_component(abs "." ABSOLUTE)
+ set(GKLIB_PATH ${abs})
+ unset(abs)
+diff -ur a/GKlib.h b/GKlib.h
+--- a/GKlib.h
++++ b/GKlib.h
+@@ -59,6 +59,24 @@
+ #include <omp.h>
+ #endif
+ 
++/* -------------------------------------------------------------------------- */
++/* Added for incorporation into SuiteSparse.
++   Tim Davis, Oct 31, 2022, Texas A&M University. */
++#include "SuiteSparse_config.h"
++#define malloc  SuiteSparse_config_malloc
++#define calloc  SuiteSparse_config_calloc
++#define realloc SuiteSparse_config_realloc
++#define free(p)                                 \
++{                                               \
++    if ((p) != NULL)                            \
++    {                                           \
++        SuiteSparse_config_free (p) ;           \
++        (p) = NULL ;                            \
++    }                                           \
++}
++
++/* -------------------------------------------------------------------------- */
++
+ 
+ 
+ 
+diff -ur a/memory.c b/memory.c
+--- a/memory.c
++++ b/memory.c
+@@ -108,6 +108,8 @@
+ /*************************************************************************/
+ int gk_malloc_init()
+ {
++  gkmcore = NULL;
++#if 0
+   if (gkmcore == NULL)
+     gkmcore = gk_gkmcoreCreate();
+ 
+@@ -115,6 +117,7 @@
+     return 0;
+ 
+   gk_gkmcorePush(gkmcore);
++#endif
+ 
+   return 1;
+ }
-- 
2.41.0





  parent reply	other threads:[~2023-09-20 22:09 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 22:05 [bug#66129] [PATCH 00/20] Split SuiteSparse into subpackages David Elsing
2023-09-20 22:07 ` [bug#66129] [PATCH 01/20] gnu: suitesparse: Tweak description David Elsing
2023-09-20 22:07 ` [bug#66129] [PATCH 02/20] gnu: Add suitesparse-config David Elsing
2023-09-20 22:07 ` [bug#66129] [PATCH 03/20] gnu: Add suitesparse-amd David Elsing
2023-09-20 22:07 ` [bug#66129] [PATCH 04/20] gnu: Add suitesparse-btf David Elsing
2023-09-20 22:07 ` [bug#66129] [PATCH 05/20] gnu: Add suitesparse-camd David Elsing
2023-09-20 22:07 ` [bug#66129] [PATCH 06/20] gnu: Add suitesparse-colamd David Elsing
2023-09-20 22:07 ` [bug#66129] [PATCH 07/20] gnu: Add suitesparse-ccolamd David Elsing
2023-09-20 22:07 ` [bug#66129] [PATCH 08/20] gnu: Add gklib David Elsing
2023-09-20 22:07 ` [bug#66129] [PATCH 09/20] gnu: Add metis-5.2 David Elsing
2023-09-20 22:08 ` David Elsing [this message]
2023-09-20 22:08 ` [bug#66129] [PATCH 11/20] gnu: Add metis-suitesparse David Elsing
2023-09-20 22:08 ` [bug#66129] [PATCH 12/20] gnu: Add suitesparse-cholmod David Elsing
2023-09-20 22:08 ` [bug#66129] [PATCH 13/20] gnu: Add suitesparse-cxsparse David Elsing
2023-09-20 22:08 ` [bug#66129] [PATCH 14/20] gnu: Add suitesparse-klu David Elsing
2023-09-20 22:08 ` [bug#66129] [PATCH 15/20] gnu: Add suitesparse-ldl David Elsing
2023-09-20 22:08 ` [bug#66129] [PATCH 16/20] gnu: Add suitesparse-rbio David Elsing
2023-09-20 22:08 ` [bug#66129] [PATCH 17/20] gnu: Add suitesparse-mongoose David Elsing
2023-09-20 22:08 ` [bug#66129] [PATCH 18/20] gnu: Add suitesparse-spex David Elsing
2023-09-20 22:08 ` [bug#66129] [PATCH 19/20] gnu: Add suitesparse-spqr David Elsing
2023-09-20 22:08 ` [bug#66129] [PATCH 20/20] gnu: Add suitesparse-umfpack David Elsing
2023-09-21 13:27 ` [bug#66129] [PATCH v2 01/20] gnu: suitesparse: Tweak description David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 02/20] gnu: Add suitesparse-config David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 03/20] gnu: Add suitesparse-amd David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 04/20] gnu: Add suitesparse-btf David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 05/20] gnu: Add suitesparse-camd David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 06/20] gnu: Add suitesparse-colamd David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 07/20] gnu: Add suitesparse-ccolamd David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 08/20] gnu: Add gklib David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 09/20] gnu: Add metis-5.2 David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 10/20] gnu: Add gklib-suitesparse David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 11/20] gnu: Add metis-suitesparse David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 12/20] gnu: Add suitesparse-cholmod David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 13/20] gnu: Add suitesparse-cxsparse David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 14/20] gnu: Add suitesparse-klu David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 15/20] gnu: Add suitesparse-ldl David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 16/20] gnu: Add suitesparse-rbio David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 17/20] gnu: Add suitesparse-mongoose David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 18/20] gnu: Add suitesparse-spex David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 19/20] gnu: Add suitesparse-spqr David Elsing
2023-09-21 13:27   ` [bug#66129] [PATCH v2 20/20] gnu: Add suitesparse-umfpack David Elsing
2023-10-05 13:20 ` [bug#66129] [PATCH 00/20] Split SuiteSparse into subpackages Ludovic Courtès
2023-10-05 14:09   ` Ludovic Courtès
2023-10-05 21:33     ` David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 01/20] gnu: suitesparse: Tweak description David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 02/20] gnu: Add suitesparse-config David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 03/20] gnu: Add suitesparse-amd David Elsing
2023-10-19  6:58         ` Ludovic Courtès
2023-10-19 22:29           ` David Elsing
2023-10-19 22:31             ` [bug#66129] [PATCH] gnu: Propagate suitesparse-* inputs referenced in header files David Elsing
2023-10-20  8:39               ` Ludovic Courtès
2023-10-05 21:34       ` [bug#66129] [PATCH v3 04/20] gnu: Add suitesparse-btf David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 05/20] gnu: Add suitesparse-camd David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 06/20] gnu: Add suitesparse-colamd David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 07/20] gnu: Add suitesparse-ccolamd David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 08/20] gnu: Add gklib David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 09/20] gnu: Add metis-5.2 David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 10/20] gnu: Add gklib-suitesparse David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 11/20] gnu: Add metis-suitesparse David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 12/20] gnu: Add suitesparse-cholmod David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 13/20] gnu: Add suitesparse-cxsparse David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 14/20] gnu: Add suitesparse-klu David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 15/20] gnu: Add suitesparse-ldl David Elsing
2023-10-05 21:34       ` [bug#66129] [PATCH v3 16/20] gnu: Add suitesparse-rbio David Elsing
2023-10-05 21:35       ` [bug#66129] [PATCH v3 17/20] gnu: Add suitesparse-mongoose David Elsing
2023-10-05 21:35       ` [bug#66129] [PATCH v3 18/20] gnu: Add suitesparse-spex David Elsing
2023-10-05 21:35       ` [bug#66129] [PATCH v3 19/20] gnu: Add suitesparse-spqr David Elsing
2023-10-05 21:35       ` [bug#66129] [PATCH v3 20/20] gnu: Add suitesparse-umfpack David Elsing
2023-10-06 10:31       ` bug#66129: [PATCH 00/20] Split SuiteSparse into subpackages Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=28bb0d1f9a1530497514d57a15aabeb1990536a8.1695246169.git.david.elsing@posteo.net \
    --to=david.elsing@posteo.net \
    --cc=66129@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).