diff mbox series

[bug#66129,v2,19/20] gnu: Add suitesparse-spqr.

Message ID 45138f7d8e6f5998835ce03c0a8214e162ee4d54.1695302719.git.david.elsing@posteo.net
State New
Headers show
Series [bug#66129,v2,01/20] gnu: suitesparse: Tweak description. | expand

Commit Message

David Elsing Sept. 21, 2023, 1:27 p.m. UTC
* gnu/packages/maths.scm (suitesparse-spqr): New variable.
---
 gnu/packages/maths.scm | 59 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 237c4fb5cd..a5d7f4ebd3 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5688,6 +5688,65 @@  (define-public suitesparse-spex
     ;; Dual licensed.
     (license (list license:lgpl3+ license:gpl2+))))
 
+(define-public suitesparse-spqr
+  (package
+    (name "suitesparse-spqr")
+    (version "4.2.0")
+    (source (suitesparse-package-src name "SPQR"))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack '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-cholmod
+                              #$suitesparse-colamd
+                              #$suitesparse-config)))
+                  ")\nset(DUMMY\n")))))
+          (add-after 'build 'build-doc
+            (lambda _
+              (with-directory-excursion "../source/Doc"
+                (invoke "make"))))
+          (add-after 'install 'install-doc
+            (lambda _
+              (install-file "../source/Doc/spqr_user_guide.pdf"
+                            (string-append #$output "/share/doc/"
+                                           #$name "-" #$version))))
+          (replace 'install-license-files
+            (lambda _
+              (install-file "../source/Doc/License.txt"
+                            (string-append #$output "/share/doc/"
+                                           #$name "-" #$version)))))))
+    (inputs
+     (list openblas
+           suitesparse-amd
+           suitesparse-camd
+           suitesparse-ccolamd
+           suitesparse-cholmod
+           suitesparse-colamd
+           suitesparse-config))
+    (native-inputs
+     (list (texlive-updmap.cfg
+            (list texlive-epsf))))
+    (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
+    (synopsis "Sparse QR factorization method")
+    (description "The SPQR (SuiteSparseQR) package provides sparse QR
+factorization based on the multifrontal method, using BLAS for the frontal
+matrices.")
+    (license license:gpl2+)))
+
 (define-public suitesparse
   (package
     (name "suitesparse")