unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#34780] OpenMPI Java support
@ 2019-03-07 10:49 Ricardo Wurmus
  2019-03-07 11:14 ` [bug#34780] [PATCH] gnu: openmpi: Add " Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2019-03-07 10:49 UTC (permalink / raw)
  To: 34780

Hi Guix,

this patch adds a “java” output to the “openmpi” package, providing
“mpi.jar” and other libraries.  The closure size of the “out” output
remains unchanged.

--
Ricardo

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

* [bug#34780] [PATCH] gnu: openmpi: Add Java support.
  2019-03-07 10:49 [bug#34780] OpenMPI Java support Ricardo Wurmus
@ 2019-03-07 11:14 ` Ricardo Wurmus
  2019-03-18  9:27   ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2019-03-07 11:14 UTC (permalink / raw)
  To: 34780; +Cc: ericbavier

* gnu/packages/mpi.scm (openmpi)[native-inputs]: Add openjdk11.
[outputs]: Add "java".
[arguments]: Add "--enable-mpi-java" to configure flags; add build phases
"set-JAVA_HOME" and "move-java".
---
 gnu/packages/mpi.scm | 36 ++++++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 10de6dee5b..316b2a5cd8 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -35,6 +35,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages fabric-management)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages java)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pciutils)
@@ -190,8 +191,9 @@ bind processes, and much more.")
        ("slurm" ,slurm)))              ;for PMI support (launching via "srun")
     (native-inputs
      `(("pkg-config" ,pkg-config)
-       ("perl" ,perl)))
-    (outputs '("out" "debug"))
+       ("perl" ,perl)
+       ("jdk" ,openjdk11 "jdk")))
+    (outputs '("out" "debug" "java"))
     (arguments
      `(#:configure-flags `("--enable-mpi-ext=affinity" ;cr doesn't work
                            "--enable-memchecker"
@@ -200,6 +202,8 @@ bind processes, and much more.")
                            "--with-hwloc=external"
                            "--with-libevent"
 
+                           "--enable-mpi-java"
+
                            ;; InfiniBand support
                            "--enable-openib-control-hdr-padding"
                            "--enable-openib-dynamic-sl"
@@ -224,6 +228,14 @@ bind processes, and much more.")
                                              "/include/infiniband/:"
                                              (getenv "CPLUS_INCLUDE_PATH")))
                       #t))
+                  ;; We could provide the location of the JDK in the configure
+                  ;; flags, but since the configure flags are embedded in the
+                  ;; info binaries that would leave a reference to the JDK in
+                  ;; the "out" output.  To avoid this we set JAVA_HOME.
+                  (add-after 'unpack 'set-JAVA_HOME
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
+                      #t))
                   (add-before 'build 'remove-absolute
                     (lambda _
                       ;; Remove compiler absolute file names (OPAL_FC_ABSOLUTE
@@ -252,6 +264,26 @@ bind processes, and much more.")
                     (lambda* (#:key outputs #:allow-other-keys)
                       (let ((out (assoc-ref outputs "out")))
                         (for-each delete-file (find-files out "config.log"))
+                        #t)))
+                  (add-after 'install 'move-java
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out  (assoc-ref outputs "out"))
+                            (java (assoc-ref outputs "java")))
+                        (for-each (lambda (item)
+                                    (let ((source (string-append out item))
+                                          (target (string-append java item)))
+                                      (mkdir-p (dirname target))
+                                      (rename-file source target)))
+                                  '("/share/man/man1/mpijavac.1"
+                                    "/share/doc/openmpi/javadoc-openmpi"
+                                    "/lib/mpi.jar"
+                                    "/lib/libmpi_java.la"
+                                    "/lib/libmpi_java.so.40.20.0"
+                                    "/lib/libmpi_java.so.40"
+                                    "/lib/libmpi_java.so"
+                                    "/bin/mpijavac.pl"
+                                    "/bin/mpijavac"
+                                    "/include/openmpi/ompi/mpi/java"))
                         #t))))))
     (home-page "http://www.open-mpi.org")
     (synopsis "MPI-3 implementation")
-- 
2.20.1

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

* [bug#34780] [PATCH] gnu: openmpi: Add Java support.
  2019-03-07 11:14 ` [bug#34780] [PATCH] gnu: openmpi: Add " Ricardo Wurmus
@ 2019-03-18  9:27   ` Ludovic Courtès
  2019-03-18 14:06     ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2019-03-18  9:27 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: ericbavier, 34780

Hi Ricardo,

Ricardo Wurmus <rekado@elephly.net> skribis:

> * gnu/packages/mpi.scm (openmpi)[native-inputs]: Add openjdk11.
> [outputs]: Add "java".
> [arguments]: Add "--enable-mpi-java" to configure flags; add build phases
> "set-JAVA_HOME" and "move-java".

Nice.

I’m uncomfortable adding OpenJDK as an input to Open MPI though, because
that puts more stress on the build times and potentially on platform
support as well.

Would it be an option to create a separate “openmpi-java” or would that
create problems down the road?

Thank you,
Ludo’.

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

* [bug#34780] [PATCH] gnu: openmpi: Add Java support.
  2019-03-18  9:27   ` Ludovic Courtès
@ 2019-03-18 14:06     ` Ricardo Wurmus
  2019-03-18 17:26       ` bug#34780: " Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2019-03-18 14:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: ericbavier, 34780


Ludovic Courtès <ludovic.courtes@inria.fr> writes:

> Hi Ricardo,
>
> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> * gnu/packages/mpi.scm (openmpi)[native-inputs]: Add openjdk11.
>> [outputs]: Add "java".
>> [arguments]: Add "--enable-mpi-java" to configure flags; add build phases
>> "set-JAVA_HOME" and "move-java".
>
> Nice.
>
> I’m uncomfortable adding OpenJDK as an input to OpenMPI though, because
> that puts more stress on the build times and potentially on platform
> support as well.

I understad.

> Would it be an option to create a separate “openmpi-java” or would that
> create problems down the road?

I’ll give that a try.  I’m not sure if it’s possible to build the Java
parts in isolation, but that would be nice.

-- 
Ricardo

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

* bug#34780: [PATCH] gnu: openmpi: Add Java support.
  2019-03-18 14:06     ` Ricardo Wurmus
@ 2019-03-18 17:26       ` Ricardo Wurmus
  2019-03-19  9:43         ` [bug#34780] " Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2019-03-18 17:26 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 34780-done, ericbavier


Ricardo Wurmus <rekado@elephly.net> writes:

>> Would it be an option to create a separate “openmpi-java” or would that
>> create problems down the road?
>
> I’ll give that a try.  I’m not sure if it’s possible to build the Java
> parts in isolation, but that would be nice.

This is done in commit fa5a25386620cec4b2543aae24fc9a0776aa3dca (it’s
called “java-openmpi”).

Thanks for the suggestion!

--
Ricardo

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

* [bug#34780] [PATCH] gnu: openmpi: Add Java support.
  2019-03-18 17:26       ` bug#34780: " Ricardo Wurmus
@ 2019-03-19  9:43         ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2019-03-19  9:43 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 34780-done, ericbavier

Ricardo Wurmus <rekado@elephly.net> skribis:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>>> Would it be an option to create a separate “openmpi-java” or would that
>>> create problems down the road?
>>
>> I’ll give that a try.  I’m not sure if it’s possible to build the Java
>> parts in isolation, but that would be nice.
>
> This is done in commit fa5a25386620cec4b2543aae24fc9a0776aa3dca (it’s
> called “java-openmpi”).

Great, thank you!

Ludo’.

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

end of thread, other threads:[~2019-03-19  9:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-07 10:49 [bug#34780] OpenMPI Java support Ricardo Wurmus
2019-03-07 11:14 ` [bug#34780] [PATCH] gnu: openmpi: Add " Ricardo Wurmus
2019-03-18  9:27   ` Ludovic Courtès
2019-03-18 14:06     ` Ricardo Wurmus
2019-03-18 17:26       ` bug#34780: " Ricardo Wurmus
2019-03-19  9:43         ` [bug#34780] " 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).