diff mbox series

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

Message ID 039a1767e09d20d1797b979e29ceb139c6a25630.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-umfpack): New variable.
---
 gnu/packages/maths.scm | 68 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index a5d7f4ebd3..fbfa94265b 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5747,6 +5747,74 @@  (define-public suitesparse-spqr
 matrices.")
     (license license:gpl2+)))
 
+(define-public suitesparse-umfpack
+  (package
+    (name "suitesparse-umfpack")
+    (version "6.2.0")
+    (source (suitesparse-package-src name "UMFPACK"))
+    (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 _
+              (let ((outdir
+                     (string-append #$output "/share/doc/"
+                                    #$name "-" #$version)))
+                (install-file "../source/Doc/UMFPACK_UserGuide.pdf" outdir)
+                (install-file "../source/Doc/UMFPACK_QuickStart.pdf" outdir))))
+          (replace 'install-license-files
+            (lambda _
+              (let ((outdir
+                     (string-append #$output "/share/doc/"
+                                    #$name "-" #$version)))
+                (install-file "../source/Doc/License.txt" outdir)
+                (install-file "../source/Doc/gpl.txt" outdir)))))))
+    (inputs
+     (list openblas
+           suitesparse-amd
+           suitesparse-camd
+           suitesparse-ccolamd
+           suitesparse-cholmod
+           suitesparse-colamd
+           suitesparse-config))
+    (native-inputs
+     (list (texlive-updmap.cfg
+            (list texlive-etoolbox
+                  texlive-framed
+                  texlive-mdframed
+                  texlive-needspace
+                  texlive-xcolor
+                  texlive-zref))))
+    (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
+    (synopsis "Routines for solving sparse linear problems via LU factorization")
+    (description "UMFPACK is a set of routines for solving unsymmetric sparse
+linear systems using the Unsymmetric MultiFrontal method and direct sparse LU
+factorization.")
+    (license license:gpl2+)))
+
 (define-public suitesparse
   (package
     (name "suitesparse")