From patchwork Wed Sep 20 22:08:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 54091 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 D30CA27BBEB; Wed, 20 Sep 2023 23:09:50 +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 D92A927BBEA for ; Wed, 20 Sep 2023 23:09:49 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qj5NT-00076N-S6; Wed, 20 Sep 2023 18:08:59 -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 1qj5NS-000760-Vw for guix-patches@gnu.org; Wed, 20 Sep 2023 18:08: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 1qj5NS-0005B6-Nm for guix-patches@gnu.org; Wed, 20 Sep 2023 18:08:58 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qj5Nc-0005U7-8R for guix-patches@gnu.org; Wed, 20 Sep 2023 18:09:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66129] [PATCH 10/20] gnu: Add gklib-suitesparse. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 20 Sep 2023 22:09:08 +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.169524774320980 (code B ref 66129); Wed, 20 Sep 2023 22:09:08 +0000 Received: (at 66129) by debbugs.gnu.org; 20 Sep 2023 22:09:03 +0000 Received: from localhost ([127.0.0.1]:60511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qj5NV-0005S5-VN for submit@debbugs.gnu.org; Wed, 20 Sep 2023 18:09:02 -0400 Received: from mout01.posteo.de ([185.67.36.65]:43273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qj5NR-0005Pi-5e for 66129@debbugs.gnu.org; Wed, 20 Sep 2023 18:08:57 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DC992240027 for <66129@debbugs.gnu.org>; Thu, 21 Sep 2023 00:08:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695247721; bh=nylsSrxQ/rut+G0abrH1PDDHWzAoXwEsOTj+nVeysrU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=SCYcSv+W5UmW29Ti5sOqt1/ZO237H+hVEV+C+EfEmXuTJNE9KzPokZcf5UE+JSqo2 L0IcGTYMsCHyjgRn+WU6TzIHO7nXvNySDIMV2Rj17j14fxF4n/zfT8q3+vCKs/nl2x E74BJxaKWrn07zy3+RWGsjwb5QS0gQ+16c8VapsIfWqChjfiqaM2MQBLYovL7nitSu St6jDvM8k5XHcGcLfglUPHwLUKUGQ8huz/Baa/x4LZLS1wAkGODQ2HoSIm2nULnoxj YXIHrK+BGELgcZ9Mkp4EcHX0X1VzlP2mccgitfgApaDS+59aYa4qWsDeGicpO5Z3OT BQgje0LnG/Gmg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RrXjj3FkRz9ryn; Thu, 21 Sep 2023 00:08:41 +0200 (CEST) From: David Elsing Date: Wed, 20 Sep 2023 22:08:00 +0000 Message-ID: <28bb0d1f9a1530497514d57a15aabeb1990536a8.1695246169.git.david.elsing@posteo.net> In-Reply-To: References: 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 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 + #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; + }