mbox series

[bug#66129,00/20] Split SuiteSparse into subpackages

Message ID cover.1695246169.git.david.elsing@posteo.net
Headers show
Series Split SuiteSparse into subpackages | expand

Message

David Elsing Sept. 20, 2023, 10:05 p.m. UTC
This patch series adds the individual SuiteSparse packages (as in
Gentoo:
https://packages.gentoo.org/packages/sci-libs/suitesparse/dependencies),
with autogenerated files and bundled libraries removed.

The GraphBLAS library is not yet included, but AFAICT it is not required
by any other package. It also makes up by far the most space of the
suitesparse package, e.g. on x86_64-linux, libgraphblas.so.7.2.0 is 196
MB of the 201 MB SuiteSparse package.

I think it would be best to keep the full suitesparse package until all
of its dependencies are updated and the GraphBLAS package is added, as
replacing them all at once would make the patch series quite large.

Is the use of (@@ (guix packages) computed-origin-method) ok for
creating the individual origins or is there another alternative?

David Elsing (20):
  gnu: suitesparse: Tweak description.
  gnu: Add suitesparse-config.
  gnu: Add suitesparse-amd.
  gnu: Add suitesparse-btf.
  gnu: Add suitesparse-camd.
  gnu: Add suitesparse-colamd.
  gnu: Add suitesparse-ccolamd.
  gnu: Add gklib.
  gnu: Add metis-5.2.
  gnu: Add gklib-suitesparse.
  gnu: Add metis-suitesparse.
  gnu: Add suitesparse-cholmod.
  gnu: Add suitesparse-cxsparse.
  gnu: Add suitesparse-klu.
  gnu: Add suitesparse-ldl.
  gnu: Add suitesparse-rbio.
  gnu: Add suitesparse-mongoose.
  gnu: Add suitesparse-spex.
  gnu: Add suitesparse-spqr.
  gnu: Add suitesparse-umfpack.

 gnu/packages/maths.scm                       | 922 ++++++++++++++++++-
 gnu/packages/patches/gklib-suitesparse.patch |  65 ++
 2 files changed, 986 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gklib-suitesparse.patch

Comments

Ludovic Courtès Oct. 5, 2023, 1:20 p.m. UTC | #1
Hi David,

David Elsing <david.elsing@posteo.net> skribis:

> This patch series adds the individual SuiteSparse packages (as in
> Gentoo:
> https://packages.gentoo.org/packages/sci-libs/suitesparse/dependencies),
> with autogenerated files and bundled libraries removed.

Nice!

> The GraphBLAS library is not yet included, but AFAICT it is not required
> by any other package. It also makes up by far the most space of the
> suitesparse package, e.g. on x86_64-linux, libgraphblas.so.7.2.0 is 196
> MB of the 201 MB SuiteSparse package.
>
> I think it would be best to keep the full suitesparse package until all
> of its dependencies are updated and the GraphBLAS package is added, as
> replacing them all at once would make the patch series quite large.
>
> Is the use of (@@ (guix packages) computed-origin-method) ok for
> creating the individual origins or is there another alternative?

Instead of:

+(define (suitesparse-package-src name path)
+  (origin
+    (method (@@ (guix packages) computed-origin-method))
+    (file-name
+     (string-append name "-" suitesparse-version))
+    (sha256 #f)
+    (uri
+     (delay
+       (with-imported-modules '((guix build utils))
+         #~(begin
+             (use-modules (guix build utils))
+             (copy-recursively
+              (string-append #$suitesparse-src "/" #$path) #$output)))))))

I’d suggest this:

  (define (suitesparse-package-source name directory)
    (computed-file (string-append name "-" suitesparse-version ".tar.xz")
                   (with-imported-modules '((guix build utils))
                     #~(begin
                         (use-modules (guix build utils))
                         (copy-recursively
                          (string-append #$suitesparse-src "/" #$directory)
                                         #$output)))))

That way we have something simple that doesn’t rely on a private
procedure.

>   gnu: suitesparse: Tweak description.
>   gnu: Add suitesparse-config.
>   gnu: Add suitesparse-amd.
>   gnu: Add suitesparse-btf.
>   gnu: Add suitesparse-camd.
>   gnu: Add suitesparse-colamd.
>   gnu: Add suitesparse-ccolamd.
>   gnu: Add gklib.
>   gnu: Add metis-5.2.
>   gnu: Add gklib-suitesparse.
>   gnu: Add metis-suitesparse.
>   gnu: Add suitesparse-cholmod.
>   gnu: Add suitesparse-cxsparse.
>   gnu: Add suitesparse-klu.
>   gnu: Add suitesparse-ldl.
>   gnu: Add suitesparse-rbio.
>   gnu: Add suitesparse-mongoose.
>   gnu: Add suitesparse-spex.
>   gnu: Add suitesparse-spqr.
>   gnu: Add suitesparse-umfpack.

Apart from the trick above, this looks great to me!

Could you send an updated version?

Thanks,
Ludo’.
Ludovic Courtès Oct. 5, 2023, 2:09 p.m. UTC | #2
Ludovic Courtès <ludovic.courtes@inria.fr> skribis:

>   (define (suitesparse-package-source name directory)
>     (computed-file (string-append name "-" suitesparse-version ".tar.xz")
>                    (with-imported-modules '((guix build utils))
>                      #~(begin
>                          (use-modules (guix build utils))
>                          (copy-recursively
>                           (string-append #$suitesparse-src "/" #$directory)
>                                          #$output)))))

Now that I think about it, we might just as well keep the same source
for each sub-package along with a phase that does (chdir DIR).

The advantage is that we would not spend CPU time and storage space
building one tarball per package.  The downside is that it might make
package definitions less concise.

Your call!

Ludo’.
David Elsing Oct. 5, 2023, 9:33 p.m. UTC | #3
Ludovic Courtès <ludovic.courtes@inria.fr> writes:

Hello,

> Now that I think about it, we might just as well keep the same source
> for each sub-package along with a phase that does (chdir DIR).
>
> The advantage is that we would not spend CPU time and storage space
> building one tarball per package.  The downside is that it might make
> package definitions less concise.

I changed the packages to use the same source. With the autogenerated
files removed, it is somewhat less unwieldy than the original checkout
(90 MB instead of 165 MB).

> Ludo’.

Cheers,
David
Ludovic Courtès Oct. 6, 2023, 10:31 a.m. UTC | #4
Hi David,

David Elsing <david.elsing@posteo.net> skribis:

> I changed the packages to use the same source. With the autogenerated
> files removed, it is somewhat less unwieldy than the original checkout
> (90 MB instead of 165 MB).

Awesome.

I pushed the whole series as 1b5067c0d002c5d019ab69c5fbc22fac68acda3d.

Thanks,
Ludo’.