unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#47613] [PATCH] add parmetis
@ 2021-04-06  9:39 Franck Pérignon
  2021-04-06 17:43 ` Leo Famulari
  0 siblings, 1 reply; 4+ messages in thread
From: Franck Pérignon @ 2021-04-06  9:39 UTC (permalink / raw)
  To: 47613

[-- Attachment #1: Type: text/plain, Size: 144 bytes --]

Hello,

the attached file adds parmetis (http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview) in guix, saved in gnu/packages/math.scm


[-- Attachment #2: 0001-PATCH-Add-parmetis.patch --]
[-- Type: application/octet-stream, Size: 2918 bytes --]

From a5ab2390787b144c76e8a0838f60f841e37b37bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franck=20P=C3=A9rignon?=
 <Franck.Perignon@univ-grenoble-alpes.fr>
Date: Tue, 6 Apr 2021 09:07:23 +0000
Subject: [PATCH] [PATCH] Add parmetis

---
 gnu/packages/maths.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 5cd11ec435..bdfa051db1 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -43,6 +43,7 @@
 ;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2021 Gerd Heber <gerd.heber@gmail.com>
+;;; Copyright © 2021 Franck Pérignon <franck.perignon@univ-grenoble-alpes.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3326,6 +3327,44 @@ recursive-bisection, multilevel k-way, and multi-constraint partitioning
 schemes.")
     (license license:asl2.0)))          ;As of version 5.0.3
 
+(define-public parmetis
+  (package
+    (name "parmetis")
+    (version "4.0.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/"
+                           "parmetis-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0pvfpvb36djvqlcc3lq7si0c5xpb2cqndjg8wvzg35ygnwqs5ngj"))))
+    (build-system cmake-build-system)
+    (native-inputs `(("gcc" ,gcc)
+                     ("openmpi" ,openmpi)))
+    (arguments
+     `(#:tests? #f                      ;no tests
+       #:configure-flags `("-DSHARED=ON"
+                           ,"-DCMAKE_C_COMPILER=mpicc"
+                           ,"-DCMAKE_CXX_COMPILER=mpic++"
+                           ,"-DCMAKE_VERBOSE_MAKEFILE=1"
+                           ,(string-append "-DGKLIB_PATH=../parmetis-4.0.3/metis/GKlib")
+                           ,(string-append "-DMETIS_PATH=../parmetis-4.0.3/metis" ))))
+    (home-page "http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview")
+    (synopsis "Parallel Graph Partitioning and Fill-reducing Matrix Ordering")
+    (description
+     "ParMETIS is an MPI-based parallel library that implements a variety of algorithms
+      for partitioning unstructured graphs, meshes, and for computing fill-reducing
+      orderings of sparse matrices.  ParMETIS extends the functionality provided
+      by METIS and includes routines that are especially
+      suited for parallel AMR computations and large scale numerical simulations.
+      The algorithms implemented in ParMETIS are based on the parallel multilevel k-way
+      graph-partitioning, adaptive repartitioning, and parallel multi-constrained
+      partitioning schemes developed in our lab.")
+    (license license:asl2.0)))
+
+
+
 (define-public p4est
   (package
     (name "p4est")
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#47613] [PATCH] add parmetis
  2021-04-06  9:39 [bug#47613] [PATCH] add parmetis Franck Pérignon
@ 2021-04-06 17:43 ` Leo Famulari
  2021-04-07 14:02   ` Franck Pérignon
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Famulari @ 2021-04-06 17:43 UTC (permalink / raw)
  To: Franck Pérignon; +Cc: 47613

Subject: [PATCH] [PATCH] Add parmetis

Thanks!


+    (build-system cmake-build-system)
+    (native-inputs `(("gcc" ,gcc)
+                     ("openmpi" ,openmpi)))

GCC is made available via the cmake-build-system, so I think we could
leave it out of native-inputs. Or am I missing something?

+    (arguments
+     `(#:tests? #f                      ;no tests
+       #:configure-flags `("-DSHARED=ON"
+                           ,"-DCMAKE_C_COMPILER=mpicc"
+                           ,"-DCMAKE_CXX_COMPILER=mpic++"
+                           ,"-DCMAKE_VERBOSE_MAKEFILE=1"
+                           ,(string-append "-DGKLIB_PATH=../parmetis-4.0.3/metis/GKlib")
+                           ,(string-append "-DMETIS_PATH=../parmetis-4.0.3/metis" ))))

We can avoid hard-coding the version string here, like this:

------
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index bdfa051db1..f0ebdd6009 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3348,8 +3348,10 @@ schemes.")
                            ,"-DCMAKE_C_COMPILER=mpicc"
                            ,"-DCMAKE_CXX_COMPILER=mpic++"
                            ,"-DCMAKE_VERBOSE_MAKEFILE=1"
-                           ,(string-append "-DGKLIB_PATH=../parmetis-4.0.3/metis/GKlib")
-                           ,(string-append "-DMETIS_PATH=../parmetis-4.0.3/metis" ))))
+                           ,(string-append "-DGKLIB_PATH=../parmetis-"
+                                           ,(package-version this-version) "/metis/GKlib"))
+                           ,(string-append "-DMETIS_PATH=../parmetis-"
+                                           ,(package-version this-version) "/metis"))))
     (home-page "http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview")
     (synopsis "Parallel Graph Partitioning and Fill-reducing Matrix Ordering")
     (description
------

+    (license license:asl2.0)))

There is a problem with the licensing, however. In the source code,
LICENSE.txt contains this:

------
Copyright & License Notice
--------------------------

The ParMETIS package is copyrighted by the Regents of the 
University of Minnesota. It can be freely used for educational and 
research purposes by non-profit institutions and US government 
agencies only. Other organizations are allowed to use ParMETIS 
only for evaluation purposes, and any further uses will require prior 
approval. The software may not be sold or redistributed without prior 
approval. One may make copies of the software for their use provided 
that the copies, are not sold or distributed, are used under the same 
terms and conditions.

As unestablished research software, this code is provided on an  
``as is'' basis without warranty of any kind, either expressed or
implied. The downloading, or executing any part of this software
constitutes an implicit agreement to these terms. These terms and 
conditions are subject to change at any time without prior notice.
------

I saw in 'metis/Changelog' that a relicensing to Apache 2 was done for
the "metis" program in version 5.0.3. But, this is "parmetis", version
4.0.3.

If the copyright owners intend to release this as free software, they
need to change the 'LICENSE.txt' file.




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#47613] [PATCH] add parmetis
  2021-04-06 17:43 ` Leo Famulari
@ 2021-04-07 14:02   ` Franck Pérignon
  2021-04-08  7:16     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Franck Pérignon @ 2021-04-07 14:02 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 47613

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

Thanks for the review (of this and of scotch-shared)

Yes, you’re right, gcc native-inputs can be removed and yes, it’s probably better to avoid hard-coding version string
A new patch is attached that works for me.

Regarding the license, I missed this. Is it possible to directly attached the LICENSE.txt in the guix recipe ? If so, what’s the proper syntax ?

Thanks


[-- Attachment #2: 0002-fix-parmetis.patch --]
[-- Type: application/octet-stream, Size: 1760 bytes --]

From f056bb21841032d769bf075be9da1a49f61c2d0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franck=20P=C3=A9rignon?=
 <Franck.Perignon@univ-grenoble-alpes.fr>
Date: Wed, 7 Apr 2021 13:52:52 +0000
Subject: [PATCH 2/2] fix parmetis

---
 gnu/packages/maths.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 1a177e0389..564e2789f9 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3419,16 +3419,17 @@ schemes.")
         (base32
          "0pvfpvb36djvqlcc3lq7si0c5xpb2cqndjg8wvzg35ygnwqs5ngj"))))
     (build-system cmake-build-system)
-    (native-inputs `(("gcc" ,gcc)
-                     ("openmpi" ,openmpi)))
+    (native-inputs `(("openmpi" ,openmpi)))
     (arguments
      `(#:tests? #f                      ;no tests
        #:configure-flags `("-DSHARED=ON"
                            ,"-DCMAKE_C_COMPILER=mpicc"
                            ,"-DCMAKE_CXX_COMPILER=mpic++"
                            ,"-DCMAKE_VERBOSE_MAKEFILE=1"
-                           ,(string-append "-DGKLIB_PATH=../parmetis-4.0.3/metis/GKlib")
-                           ,(string-append "-DMETIS_PATH=../parmetis-4.0.3/metis" ))))
+                           ,(string-append "-DGKLIB_PATH=../parmetis-"
+                                           ,(package-version parmetis) "/metis/GKlib")
+                           ,(string-append "-DMETIS_PATH=../parmetis-"
+                                           ,(package-version parmetis) "/metis"))))
     (home-page "http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview")
     (synopsis "Parallel Graph Partitioning and Fill-reducing Matrix Ordering")
     (description
-- 
2.25.1


[-- Attachment #3: Type: text/plain, Size: 3537 bytes --]







> Le 6 avr. 2021 à 19:43, Leo Famulari <leo@famulari.name> a écrit :
> 
> Subject: [PATCH] [PATCH] Add parmetis
> 
> Thanks!
> 
> 
> +    (build-system cmake-build-system)
> +    (native-inputs `(("gcc" ,gcc)
> +                     ("openmpi" ,openmpi)))
> 
> GCC is made available via the cmake-build-system, so I think we could
> leave it out of native-inputs. Or am I missing something?
> 

> +    (arguments
> +     `(#:tests? #f                      ;no tests
> +       #:configure-flags `("-DSHARED=ON"
> +                           ,"-DCMAKE_C_COMPILER=mpicc"
> +                           ,"-DCMAKE_CXX_COMPILER=mpic++"
> +                           ,"-DCMAKE_VERBOSE_MAKEFILE=1"
> +                           ,(string-append "-DGKLIB_PATH=../parmetis-4.0.3/metis/GKlib")
> +                           ,(string-append "-DMETIS_PATH=../parmetis-4.0.3/metis" ))))
> 
> We can avoid hard-coding the version string here, like this:
> 
> ------
> diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
> index bdfa051db1..f0ebdd6009 100644
> --- a/gnu/packages/maths.scm
> +++ b/gnu/packages/maths.scm
> @@ -3348,8 +3348,10 @@ schemes.")
>                            ,"-DCMAKE_C_COMPILER=mpicc"
>                            ,"-DCMAKE_CXX_COMPILER=mpic++"
>                            ,"-DCMAKE_VERBOSE_MAKEFILE=1"
> -                           ,(string-append "-DGKLIB_PATH=../parmetis-4.0.3/metis/GKlib")
> -                           ,(string-append "-DMETIS_PATH=../parmetis-4.0.3/metis" ))))
> +                           ,(string-append "-DGKLIB_PATH=../parmetis-"
> +                                           ,(package-version this-version) "/metis/GKlib"))
> +                           ,(string-append "-DMETIS_PATH=../parmetis-"
> +                                           ,(package-version this-version) "/metis"))))
>     (home-page "http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview")
>     (synopsis "Parallel Graph Partitioning and Fill-reducing Matrix Ordering")
>     (description
> ------
> 
> +    (license license:asl2.0)))
> 
> There is a problem with the licensing, however. In the source code,
> LICENSE.txt contains this:
> 
> ------
> Copyright & License Notice
> --------------------------
> 
> The ParMETIS package is copyrighted by the Regents of the 
> University of Minnesota. It can be freely used for educational and 
> research purposes by non-profit institutions and US government 
> agencies only. Other organizations are allowed to use ParMETIS 
> only for evaluation purposes, and any further uses will require prior 
> approval. The software may not be sold or redistributed without prior 
> approval. One may make copies of the software for their use provided 
> that the copies, are not sold or distributed, are used under the same 
> terms and conditions.
> 
> As unestablished research software, this code is provided on an  
> ``as is'' basis without warranty of any kind, either expressed or
> implied. The downloading, or executing any part of this software
> constitutes an implicit agreement to these terms. These terms and 
> conditions are subject to change at any time without prior notice.
> ------
> 
> I saw in 'metis/Changelog' that a relicensing to Apache 2 was done for
> the "metis" program in version 5.0.3. But, this is "parmetis", version
> 4.0.3.
> 
> If the copyright owners intend to release this as free software, they
> need to change the 'LICENSE.txt' file.


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#47613] [PATCH] add parmetis
  2021-04-07 14:02   ` Franck Pérignon
@ 2021-04-08  7:16     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2021-04-08  7:16 UTC (permalink / raw)
  To: Franck Pérignon; +Cc: 47613, Leo Famulari

Hi Franck,

Franck Pérignon <Franck.Perignon@univ-grenoble-alpes.fr> skribis:

> Regarding the license, I missed this. Is it possible to directly attached the LICENSE.txt in the guix recipe ? If so, what’s the proper syntax ?

Guix proper only includes free software:

  https://guix.gnu.org/manual/en/html_node/Software-Freedom.html

So I’m afraid we cannot get Parmetis in Guix until it’s free (it would
be interesting to discuss this with the authors).  :-/

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-08  7:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-06  9:39 [bug#47613] [PATCH] add parmetis Franck Pérignon
2021-04-06 17:43 ` Leo Famulari
2021-04-07 14:02   ` Franck Pérignon
2021-04-08  7:16     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).