From patchwork Thu Sep 21 13:27:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 54127 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B1E4127BBEA; Thu, 21 Sep 2023 14:29:49 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AE2FC27BBE9 for ; Thu, 21 Sep 2023 14:29:48 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjJjr-0004Hn-E2; Thu, 21 Sep 2023 09:29:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjJjn-0004EW-9E for guix-patches@gnu.org; Thu, 21 Sep 2023 09:28:59 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qjJjm-0006dA-0f for guix-patches@gnu.org; Thu, 21 Sep 2023 09:28:58 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qjJjv-0004uo-TO for guix-patches@gnu.org; Thu, 21 Sep 2023 09:29:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66129] [PATCH v2 10/20] gnu: Add gklib-suitesparse. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 21 Sep 2023 13:29:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66129 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66129@debbugs.gnu.org Cc: David Elsing Received: via spool by 66129-submit@debbugs.gnu.org id=B66129.169530292618796 (code B ref 66129); Thu, 21 Sep 2023 13:29:07 +0000 Received: (at 66129) by debbugs.gnu.org; 21 Sep 2023 13:28:46 +0000 Received: from localhost ([127.0.0.1]:33067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjJjZ-0004t1-GQ for submit@debbugs.gnu.org; Thu, 21 Sep 2023 09:28:46 -0400 Received: from mout01.posteo.de ([185.67.36.65]:39089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjJjQ-0004q8-Ji for 66129@debbugs.gnu.org; Thu, 21 Sep 2023 09:28:37 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 41657240029 for <66129@debbugs.gnu.org>; Thu, 21 Sep 2023 15:28:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695302900; bh=rGTNwfFNqNbZcIvOB5d4tZnpyexa/UpIGwYwiQt1nMs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=k6ERDOJZzdN8CdOc8LQjvm1FL7ZMoMMxmD+Ef6AilXsiMRjLJd+gRs5Tsk8hpHISW Rz6brmJM8xjaIfypcnzDeFF+SZN45pIz+15lyTV1lK2SKcftrtcNFOLOXC3YeJXqLs GA4m9YFpnhppHaup1f/q4Y2lkFqLjOyC5pfSBhh/iS019EXTQsanqzzUDJDonOeNkl 7sMbOcs1sc7cV2lMcus78Yu7sTplaC7ttiyO7vs9koQSw0a/I2XKxYdeJnr6gHSN6l UrRkX47pC3qRVVwQ2QoTPK6cKTTD4aLhVLf3MyTJBHYaWYdzNVwaIpEu1DQN+uv5lO YZWYgKviheoEw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Rrx6q6MWWz9s0l; Thu, 21 Sep 2023 15:28:19 +0200 (CEST) From: David Elsing Date: Thu, 21 Sep 2023 13:27:45 +0000 Message-ID: <6bcdd5782ba9e7bd231aa7419d9aec9816fbb919.1695302719.git.david.elsing@posteo.net> In-Reply-To: <2e6dce4c1faecf1e5516f477a1b372da205573ba.1695302719.git.david.elsing@posteo.net> References: <2e6dce4c1faecf1e5516f477a1b372da205573ba.1695302719.git.david.elsing@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 2a9040ad39..3a86e90cb5 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -5238,6 +5238,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 + #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; + }