From patchwork Thu Oct 5 21:34:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 54509 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 72FE427BBE9; Thu, 5 Oct 2023 22:38:16 +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 7B22227BBE2 for ; Thu, 5 Oct 2023 22:38:15 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoW2W-0003DN-5z; Thu, 05 Oct 2023 17:37:48 -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 1qoW2T-0003Ac-Qc for guix-patches@gnu.org; Thu, 05 Oct 2023 17:37:45 -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 1qoW2T-00042p-IB for guix-patches@gnu.org; Thu, 05 Oct 2023 17:37:45 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qoW2l-0002cc-VG for guix-patches@gnu.org; Thu, 05 Oct 2023 17:38:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66129] [PATCH v3 12/20] gnu: Add suitesparse-cholmod. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 05 Oct 2023 21:38:03 +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.16965418279850 (code B ref 66129); Thu, 05 Oct 2023 21:38:03 +0000 Received: (at 66129) by debbugs.gnu.org; 5 Oct 2023 21:37:07 +0000 Received: from localhost ([127.0.0.1]:48725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoW1q-0002Yc-Si for submit@debbugs.gnu.org; Thu, 05 Oct 2023 17:37:07 -0400 Received: from mout02.posteo.de ([185.67.36.66]:41151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoW1j-0002VZ-8i for 66129@debbugs.gnu.org; Thu, 05 Oct 2023 17:37:00 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6570F240101 for <66129@debbugs.gnu.org>; Thu, 5 Oct 2023 23:36:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1696541800; bh=J3fYxWt0aFI82e0XzABoC5fpLCn/vJQseWzdu/ah98k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=ezS2qJC4e5wjymfd2PnBoZQ7VsvBVllpiQ/KB7XpYsYfcXTCCW8OScRDAuPSs3mCx w7nG6YOtkHVmckaLivviy42vc5+yFaTlhnNPZk/Fp+7e4MHNvzXl0b1ANNywtO2YVN 4EX2/JsRn1GmjP0jFJvuyfJKYwUq0ZWfyjc1Oz2JslKcbwqf69liLUQyT9/88WeZdQ /7JqaE134jhULuSs5XV6TblIWBxwybqIy2jV+FP9I5jcvDklqYJ5bipG3UGMa6zOmr fhDi1PrPdEduKAINzIoffBsjDH+n7JWTFF34K5ggafmV8K2UMJNTapDCWuoBBKfvkA efSPmni3Mj31A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S1lHr097Rz6tvc; Thu, 5 Oct 2023 23:36:40 +0200 (CEST) From: David Elsing Date: Thu, 5 Oct 2023 21:34:55 +0000 Message-ID: <1649491d0950adcd3e86012a40a128c17169fef7.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 (suitesparse-cholmod): New variable. --- gnu/packages/maths.scm | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index e2018d4540..ad08f36931 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -5448,6 +5448,91 @@ (define-public metis-suitesparse (string-append "-DGKLIB_PATH=" #$gklib-suitesparse))))) (inputs (list suitesparse-config gklib-suitesparse)))) +(define-public suitesparse-cholmod + (package + (name "suitesparse-cholmod") + (version "4.2.0") + (source suitesparse-source) + (build-system cmake-build-system) + (arguments + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "CHOLMOD"))) + (add-after 'chdir 'set-cmake-module-path + (lambda _ + (substitute* "CMakeLists.txt" + (("set.*CMAKE_MODULE_PATH.*") + (string-append + "set(CMAKE_MODULE_PATH " + (string-join + (map (lambda (path) + (string-append path "/lib/cmake/SuiteSparse")) + (list #$suitesparse-amd + #$suitesparse-camd + #$suitesparse-ccolamd + #$suitesparse-colamd + #$suitesparse-config))) + ")\nset(DUMMY\n")) + (("add_subdirectory.*GPU.*") "\n") + ((".*cmake_modules/FindCHOLMOD_CUDA.cmake.*") "\n")))) + (add-after 'chdir 'use-external-metis + (lambda _ + (let ((port (open-file "CMakeLists.txt" "a"))) + (display + (string-append + "find_library(METIS_LIBRARY NAME metis PATHS ENV LIBRARY_PATH) +get_filename_component(METIS_LIBRARY ${METIS_LIBRARY} REALPATH) +find_library(GKLIB_LIBRARY NAME GKlib PATHS ENV LIBRARY_PATH) +get_filename_component(GKLIB_LIBRARY ${GKLIB_LIBRARY} REALPATH) +target_link_libraries(CHOLMOD PRIVATE ${METIS_LIBRARY} ${GKLIB_LIBRARY}) +target_link_libraries(CHOLMOD_static PRIVATE ${METIS_LIBRARY} ${GKLIB_LIBRARY})") + port) + (close-port port)) + (delete-file "Partition/cholmod_metis_wrapper.c") + (delete-file "Partition/cholmod_metis_wrapper.h") + (substitute* "Partition/cholmod_metis.c" + (("#include \"cholmod_metis_wrapper\\.h\"") "") + (("#include \"SuiteSparse_metis/include/metis.h\"") + "#include ") + (("SuiteSparse_metis_METIS") "METIS")))) + (add-after 'build 'build-doc + (lambda _ + (with-directory-excursion "../CHOLMOD/Doc" + (invoke "make")))) + (add-after 'install 'install-doc + (lambda _ + (install-file "../CHOLMOD/Doc/CHOLMOD_UserGuide.pdf" + (string-append #$output "/share/doc/" + #$name "-" #$version)))) + (replace 'install-license-files + (lambda _ + (let ((out (string-append #$output + "/share/doc/" #$name "-" #$version))) + (install-file "../CHOLMOD/Doc/License.txt" out) + (install-file "../CHOLMOD/Core/lesser.txt" out) + (install-file "../CHOLMOD/MatrixOps/gpl.txt" out))))))) + (inputs + (list gklib-suitesparse + metis-suitesparse + openblas + suitesparse-amd + suitesparse-camd + suitesparse-ccolamd + suitesparse-colamd + suitesparse-config)) + (native-inputs (list (texlive-updmap.cfg '()))) + (home-page "https://people.engr.tamu.edu/davis/suitesparse.html") + (synopsis "Library for solving sparse symmetric positive definite linear +equations") + (description "CHOLMOD is a set of routins for factorizing sparse symmetrix +positive definite matrices, updating/downdating sparse Cholesky factorizations +and other related operations.") + (license (list license:gpl2+ license:lgpl2.1+)))) + (define-public suitesparse (package (name "suitesparse")