all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: 34780@debbugs.gnu.org
Cc: ericbavier@centurylink.net
Subject: [bug#34780] [PATCH] gnu: openmpi: Add Java support.
Date: Thu,  7 Mar 2019 12:14:22 +0100	[thread overview]
Message-ID: <20190307111422.12381-1-rekado@elephly.net> (raw)
In-Reply-To: <877edbufh8.fsf@mdc-berlin.de>

* 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

  reply	other threads:[~2019-03-07 11:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 10:49 [bug#34780] OpenMPI Java support Ricardo Wurmus
2019-03-07 11:14 ` Ricardo Wurmus [this message]
2019-03-18  9:27   ` [bug#34780] [PATCH] gnu: openmpi: Add " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190307111422.12381-1-rekado@elephly.net \
    --to=rekado@elephly.net \
    --cc=34780@debbugs.gnu.org \
    --cc=ericbavier@centurylink.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.