summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Elsing <david.elsing@posteo.net>2023-10-05 21:34:56 +0000
committerLudovic Courtès <ludo@gnu.org>2023-10-06 12:26:46 +0200
commitec2c7d2d48b1cc0d6ea5b779db16aa04ce2d34fd (patch)
tree123396a189c5fa16af460ed6171e38603ada1520
parent75faca26c27705b161d78b933c6886d90695ca6f (diff)
downloadguix-ec2c7d2d48b1cc0d6ea5b779db16aa04ce2d34fd.tar.gz
gnu: Add suitesparse-cxsparse.
* gnu/packages/maths.scm (suitesparse-cxsparse): New variable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--gnu/packages/maths.scm34
1 files changed, 34 insertions, 0 deletions
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index ad08f36931..b2da54239f 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5533,6 +5533,40 @@ positive definite matrices, updating/downdating sparse Cholesky factorizations
 and other related operations.")
     (license (list license:gpl2+ license:lgpl2.1+))))
 
+(define-public suitesparse-cxsparse
+  (package
+    (name "suitesparse-cxsparse")
+    (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 "CXSparse")))
+          (add-after 'chdir 'set-cmake-module-path
+            (lambda _
+              (substitute* "CMakeLists.txt"
+                (("set.*CMAKE_MODULE_PATH.*")
+                 (string-append "set(CMAKE_MODULE_PATH "
+                                #$suitesparse-config "/lib/cmake/SuiteSparse)\n"
+                                "set(DUMMY\n")))))
+          (replace 'install-license-files
+            (lambda _
+              (let ((out (string-append #$output
+                                        "/share/doc/" #$name "-" #$version)))
+                (install-file "../CXSparse/Doc/License.txt" out)
+                (install-file "../CXSparse/Doc/lesser.txt" out)))))))
+    (inputs (list suitesparse-config))
+    (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
+    (synopsis "Concise eXtended Sparse Matrix Package")
+    (description "CXSparse is a collection of sparse matrix algorithms for
+direct methods on both real and complex matrices.")
+    (license license:lgpl2.1+)))
+
 (define-public suitesparse
   (package
     (name "suitesparse")