From patchwork Thu Oct 5 21:34:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 54515 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 7F76827BBEA; Thu, 5 Oct 2023 22:38:34 +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 BD76827BBE2 for ; Thu, 5 Oct 2023 22:38:32 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoW2b-0003H6-Hi; Thu, 05 Oct 2023 17:37:53 -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 1qoW2W-0003DR-AG for guix-patches@gnu.org; Thu, 05 Oct 2023 17:37:48 -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 1qoW2W-000444-1f for guix-patches@gnu.org; Thu, 05 Oct 2023 17:37:48 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qoW2o-0002dK-EI for guix-patches@gnu.org; Thu, 05 Oct 2023 17:38:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66129] [PATCH v3 10/20] gnu: Add gklib-suitesparse. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 05 Oct 2023 21:38:06 +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.16965418349914 (code B ref 66129); Thu, 05 Oct 2023 21:38:06 +0000 Received: (at 66129) by debbugs.gnu.org; 5 Oct 2023 21:37:14 +0000 Received: from localhost ([127.0.0.1]:48740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoW1x-0002Zj-So for submit@debbugs.gnu.org; Thu, 05 Oct 2023 17:37:14 -0400 Received: from mout02.posteo.de ([185.67.36.66]:54141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoW1n-0002W5-GN for 66129@debbugs.gnu.org; Thu, 05 Oct 2023 17:37:04 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E2B9B240101 for <66129@debbugs.gnu.org>; Thu, 5 Oct 2023 23:36:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1696541798; bh=chkAOVDLOZZpdCNoxYMsAqPweQ4MNK3Y1HKjzXOV5+U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=CBkk9mVVVXMx/j0TdzfAXS1vBJun9p8vV0EFoFPoZH8HmMA+fYAfVOqTiFcTrifTn MT7LQxLS420RCM/hvs+g8ZiR0pTVK+lceJApZR2a4nfpwZxwvbqrgA6FXTwwLW8L5q qlOlGjBLkDe1RX9rk2X8527aik2oS7YVr5zp4LUbCMLWAgm8nk4ZvSyyLwqCS4wFHg gjH0ZlxCphwz/JMks4r0QR6s35wzYsI/cj2T08fy+fZFiBA2KweWkFmPtD/c9LU5cg aEKUsRhGZzf57Lar4Ew086fW3p7lU280RxgaxKeilFbRepvHz2t7ua5gHW24rAlYcx G4x4nZWH7iVPA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S1lHp3dc2z9rxL; Thu, 5 Oct 2023 23:36:38 +0200 (CEST) From: David Elsing Date: Thu, 5 Oct 2023 21:34:53 +0000 Message-ID: <62cc2ef0bb3d731697494694dabb74fe946d2fc0.1696541452.git.david.elsing@posteo.net> In-Reply-To: <7ylecgah6b.fsf@posteo.net> References: <7ylecgah6b.fsf@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 76d770466f..a096b24cfe 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -5397,6 +5397,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; + }